What is Vuesho
A docs framework for Vue, on Vite and Nitro.
Vuesho is a docs framework for Vue that turns your content into a fast, polished documentation site. It ports the UI and content model of Fumadocs and the plugin system of Fumapress to Vue, on Vite and Nitro.
Pages
A page is a Markdown file in content/. Each page compiles to a Vue component, so it can use components and expressions in its Markdown:
---
title: Installation
---
<Callout>Acme requires Node.js {{ node }} or later.</Callout>
<script setup>
const node = 24;
</script>For a page that isn't documentation, like a landing page, write a custom page: a Vue component in src/pages/.
Content Sources
Pages don't have to be files in your repository. Vuesho reads pages from content sources: content/ is the default source, and other sources read:
A source is read when the site builds, or by the server while the site runs, so a page edited in a CMS changes without a new build.
Plugins
Every feature is a plugin: search, the sitemap, llms.txt, Open Graph images, the blog and the API references. A plugin in your config has the same hooks as the built-in ones, so it can add routes, change content, extend Markdown and add UI. This plugin serves the page count:
createSite(docs.toSource()).plugins(recommendedPreset(), {
name: "status",
routes({ createApi }) {
createApi({
path: "/api/status.json",
render: "static", // Written to a file when the site builds
GET: () => Response.json({ pages: this.getPages().length }),
});
},
});To replace a built-in feature, turn off its plugin and add another, like a search service instead of the built-in search.
Theme
The UI is Fumadocs UI, ported to Vue: six layouts, color presets, and components like callouts, tabs and steps. You customize it step by step, and each step changes only the part you touch, so package updates still reach the rest of the UI:
- Change the colors and fonts in CSS, with Styling.
- Choose a layout per page or per source.
- Put your components into the layouts with slots.
- Copy a part of the UI into your project, and edit it.
Static and Server Rendering
Pages render to HTML when the site builds, so a site with only Markdown pages deploys to any static host. Routes that need a server, like an AI chat or pages read from a CMS on each request, render on request. For those routes, the build adds a Nitro server, while the other pages stay static.
Where Code Runs
- The build runs
vite.config.tsandvuesho.config.ts, and compiles the pages. - The server runs
vuesho.config.tsagain, with the plugins' hooks, and renders pages to HTML. It runs invuesho dev, and in production for pages rendered on request. - The browser runs the theme, the components and the pages, once the server has rendered them.
Secrets
Read a secret, like an API key, from process.env in vuesho.config.ts, never in a file that runs in the browser.