gatsby-plugin-readingtime

3.0.2 • Public • Published

npm

gatsby-plugin-readingtime

Get reading time estimates for any content from any source in your Gatsby project's GraphQL schema.

Install

npm i gatsby-plugin-readingtime

yarn add gatsby-plugin-readingtime

config

{
  plugins: [
    {
      resolve: `gatsby-plugin-readingtime`,
      options: {
        config: {
          // configuration for reading-time package https://github.com/ngryman/reading-time
        },
        types: {
          // Key: GraphQL Type to add reading times to, Value: Resolver function takes source node of Defined GraphQL type and returns content to be processed.
          WpPost: source => {
            const { blocks } = source;
            return blocks.map(block => block.saveContent).join('');
          },
        },
      },
    },
  ]
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.2
    14
    • latest

Version History

Package Sidebar

Install

npm i gatsby-plugin-readingtime

Weekly Downloads

274

Version

3.0.2

License

MIT

Unpacked Size

5.13 kB

Total Files

5

Last publish

Collaborators

  • lekoarts
  • moonmeister