Skip to content

Commit

Permalink
fix(gatsby-plugin-feed): update documentation and expose custom_names…
Browse files Browse the repository at this point in the history
…paces
  • Loading branch information
geocine committed Apr 12, 2023
1 parent 85d2aed commit 91a45de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/gatsby-plugin-feed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ module.exports = {
nodes {
excerpt
html
fields {
slug
fields {
slug
}
frontmatter {
title
Expand All @@ -68,13 +68,18 @@ module.exports = {
match: "^/blog/",
// optional configuration to specify external rss feed, such as feedburner
link: "https://feeds.feedburner.com/gatsby/blog",
// optional to specify custom namespace for node elements
custom_namespaces: {
media: 'http://search.yahoo.com/mrss/',
}
},
],
},
},
],
}
```
The GraphQL `query` property located directly under `options` queries `siteMetadata` from `gatsby-config` which contains the `title`, `description`, and `site_url` properties that are used to populate [the `feedOptions` of the `rss` package](https://www.npmjs.com/package/rss#feedoptions).

Each feed must include `output`, `query`, `title`, and `serialize`. You'll need to write the `serialize` function in order to fit your use case.

Expand Down
1 change: 1 addition & 0 deletions packages/gatsby-plugin-feed/src/plugin-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const feed = ({ Joi }) =>
serialize: Joi.func().required(),
match: Joi.string(),
link: Joi.string(),
custom_namespaces: Joi.object(),
})
.unknown(true)
.external(({ query }) => {
Expand Down

0 comments on commit 91a45de

Please sign in to comment.