Neolithic Populous Metropolis

    gatsby-plugin-readingtime

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

    Install

    npm i gatsby-plugin-readingtime

    DownloadsWeekly Downloads

    193

    Version

    2.1.0

    License

    MIT

    Unpacked Size

    3.93 kB

    Total Files

    6

    Last publish

    Collaborators

    • moonmeister