Skip to content

Commit 1c80f19

Browse files
committed
add:rss feed meshery-community-feed.xml
Signed-off-by: FaheemOnHub <faheemmushtaq89@gmail.com>
1 parent 020b067 commit 1c80f19

1 file changed

Lines changed: 84 additions & 19 deletions

File tree

gatsby-config.js

Lines changed: 84 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ module.exports = {
1313
},
1414
flags: {
1515
FAST_DEV: true,
16-
PARALLEL_SOURCING: true
16+
PARALLEL_SOURCING: true,
1717
},
1818
trailingSlash: "never",
1919
plugins: [
2020
{
2121
resolve: "gatsby-plugin-webpack-bundle-analyser-v2",
2222
options: {
23-
disable: true
24-
}
23+
disable: true,
24+
},
2525
},
2626
{
2727
resolve: "gatsby-plugin-sitemap",
@@ -41,10 +41,8 @@ module.exports = {
4141
}
4242
}
4343
`,
44-
resolvePages: ({
45-
allSitePage: { nodes: allPages },
46-
}) => {
47-
return allPages.map(page => {
44+
resolvePages: ({ allSitePage: { nodes: allPages } }) => {
45+
return allPages.map((page) => {
4846
return { ...page };
4947
});
5048
},
@@ -73,8 +71,8 @@ module.exports = {
7371
// or disable plugins
7472
inlineStyles: false,
7573
cleanupIds: false,
76-
}
77-
}
74+
},
75+
},
7876
},
7977
],
8078
},
@@ -287,7 +285,71 @@ module.exports = {
287285
},
288286
{
289287
serialize: ({ query: { site, allPosts } }) => {
290-
return allPosts.nodes.map(node => {
288+
return allPosts.nodes.map((node) => {
289+
return Object.assign({}, node.frontmatter, {
290+
title: node.frontmatter.title,
291+
author: node.frontmatter.author,
292+
description:
293+
node.frontmatter.description || node.frontmatter.subtitle,
294+
date: node.frontmatter.date,
295+
url: site.siteMetadata.siteUrl + node.fields.slug,
296+
guid: site.siteMetadata.siteUrl + node.fields.slug,
297+
enclosure: node.frontmatter.thumbnail && {
298+
url:
299+
site.siteMetadata.siteUrl +
300+
node.frontmatter.thumbnail.publicURL,
301+
},
302+
custom_elements: [
303+
{ "content:encoded": node.html },
304+
{ "content:type": node.frontmatter.type },
305+
{ "content:category": node.frontmatter.category },
306+
{ "content:tags": node.frontmatter.tags?.join(", ") || "" },
307+
],
308+
});
309+
});
310+
},
311+
query: `{
312+
allPosts: allMdx(
313+
sort: {frontmatter: {date: DESC}}
314+
filter: {
315+
fields: {collection: {in: ["blog", "resources", "news", "events"]}},
316+
frontmatter: {
317+
published: { eq: true }
318+
category: { in: ["Meshery", "Announcements", "Events"] }
319+
tags: { in: ["Community", "Meshery", "mesheryctl"] }
320+
}
321+
}
322+
limit: 30
323+
) {
324+
nodes {
325+
body
326+
html
327+
frontmatter {
328+
title
329+
author
330+
description
331+
subtitle
332+
date(formatString: "MMM DD YYYY")
333+
type
334+
category
335+
thumbnail {
336+
publicURL
337+
}
338+
tags
339+
}
340+
fields {
341+
collection
342+
slug
343+
}
344+
}
345+
}
346+
}`,
347+
output: "/meshery-community-feed.xml",
348+
title: "Meshery RSSFeed",
349+
},
350+
{
351+
serialize: ({ query: { site, allPosts } }) => {
352+
return allPosts.nodes.map((node) => {
291353
return Object.assign({}, node.frontmatter, {
292354
title: node.frontmatter.title,
293355
author: node.frontmatter.author,
@@ -296,7 +358,9 @@ module.exports = {
296358
url: site.siteMetadata.siteUrl + node.fields.slug,
297359
guid: site.siteMetadata.siteUrl + node.fields.slug,
298360
enclosure: node.frontmatter.thumbnail && {
299-
url: site.siteMetadata.siteUrl + node.frontmatter.thumbnail.publicURL,
361+
url:
362+
site.siteMetadata.siteUrl +
363+
node.frontmatter.thumbnail.publicURL,
300364
},
301365
custom_elements: [{ "content:encoded": node.html }],
302366
});
@@ -328,11 +392,11 @@ module.exports = {
328392
}
329393
}`,
330394
output: "/blog/feed.xml",
331-
title: "Layer5 Blog"
395+
title: "Layer5 Blog",
332396
},
333397
{
334398
serialize: ({ query: { site, allPosts } }) => {
335-
return allPosts.nodes.map(node => {
399+
return allPosts.nodes.map((node) => {
336400
return Object.assign({}, node.frontmatter, {
337401
title: node.frontmatter.title,
338402
author: node.frontmatter.author,
@@ -341,7 +405,9 @@ module.exports = {
341405
url: site.siteMetadata.siteUrl + node.fields.slug,
342406
guid: site.siteMetadata.siteUrl + node.fields.slug,
343407
enclosure: node.frontmatter.thumbnail && {
344-
url: site.siteMetadata.siteUrl + node.frontmatter.thumbnail.publicURL,
408+
url:
409+
site.siteMetadata.siteUrl +
410+
node.frontmatter.thumbnail.publicURL,
345411
},
346412
custom_elements: [{ "content:encoded": node.html }],
347413
});
@@ -373,7 +439,7 @@ module.exports = {
373439
}
374440
}`,
375441
output: "/events/feed.xml",
376-
title: "Layer5 Events"
442+
title: "Layer5 Events",
377443
},
378444
],
379445
},
@@ -514,8 +580,8 @@ module.exports = {
514580
options: {
515581
defaults: {
516582
placeholder: "blurred",
517-
}
518-
}
583+
},
584+
},
519585
},
520586
{
521587
resolve: "gatsby-transformer-sharp",
@@ -547,10 +613,9 @@ module.exports = {
547613
host: "https://layer5.io",
548614
sitemap: "https://layer5.io/sitemap-index.xml",
549615
policy: [{ userAgent: "*", allow: "/" }],
550-
}
616+
},
551617
},
552618
"gatsby-plugin-meta-redirect",
553619
// make sure this is always the last one
554620
],
555-
556621
};

0 commit comments

Comments
 (0)