next-mdx icon indicating copy to clipboard operation
next-mdx copied to clipboard

Add reading time, word count

Open bketelsen opened this issue 4 years ago • 2 comments
trafficstars

Fantastic library, I'm really enjoying the simplicity it brings to building an mdx-powered site with relational data. It would be useful to add reading-time and wordCount parameters to the frontmatter. Would you accept a PR for this? Looking at the source, I believe it would be easiest to add these parameters in get-nodes.ts in the getFileData() function.

bketelsen avatar Mar 21 '21 11:03 bketelsen

Fantastic library, I'm really enjoying the simplicity it brings to building an mdx-powered site with relational data.

Thank you.

It would be useful to add reading-time and wordCount parameters to the frontmatter.

I'm using reading-time for a few sites and I agree this would definitely be useful.

Wondering what would the implementation look like.

  • We don't need this for all mdx types.
  • Make this configurable via next-mdx.json?
  • This adds a dependency on the reading-time package.

shadcn avatar Mar 21 '21 12:03 shadcn

@bketelsen A quick update here. I've been working on a Table of Contents module and I think I have an idea how we can solve this with plugins.

I'll post here when I have a working prototype.

Thanks for your help. Really appreciate it.

shadcn avatar Mar 29 '21 16:03 shadcn