Programmatically create pages? #1641
-
We're making a new Docs site with VitePress. We're loving it. One area of the site will be a set of pages (perhaps hundreds), mostly identical, with minor variation. Imagine populating .vitepress/dist folder with something like the following: . The contents of the 'spec' pages are currently in JSON files. Ideally, we'd programmatically collect those .json files and use their contents to produce pages -- but do so in a way that still allows us to fully enjoy all that VitePress has to offer. Gatsbyjs, for example, has the concept of Open to ideas! (Anything to help save time, or point us in the right direction, or prevent us from rabbit holes. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Write a script to transform the data in a JSON file to a MD file and emit it to the spec directory? 👀 There isn't a way to directly feed that data to VitePress, you'll need to generate a markdown file corresponding to each of your spec.json files and write it to filesystem before building the docs. |
Beta Was this translation helpful? Give feedback.
Write a script to transform the data in a JSON file to a MD file and emit it to the spec directory? 👀
There isn't a way to directly feed that data to VitePress, you'll need to generate a markdown file corresponding to each of your spec.json files and write it to filesystem before building the docs.