Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Add reading time, word count #3

Open
bketelsen opened this issue Mar 21, 2021 · 2 comments
Open

Add reading time, word count #3

bketelsen opened this issue Mar 21, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@bketelsen
Copy link

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.

@shadcn
Copy link
Owner

shadcn commented Mar 21, 2021

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 shadcn added the enhancement New feature or request label Mar 21, 2021
@shadcn
Copy link
Owner

shadcn commented Mar 29, 2021

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants