-
How to calculate the reading time of posts using the gatsby WordPress plugin? |
Beta Was this translation helpful? Give feedback.
Answered by
PsyGik
May 25, 2021
Replies: 1 comment 3 replies
-
Simplest implementation:
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)
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
pradtv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simplest implementation:
npm install reading-time