I want to achieve these features; It’s kind of similar to what a plugin like Docusaurus does:
- Before do build, I make a markdown file in which I can specify a ‘template name’ with which the output
html
file will be generated.- I can configure which template to use, by creating several different template files(
.jsx
/.tsx
).
- I can configure which template to use, by creating several different template files(
- When I build my website(using Vite), Vite will check all
md
files belong to my project directory and pre-build thosemd
s intohtml
s repectively.- Each pages can be served as static generated pages. (So that the main SPA web doesn’t have to preload or include the whole pages in built source)
- Also, along with generating static files, Vite will build the main site as normal in which we can access the generated static pages.
Is there any Vite(or Rollup) plugin to use to do this jobs? Plus, is it a good start-point to dig into Rehype to develop this feature from the scratch?
I think vitepress
is what you are looking for. It’s very similar to the Docusaurus.
Here is the link:
https://vitepress.dev/
stackoverflow.com/questions/75533685/…