# What is Vuesho

A docs framework for Vue, on Vite and Nitro.

Vuesho is a docs framework for [Vue](https://vuejs.org) that turns your content into a fast, polished documentation site. It ports the UI and content model of [Fumadocs](https://fumadocs.dev) and the plugin system of Fumapress to Vue, on [Vite](https://vite.dev) and [Nitro](https://nitro.build).

## Pages [#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:

```md title="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](/custom-pages): a Vue component in `src/pages/`.

## Content Sources [#content-sources]

Pages don't have to be files in your repository. Vuesho reads pages from [content sources](/content-sources): `content/` is the default source, and other sources read:

- a CMS, like [Notion](/content-sources/notion) or [Sanity](/content-sources/sanity)
- an [Obsidian](/content-sources/obsidian) vault
- an API document, like [OpenAPI](/api-docs/openapi)

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 [#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](/plugin-api) as the built-in ones, so it can add routes, change content, extend Markdown and add UI. This plugin serves the page count:

```ts title="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](/search/services) instead of the built-in search.

## Theme [#theme]

The UI is [Fumadocs UI](https://fumadocs.dev/docs/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](/styling).
2. Choose a [layout](/layouts) per page or per source.
3. Put your components into the layouts with [slots](/theme#slots).
4. [Copy a part of the UI](/theme#copying-the-ui) into your project, and edit it.

## Static and Server Rendering [#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](/dynamic-rendering). For those routes, the build adds a Nitro server, while the other pages stay static.

### Where Code Runs [#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.

<Callout title="Secrets">
Read a secret, like an API key, from `process.env` in `vuesho.config.ts`, never in a file that
runs in the browser.
</Callout>
