File tree Expand file tree Collapse file tree 3 files changed +1589
-1406
lines changed
Expand file tree Collapse file tree 3 files changed +1589
-1406
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,63 @@ const config: GatsbyConfig = {
199199 } ) ) ,
200200 } ,
201201 } ,
202+ {
203+ resolve : "gatsby-plugin-feed" ,
204+ options : {
205+ query : `
206+ {
207+ site {
208+ siteMetadata {
209+ title
210+ description
211+ siteUrl
212+ site_url: siteUrl
213+ }
214+ }
215+ }
216+ ` ,
217+ feeds : [
218+ {
219+ serialize : ( { query : { site, allMdx } } ) => {
220+ return allMdx . edges . map ( edge => {
221+
222+ const siteUrl = site . siteMetadata . siteUrl
223+ const slug = siteUrl + edge . node . fields . slug
224+
225+ return Object . assign ( { } , edge . node . frontmatter , {
226+ url : slug ,
227+ guid : slug ,
228+ custom_elements : [
229+ { "content:encoded" : edge . node . excerpt }
230+ ] ,
231+ } )
232+ } )
233+ } ,
234+ query : `
235+ {
236+ allMdx(sort: {frontmatter: {date: DESC}}) {
237+ edges {
238+ node {
239+ excerpt(pruneLength: 340)
240+ fields {
241+ slug
242+ }
243+ frontmatter {
244+ title
245+ description
246+ date
247+ }
248+ }
249+ }
250+ }
251+ }
252+ ` ,
253+ output : "/rss.xml" ,
254+ title : "Rishi's Blog - rishikc.com" ,
255+ } ,
256+ ]
257+ }
258+ } ,
202259 "gatsby-plugin-image" ,
203260 "gatsby-plugin-sharp" ,
204261 "gatsby-transformer-sharp" ,
Original file line number Diff line number Diff line change 3737 "gatsby-plugin-canonical-urls" : " ^5.10.0" ,
3838 "gatsby-plugin-dark-mode" : " ^1.1.2" ,
3939 "gatsby-plugin-disqus" : " ^1.2.6" ,
40+ "gatsby-plugin-feed" : " ^5.11.0" ,
4041 "gatsby-plugin-image" : " ^3.10.0" ,
4142 "gatsby-plugin-local-search" : " ^2.0.1" ,
4243 "gatsby-plugin-manifest" : " ^5.10.0" ,
8081 "tailwindcss" : " ^3.3.2" ,
8182 "typescript" : " ^5.0.4"
8283 }
83- }
84+ }
You can’t perform that action at this time.
0 commit comments