Gatsby plugin that generates RSS 2, Atom and JSON feeds for your site.
npm install @fec/gatsby-plugin-advanced-feed> Gatsby plugin that generates RSS 2, Atom and JSON feeds for your site.
Made by 👨💻 Florian Eckerstorfer in 🎡 Vienna, Europe.
1. Features
1. Differences to gatsby-plugin-feed
1. Installation & Setup
1. Configuration
1. Code of Conduct
1. Change log
1. License
- Generates RSS 2.0
- Generates Atom 1.0
- Generates JSON Feed 1.0
- Supports multiple feeds
- ✅ Supports Atom 1.0 and JSON Feed 1.0 in addition to RSS 2.0
- ✅ More options to customize feed description, copyright, author, etc
- ❌ Does not support serialize and query options (yet)
First you need to install the plugin with NPM or Yarn:
``shell`
npm install @fec/gatsby-plugin-advanced-feed --save
yarn add @fec/gatsby-plugin-advanced-feed
Versions 2.x of this plugin are tested with Gatsby v3, you might need to use @fec/gatsby-plugin-advanced-feed@1 if you are still using Gatsby v2.
Next you need add the plugin to the plugins list in gatsby-config.js:
`javascript`
// ./gatsby-config.js
module.exports = {
// ...
plugins: [
// ...
'@fec/gatsby-plugin-advanced-feed',
],
};
> ⚠️ Feeds are only generated on gatsby build, when running the local development server (gatsby develop) no feeds will be generated.
You can configure @fec/gatsby-plugin-advanced-feed. The following example contains all configuration options and their default value:
`javascript
// ./gatsby-config.js
module.exports = {
// ...
plugins: [
// ...
{
resolve: '@fec/gatsby-plugin-advanced-feed',
options: {
feeds: [
{
// Configure the feed; smart defaults are choosen if not set
author: undefined, // default: site.siteMetadata.author
copyright: undefined, // default: "All rights reserved {year}, {site.siteMetadata.author}"
description: undefined, // default: site.siteMetadata.description
email: false, // default: false ➞ no email in feed; undefined ➞ site.siteMetadata.email
id: undefined, // default: site.siteMetadata.siteUrl
link: undefined, // default: site.siteMetadata.siteUrl
title: undefined, // default: site.siteMetadata.title
// Add tags in
to feeds for all pages or regular expression to match pathnames // Number of articles to include in feed
limit: 10,
// Include all pages which
fileAbsolutePath matches this regular expression
match: '^/blog/', // File names of generated feeds
output: {
rss2: 'rss.xml',
atom: 'atom.xml',
json: 'feed.json',
},
}
],
},
],
};
`$3
@fec/gatsby-plugin-advanced-feed allows you to link the feeds in the or your page. This can be configured on a per-feed basis. If the option createLinkInHead for a feed is true the will be included on all pages. You can include the only for certain pages by specifying a regular expression.In the following example the
tags will only be inserted on all pages which pathname matches the regular expression /^\/blog/:`javascript
// ./gatsby-config.js
module.exports = {
// ...
plugins: [
// ...
{
resolve: '@fec/gatsby-plugin-advanced-feed',
options: {
feeds: [
createLinkInHead: /^\/blog/,
]
}
}
],
};
``See CODE_OF_CONDUCT
See CHANGELOG
See LICENSE