@@ -13,15 +13,28 @@ module.exports = {
1313 } ,
1414 flags : {
1515 FAST_DEV : true ,
16- PARALLEL_SOURCING : true
16+ PARALLEL_SOURCING : true ,
1717 } ,
1818 trailingSlash : "never" ,
1919 plugins : [
20+ {
21+ resolve : "gatsby-plugin-netlify" ,
22+ options : {
23+ headers : {
24+ "/*" : [
25+ "X-Frame-Options: SAMEORIGIN" ,
26+ "Content-Security-Policy: frame-ancestors 'self'" ,
27+ ] ,
28+ } ,
29+ mergeSecurityHeaders : true ,
30+ mergeCachingHeaders : true ,
31+ } ,
32+ } ,
2033 {
2134 resolve : "gatsby-plugin-webpack-bundle-analyser-v2" ,
2235 options : {
23- disable : true
24- }
36+ disable : true ,
37+ } ,
2538 } ,
2639 {
2740 resolve : "gatsby-plugin-sitemap" ,
@@ -41,10 +54,8 @@ module.exports = {
4154 }
4255 }
4356 ` ,
44- resolvePages : ( {
45- allSitePage : { nodes : allPages } ,
46- } ) => {
47- return allPages . map ( page => {
57+ resolvePages : ( { allSitePage : { nodes : allPages } } ) => {
58+ return allPages . map ( ( page ) => {
4859 return { ...page } ;
4960 } ) ;
5061 } ,
@@ -73,8 +84,8 @@ module.exports = {
7384 // or disable plugins
7485 inlineStyles : false ,
7586 cleanupIds : false ,
76- }
77- }
87+ } ,
88+ } ,
7889 } ,
7990 ] ,
8091 } ,
@@ -287,7 +298,71 @@ module.exports = {
287298 } ,
288299 {
289300 serialize : ( { query : { site, allPosts } } ) => {
290- return allPosts . nodes . map ( node => {
301+ return allPosts . nodes . map ( ( node ) => {
302+ return Object . assign ( { } , node . frontmatter , {
303+ title : node . frontmatter . title ,
304+ author : node . frontmatter . author ,
305+ description :
306+ node . frontmatter . description || node . frontmatter . subtitle ,
307+ date : node . frontmatter . date ,
308+ url : site . siteMetadata . siteUrl + node . fields . slug ,
309+ guid : site . siteMetadata . siteUrl + node . fields . slug ,
310+ enclosure : node . frontmatter . thumbnail && {
311+ url :
312+ site . siteMetadata . siteUrl +
313+ node . frontmatter . thumbnail . publicURL ,
314+ } ,
315+ custom_elements : [
316+ { "content:encoded" : node . html } ,
317+ { "content:type" : node . frontmatter . type } ,
318+ { "content:category" : node . frontmatter . category } ,
319+ { "content:tags" : node . frontmatter . tags ?. join ( ", " ) || "" } ,
320+ ] ,
321+ } ) ;
322+ } ) ;
323+ } ,
324+ query : `{
325+ allPosts: allMdx(
326+ sort: {frontmatter: {date: DESC}}
327+ filter: {
328+ fields: {collection: {in: ["blog", "resources", "news", "events"]}},
329+ frontmatter: {
330+ published: { eq: true }
331+ category: { in: ["Meshery", "Announcements", "Events"] }
332+ tags: { in: ["Community", "Meshery", "mesheryctl"] }
333+ }
334+ }
335+ limit: 30
336+ ) {
337+ nodes {
338+ body
339+ html
340+ frontmatter {
341+ title
342+ author
343+ description
344+ subtitle
345+ date(formatString: "MMM DD YYYY")
346+ type
347+ category
348+ thumbnail {
349+ publicURL
350+ }
351+ tags
352+ }
353+ fields {
354+ collection
355+ slug
356+ }
357+ }
358+ }
359+ }` ,
360+ output : "/meshery-community-feed.xml" ,
361+ title : "Meshery RSSFeed" ,
362+ } ,
363+ {
364+ serialize : ( { query : { site, allPosts } } ) => {
365+ return allPosts . nodes . map ( ( node ) => {
291366 return Object . assign ( { } , node . frontmatter , {
292367 title : node . frontmatter . title ,
293368 author : node . frontmatter . author ,
@@ -296,7 +371,9 @@ module.exports = {
296371 url : site . siteMetadata . siteUrl + node . fields . slug ,
297372 guid : site . siteMetadata . siteUrl + node . fields . slug ,
298373 enclosure : node . frontmatter . thumbnail && {
299- url : site . siteMetadata . siteUrl + node . frontmatter . thumbnail . publicURL ,
374+ url :
375+ site . siteMetadata . siteUrl +
376+ node . frontmatter . thumbnail . publicURL ,
300377 } ,
301378 custom_elements : [ { "content:encoded" : node . html } ] ,
302379 } ) ;
@@ -328,11 +405,11 @@ module.exports = {
328405 }
329406}` ,
330407 output : "/blog/feed.xml" ,
331- title : "Layer5 Blog"
408+ title : "Layer5 Blog" ,
332409 } ,
333410 {
334411 serialize : ( { query : { site, allPosts } } ) => {
335- return allPosts . nodes . map ( node => {
412+ return allPosts . nodes . map ( ( node ) => {
336413 return Object . assign ( { } , node . frontmatter , {
337414 title : node . frontmatter . title ,
338415 author : node . frontmatter . author ,
@@ -341,7 +418,9 @@ module.exports = {
341418 url : site . siteMetadata . siteUrl + node . fields . slug ,
342419 guid : site . siteMetadata . siteUrl + node . fields . slug ,
343420 enclosure : node . frontmatter . thumbnail && {
344- url : site . siteMetadata . siteUrl + node . frontmatter . thumbnail . publicURL ,
421+ url :
422+ site . siteMetadata . siteUrl +
423+ node . frontmatter . thumbnail . publicURL ,
345424 } ,
346425 custom_elements : [ { "content:encoded" : node . html } ] ,
347426 } ) ;
@@ -373,7 +452,7 @@ module.exports = {
373452 }
374453}` ,
375454 output : "/events/feed.xml" ,
376- title : "Layer5 Events"
455+ title : "Layer5 Events" ,
377456 } ,
378457 ] ,
379458 } ,
@@ -455,8 +534,8 @@ module.exports = {
455534 {
456535 resolve : "gatsby-source-filesystem" ,
457536 options : {
458- path : `${ __dirname } /src/collections/service-mesh- workshops` ,
459- name : "service-mesh- workshops" ,
537+ path : `${ __dirname } /src/collections/workshops` ,
538+ name : "workshops" ,
460539 } ,
461540 } ,
462541 {
@@ -514,8 +593,8 @@ module.exports = {
514593 options : {
515594 defaults : {
516595 placeholder : "blurred" ,
517- }
518- }
596+ } ,
597+ } ,
519598 } ,
520599 {
521600 resolve : "gatsby-transformer-sharp" ,
@@ -547,10 +626,9 @@ module.exports = {
547626 host : "https://layer5.io" ,
548627 sitemap : "https://layer5.io/sitemap-index.xml" ,
549628 policy : [ { userAgent : "*" , allow : "/" } ] ,
550- }
629+ } ,
551630 } ,
552631 "gatsby-plugin-meta-redirect" ,
553632 // make sure this is always the last one
554633 ] ,
555-
556634} ;
0 commit comments