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('');
          },
        },
      },
    },
  ]
}

/gatsby-plugin-readingtime/

    Package Sidebar

    Install

    npm i gatsby-plugin-readingtime

    Weekly Downloads

    698

    Version

    3.0.2

    License

    MIT

    Unpacked Size

    5.13 kB

    Total Files

    5

    Last publish

    Collaborators

    • lekoarts
    • moonmeister