Markdown
Markdown pages with Vue components.
Each page is a Markdown file in content/, with GitHub Flavored Markdown like tables, task lists and footnotes. Pages are also Vue templates, so components work anywhere in them.
Frontmatter
Frontmatter is the YAML block at the top of a page. Only title is required:
---
title: Installation # The page heading, and its name in the sidebar
description: Install Acme in your project. # Shown under the heading and in search results
icon: Rocket # A Lucide icon beside the name, with `lucideIconsPlugin()`
full: true # Use the full width, without the table of contents
draft: true # Show the page in `vuesho dev` only
date: 2026-11-25 # When the page was written, for feeds
layout: home # The layout to use, from the theme
ogImage: # The texts of the Open Graph image, with `ogImagePlugin()`
title: Install Acme in a Minute
---The title renders as the page heading, so start the body at ##. To add custom fields, define a frontmatter schema.
Computed Frontmatter
To compute frontmatter when the site builds, export frontmatter from a <script> block. Its fields override the YAML:
---
title: Requirements
---
<script>
import { version } from "vue/package.json";
export const frontmatter = { description: `Built with Vue ${version}.` };
</script>Headings
Vuesho generates each heading's ID from its text. Add a tag at the end of a heading to set its ID, or to change how the table of contents shows it:
## Installation
<!-- The ID is "setup" instead of "installation". -->
## Installation [#setup]
<!-- Hidden from the table of contents. -->
## Changelog [!toc]
<!-- Only in the table of contents, for a section that a component renders. -->
## Options [toc]Links
Link to another page by its file path, relative to the current page. Vuesho resolves the link to that page's URL, with the base path:
See [the requirements](./install.md#requirements).
<!-- A URL works too. -->
See [the API](/reference/api).A link from the root, like /reference/api, is a URL of the site. A URL ending in .md is a page's Markdown version, so link to a page by its URL without the extension, or by its relative path.
Link Validation
vuesho build fails when a link points to a page or a heading that doesn't exist. Configure the check in the recommended preset:
createSite(docs.toSource()).plugins(
recommendedPreset({
linkValidation: {
// Skip some links
ignore: (link) => link.href.startsWith("/api/"),
// Check external links too
external: async (url) => (await fetch(url, { method: "HEAD" })).ok,
// Handle dead links yourself, instead of failing the build
report: (links) => console.warn(links),
},
}),
);Images
A relative path points to an image next to the page, which is bundled with it. An absolute path points to a file in public/:

Images covers their sizes, placeholders and optimization.
Code Blocks
Add a title and line numbers after the language, and highlight a line with a comment:
```ts title="src/greet.ts" lineNumbers
export function greet(name: string) {
return `Hello, ${name}!`; // [!code highlight]
}
```lineNumbers=10 starts the numbers at 10, and noCopy hides the copy button. Code Blocks covers code themes and other highlighters.
Line Notations
A [!code …] comment applies to its own line. Add :3 to apply it to three lines, like [!code highlight:3]:
```ts
// [!code word:name]
const name = "Acme"; // [!code highlight]
console.log("hello"); // [!code --]
console.log(`Hello, ${name}!`); // [!code ++]
greet(name); // [!code focus]
```Inline Code
To highlight inline code, add {:lang} at its end: `console.log("hi"){:js}` renders as console.log("hi").
Code Tabs
Consecutive code blocks with a tab attribute become tabs. Tabs with the same tab-group stay in sync, even across pages:
```ts tab="TypeScript" tab-group="language"
const count: number = 1;
```
```js tab="JavaScript"
const count = 1;
```const count: number = 1;An npm code block becomes one tab per package manager:
```npm
npm i acme
```npm i acmeComponents
The built-in components, and those in src/components/content/, work in every page without an import. As in a Vue template, an attribute is a string, and a : prefix makes it an expression. Markdown works inside a component:
<Callout type="warn" title="Careful">
This can't be **undone**.
</Callout>
<Tabs :items="['npm', 'pnpm']">
<Tab value="npm">Run `npm i acme`.</Tab>
<Tab value="pnpm">Run `pnpm add acme`.</Tab>
</Tabs>Careful
This can't be undone.
npm i acme.Vue in Markdown
A page is a Vue component, so it can use expressions, directives, <script setup> and <style>:
<button class="counter" @click="count++">Clicked {{ count }} times</button>
<script setup>
import { ref } from "vue";
const count = ref(0);
</script>
<style scoped>
.counter {
padding: 4px 12px;
border: 1px solid var(--color-fd-border);
border-radius: 8px;
}
</style>Server Rendering
A page renders on the server first. Use browser APIs like window only in onMounted() or in event handlers, as in Vue's SSR guide.
Escaping
Vue only parses tags and {{ }}, so other braces render as text. To show a tag or {{ as text, escape it with a backslash:
Braces like {a, b} are text, and so is a < b.
\{{ name }} and Array\<string> are text too.Vapor Mode
On Vue 3.6, opt a page into Vapor mode with <script setup vapor>.
Includes
<include> inserts a .md file into the page, so its headings appear in the table of contents and in search. Start the name of an included file with _, so it isn't a page of its own:
<!-- A whole file -->
<include>./_install.md</include>
<!-- A heading with its content, or a <section id="options"> -->
<include>./api.md#options</include>
<!-- The lines between `#region options` and `#endregion options` -->
<include>../src/config.ts#options</include>
<!-- Lines 3 to 10, or from line 3 with {3,} -->
<include>../src/config.ts{3,10}</include>
<!-- A file from the project root, with a title -->
<include cwd meta='title="vite.config.ts"'>vite.config.ts</include>Any other file, .mdx included, renders as a code block, highlighted by its file extension unless lang sets another language. After a section or a region, a range counts from the first line of that section or region, like <include>../src/config.ts#options{2,4}</include>.
Props
An included file declares props with defineProps(), and an include passes them as attributes, with : for an expression:
<script setup lang="ts">
defineProps<{ framework: string }>();
</script>
## Deploy on {{ framework }}
Hello from **{{ framework }}**.- The included file reads only its props, so a page with path params passes them on, like
:framework="framework". - With type checking, a missing prop or a value of the wrong type is a type error.
Scripts and Styles
Each include renders the file as a component, so its <script setup>, <script> and <style scoped> work as in a .vue file. Each include has its own state, and imports resolve from the included file:
<script setup>
import { ref } from "vue";
const count = ref(0);
</script>
<button class="counter" @click="count++">Clicked {{ count }} times</button>
<style scoped>
.counter {
padding: 4px 12px;
}
</style>markdown-it Plugins
Vuesho parses Markdown with markdown-it. Add its plugins to markdown.markdownItPlugins, like @mdit/plugin-emoji for emoji shortcodes:
npm i @mdit/plugin-emojiimport { fullEmoji } from "@mdit/plugin-emoji";
createSite(docs.toSource()).config({
markdown: { markdownItPlugins: [fullEmoji] },
});For math, see Math. To add syntax from a Vuesho plugin, see Markdown Extensions.