Skip to Content
Vuesho

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:

content/install.md
---
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:

vuesho.config.ts
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:

  1. Change the colors and fonts in CSS, with Styling.
  2. Choose a layout per page or per source.
  3. Put your components into the layouts with slots.
  4. 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.ts and vuesho.config.ts, and compiles the pages.
  • The server runs vuesho.config.ts again, with the plugins' hooks, and renders pages to HTML. It runs in vuesho 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.