Skip to content
Discussion options

You must be logged in to vote

Simplest implementation:

npm install reading-time

const readingTime = require('reading-time');

const entityWithReadingTime = ({content, ...rest}) => ({
  content,
  readingTime: content != null && readingTime(content),
  ...rest
});

{
  resolve: `gatsby-source-wordpress`,
  options: {
    // ...
    normalizer: ({entities}) => entities.map(entityWithReadingTime)
  }
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@pradtv
Comment options

@PsyGik
Comment options

@pradtv
Comment options

Answer selected by pradtv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
topic: source-wordpress Related to Gatsby's integration with WordPress
2 participants