Socket
Socket
Sign inDemoInstall

gatsby-plugin-readingtime-contentful

Package Overview
Dependencies
5
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gatsby-plugin-readingtime-contentful

Adds a medium-like reading time estimate to your Gatsby Contentful content. Powered by [`reading-time`](https://github.com/ngryman/reading-time).


Version published
Weekly downloads
40
increased by17.65%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

gatsby-plugin-readingtime-contentful

Adds a medium-like reading time estimate to your Gatsby Contentful content. Powered by reading-time.

Installation

Install

yarn add gatsby-plugin-readingtime-contentful
// gatsby-config.js
  ...
  plugins: [
    'gatsby-plugin-readingtime-contentful',
     ...
  ],

Usage

Example query

Where content is a rich text field.

export const query = graphql`
query MagazineArticles {
  allContentfulArticle{
    edges {
      node {
        title
        locale: node_locale
        createdAt
        content {
          json
          fields {
            readingTime {
              text
              minutes
              time
              words
            }
          }
        }
      }
    }
  }
}

`;

Fields

There are 4 available fields within readingTime:

  • text: '1 min read',
  • minutes: 1,
  • time: 60000, (milliseconds)
  • words: 200

Keywords

FAQs

Last updated on 16 Sep 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc