1.2.4 • Published 4 years ago

gatsby-plugin-rsshub v1.2.4

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

gatsby-plugin-rsshub

Generate static xml from rsshub

NOTE: This plugin only generates output when run in production mode! To test your sitemap, run: gatsby build && gatsby serve

Pre require

You must install gatsby-source-rsshub first.

Install

npm install --save gatsby-plugin-rsshub

How to Use

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-rsshub`
    }

All options:

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-rsshub`,
      options: {
        // xml or atom, default xml
        outputType:"xml",
        // default 150
        titleLengthLimit:150,
        // rss output path prefix, base on public , default ""
        prefix:'', 
        // query siteUrl graphql
        query: `
          {
            site {
              siteMetadata {
                siteUrl
              }
            }
          }
        `,
        // should return object with key siteUrl
        serialize({query}){
          return {siteUrl:query.site.siteMetadata.siteUrl}
        },
        // if you need to custom the template data 
        templateDataSerialize(data){
          data.title = 'xxx';
          return data
        },
        // generate meta index page path
        indexPath:"/rsshub",
        // index template component
        indexComponent:""
      },
    },
  ],
}
1.2.4

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago