+}
+```
+
+The theme entry file should export the theme as its default export:
+
+```js
+// .vitepress/theme/index.js
+import Layout from './Layout.vue'
+
+export default {
+ Layout,
+
+ // this is a Vue 3 functional component
+ NotFound: () => 'custom 404',
+
+ enhanceApp({ app, router, siteData }) {
+ // app is the Vue 3 app instance from `createApp()`.
+ // router is VitePress' custom router. `siteData` is
+ // a `ref` of current site-level metadata.
+ }
+}
+```
+
+...where the `Layout` component could look like this:
+
+```vue
+
+
+ Custom Layout!
+
+
+
+
+```
+
+The default export is the only contract for a custom theme. Inside your custom theme, it works just like a normal Vite + Vue 3 application. Do note the theme also needs to be [SSR-compatible](./using-vue#browser-api-access-restrictions).
+
+To distribute a theme, simply export the object in your package entry. To consume an external theme, import and re-export it from the custom theme entry:
+
+```js
+// .vitepress/theme/index.js
+import Theme from 'awesome-vitepress-theme'
+
+export default Theme
+```
+
+## Extending the Default Theme
+
+If you want to extend and customize the default theme, you can import it from `vitepress/theme` and augment it in a custom theme entry. Here are some examples of common customizations:
+
+### Registering Global Components
+
+```js
+// .vitepress/theme/index.js
+import DefaultTheme from 'vitepress/theme'
+
+export default {
+ ...DefaultTheme,
+ enhanceApp({ app }) {
+ // register global components
+ app.component('MyGlobalComponent', /* ... */)
+ }
+}
+```
+
+Since we are using Vite, you can also leverage Vite's [glob import feature](https://vitejs.dev/guide/features.html#glob-import) to auto register a directory of components.
+
+### Customizing CSS
+
+The default theme CSS is customizable by overriding root level CSS variables:
+
+```js
+// .vitepress/theme/index.js
+import DefaultTheme from 'vitepress/theme'
+import './custom.css'
+
+export default DefaultTheme
+```
+
+```css
+/* .vitepress/theme/custom.css */
+:root {
+ --vp-c-brand: #646cff;
+ --vp-c-brand-light: #747bff;
+}
+```
+
+See [default theme CSS variables](https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css) that can be overridden.
+
+### Layout Slots
+
+The default theme's `` component has a few slots that can be used to inject content at certain locations of the page. Here's an example of injecting a component into the top of the sidebar:
+
+```js
+// .vitepress/theme/index.js
+import DefaultTheme from 'vitepress/theme'
+import MyLayout from './MyLayout.vue'
+
+export default {
+ ...DefaultTheme,
+ // override the Layout with a wrapper component that
+ // injects the slots
+ Layout: MyLayout
+}
+```
+
+```vue
+
+
+
+
+
+
+ My custom sidebar top content
+
+
+
+```
+
+Or you could use render function as well.
+
+```js
+// .vitepress/theme/index.js
+import DefaultTheme from 'vitepress/theme'
+import MyComponent from './MyComponent.vue'
+
+export default {
+ ...DefaultTheme,
+ Layout() {
+ return h(DefaultTheme.Layout, null, {
+ 'sidebar-top': () => h(MyComponent)
+ })
+ }
+}
+```
+
+Full list of slots available in the default theme layout:
+
+- Only when `layout: 'home'` is enabled via frontmatter:
+ - `home-hero-before`
+ - `home-hero-after`
+ - `home-features-before`
+ - `home-features-after`
diff --git a/docs/guide/using-vue.md b/docs/guide/using-vue.md
new file mode 100644
index 00000000..8ed6b0aa
--- /dev/null
+++ b/docs/guide/using-vue.md
@@ -0,0 +1,261 @@
+# Using Vue in Markdown
+
+In VitePress, each markdown file is compiled into HTML and then processed as a Vue Single-File Component. This means you can use any Vue features inside the markdown, including dynamic templating, using Vue components, or arbitrary in-page Vue component logic by adding a `
+
+{{ page }}
+```
+
+**Output**
+
+```json
+{
+ "path": "/using-vue.html",
+ "title": "Using Vue in Markdown",
+ "frontmatter": {}
+}
+```
+
+## Escaping
+
+By default, fenced code blocks are automatically wrapped with `v-pre`. To display raw mustaches or Vue-specific syntax inside inline code snippets or plain text, you need to wrap a paragraph with the `v-pre` custom container:
+
+**Input**
+
+```md
+::: v-pre
+`{{ This will be displayed as-is }}`
+:::
+```
+
+**Output**
+
+::: v-pre
+`{{ This will be displayed as-is }}`
+:::
+
+## Using Components
+
+When you need to have more flexibility, VitePress allows you to extend your authoring toolbox with your own Vue Components.
+
+### Importing components in markdown
+
+If your components are going to be used in only a few places, the recommended way to use them is to importing the components in the file where it is used.
+
+```md
+
+
+# Docs
+
+This is a .md using a custom component
+
+
+
+## More docs
+
+...
+```
+
+### Registering global components in the theme
+
+If the components are going to be used across several pages in the docs, they can be registered globally in the theme (or as part of extending the default VitePress theme). Check out the [Theming Guide](./theme-introduction) for more information.
+
+In `.vitepress/theme/index.js`, the `enhanceApp` function receives the Vue `app` instance so you can [register components](https://vuejs.org/guide/components/registration.html) as you would do in a regular Vue application.
+
+```js
+import DefaultTheme from 'vitepress/theme'
+
+export default {
+ ...DefaultTheme,
+ enhanceApp({ app }) {
+ app.component('VueClickAwayExample', VueClickAwayExample)
+ }
+}
+```
+
+Later in your markdown files, the component can be interleaved between the content
+
+```md
+# Vue Click Away
+
+
+```
+
+::: warning IMPORTANT
+Make sure a custom component’s name either contains a hyphen or is in PascalCase. Otherwise, it will be treated as an inline element and wrapped inside a `` tag, which will lead to hydration mismatch because `
` does not allow block elements to be placed inside it.
+:::
+
+### Using Components In Headers
+
+You can use Vue components in the headers, but note the difference between the following syntaxes:
+
+| Markdown | Output HTML | Parsed Header |
+| ------------------------------------------------------- | ----------------------------------------- | ------------- |
+|
# text <Tag/>
| `text
` | `text` |
+| # text \`<Tag/>\`
| `text <Tag/>
` | `text ` |
+
+The HTML wrapped by `` will be displayed as-is; only the HTML that is **not** wrapped will be parsed by Vue.
+
+::: tip
+The output HTML is accomplished by [markdown-it](https://github.com/markdown-it/markdown-it), while the parsed headers are handled by VitePress (and used for both the sidebar and document title).
+:::
+
+## Using CSS Pre-processors
+
+VitePress has [built-in support](https://vitejs.dev/guide/features.html#css-pre-processors) for CSS pre-processors: `.scss`, `.sass`, `.less`, `.styl` and `.stylus` files. There is no need to install Vite-specific plugins for them, but the corresponding pre-processor itself must be installed:
+
+```
+# .scss and .sass
+npm install -D sass
+
+# .less
+npm install -D less
+
+# .styl and .stylus
+npm install -D stylus
+```
+
+Then you can use the following in Markdown and theme components:
+
+```vue
+
+```
+
+## Script & Style Hoisting
+
+Sometimes you may need to apply some JavaScript or CSS only to the current page. In those cases, you can directly write root-level `
+
+## Built-In Components
+
+VitePress provides Built-In Vue Components like `ClientOnly` and `OutboundLink`, check out the [Global Component Guide](./api) for more information.
+
+**Also see:**
+
+- [Using Components In Headers](#using-components-in-headers)
+
+## Browser API Access Restrictions
+
+Because VitePress applications are server-rendered in Node.js when generating static builds, any Vue usage must conform to the [universal code requirements](https://vuejs.org/guide/scaling-up/ssr.html). In short, make sure to only access Browser / DOM APIs in `beforeMount` or `mounted` hooks.
+
+If you are using or demoing components that are not SSR-friendly (for example, contain custom directives), you can wrap them inside the built-in `` component:
+
+```md
+
+
+
+```
+
+Note this does not fix components or libraries that access Browser APIs **on import**. To use code that assumes a browser environment on import, you need to dynamically import them in proper lifecycle hooks:
+
+```vue
+
+```
+
+If your module `export default` a Vue component, you can register it dynamically:
+
+```vue
+
+
+
+
+
+
+```
+
+**Also see:**
+
+- [Vue.js > Dynamic Components](https://vuejs.org/guide/essentials/component-basics.html#dynamic-components)
diff --git a/docs/images/line-numbers-desktop.png b/docs/images/line-numbers-desktop.png
new file mode 100644
index 00000000..e16e6707
Binary files /dev/null and b/docs/images/line-numbers-desktop.png differ
diff --git a/docs/images/line-numbers-mobile.gif b/docs/images/line-numbers-mobile.gif
new file mode 100644
index 00000000..87af6cf0
Binary files /dev/null and b/docs/images/line-numbers-mobile.gif differ
diff --git a/docs/images/vercel-configuration.png b/docs/images/vercel-configuration.png
new file mode 100644
index 00000000..51874e15
Binary files /dev/null and b/docs/images/vercel-configuration.png differ
diff --git a/docs/index.md b/docs/index.md
index ac33ff2b..dfbec2ea 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -11,7 +11,7 @@ hero:
actions:
- theme: brand
text: Get Started
- link: /guide/what-is-vitepress
+ link: /guide/getting-started
- theme: alt
text: View on GitHub
link: https://github.com/vuejs/vitepress
diff --git a/src/client/theme-default/components/VPDocFooter.vue b/src/client/theme-default/components/VPDocFooter.vue
index e8db091f..b5d724cf 100644
--- a/src/client/theme-default/components/VPDocFooter.vue
+++ b/src/client/theme-default/components/VPDocFooter.vue
@@ -44,7 +44,7 @@ const control = usePrevNext()
}
.edit-link {
- padding-bottom: 8px;
+ padding-bottom: 14px;
}
.edit-link-button {