Skip to content

Commit

Permalink
Add date example to RSS feed plugin readme (#10225)
Browse files Browse the repository at this point in the history
* Add date example to readme

* Add note to readme for custom feed queries

This should make it clearer what the correct keys are for custom queries (e.g. should be *date*, not *pubDate*).
  • Loading branch information
tyhopp authored and LekoArts committed Dec 1, 2018
1 parent ce7119d commit b5018b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/gatsby-plugin-feed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ plugins: [
return allMarkdownRemark.edges.map(edge => {
return Object.assign({}, edge.node.frontmatter, {
description: edge.node.excerpt,
date: edge.node.frontmatter.date,
url: site.siteMetadata.siteUrl + edge.node.fields.slug,
guid: site.siteMetadata.siteUrl + edge.node.fields.slug,
custom_elements: [{ "content:encoded": edge.node.html }],
Expand Down Expand Up @@ -85,4 +86,6 @@ plugins: [
]
```

To see what option keys are valid, see [the itemOptions section](https://www.npmjs.com/package/rss#itemoptions) of the RSS module.

NOTE: This plugin only generates the `/rss.xml` file when run in `production` mode! To test your feed, run: `gatsby build && gatsby serve`.

0 comments on commit b5018b1

Please sign in to comment.