How to use the filesystem to generate links? #2487
Unanswered
redonkulus
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm following the Folders with Index Pages document to add index pages for my site. On this index page, I would like to create links automatically to the sub-pages based on the pages in the file system.
When trying to use the
fs
Node.js library, the build system breaks (as Webpack cannot compile thefs
library). Is there another way to access the file system to generate these links automatically?An example from the Nextra docs where they hardcode the links to the directory pages, I'd like to avoid hardcoding the links: https://github.com/shuding/nextra/blob/main/docs/pages/docs/docs-theme.mdx#L14
Beta Was this translation helpful? Give feedback.
All reactions