-
Type:
string
-
Default:
/
-
Details:
The base URL the site will be deployed at.
You will need to set this if you plan to deploy your site under a sub path. It should always start and end with a slash. For example, if you plan to deploy your site to GitHub pages at
https://foo.github.io/bar/
, then you should setbase
to"/bar/"
.The
base
is automatically prepended to the URLs that start with/
in other options, so you only need to specify it once. (Except for attrs of head)Notice that
base
should be an absolute URL pathname starting and ending with/
. -
Also see:
-
Type:
string
-
Default:
en-US
-
Details:
Language for the site.
This will be the
lang
attribute of the<html>
tag in the rendered HTML.This can be specified in different locales.
-
Also see:
-
Type:
string
-
Default:
''
-
Details:
Title for the site.
This will be the suffix for all page titles, and displayed in the navbar in the default theme.
This can be specified in different locales.
-
Also see:
-
Type:
string
-
Default:
''
-
Details:
Description for the site.
This will be the
content
attribute of<meta name="description" />
tag in the rendered HTML, which will be overrode by thedescription
field of page frontmatter.This can be specified in different locales.
-
Also see:
-
Type:
HeadConfig[]
-
Default:
[]
-
Details:
Extra tags to inject into the
<head>
tag in the rendered HTML.You can specify each tag in the form of
[tagName, { attrName: attrValue }, innerHTML?]
.This can be specified in different locales.
Notice that if the
attrValue
is a pathname, it will be kept as-is without prepending base automatically, so remember to prepend it manually if needed. -
Example:
To add a custom favicon:
export default {
head: [['link', { rel: 'icon', href: '/images/logo.png' }]],
}
Rendered as:
<head>
<link rel="icon" href="/images/logo.png" />
</head>
- Also see:
-
Type:
{ [path: string]: Partial<SiteLocaleData> }
-
Default:
{}
-
Details:
Specify locales for i18n support.
Acceptable fields:
-
Also see:
-
Type:
Theme
-
Details:
Set the theme of your site.
If this option is not set, the default theme will be used.
-
Also see:
-
Type:
Bundler
-
Details:
Set the bundler of your site.
If this option is not set, the default bundler will be used:
- With
vuepress
orvuepress-vite
, the default bundler is vite. - With
vuepress-webpack
, the default bundler is webpack.
- With
-
Also see:
-
Type:
string
-
Default:
`${sourceDir}/.vuepress/dist`
-
Details:
Specify the output directory for
vuepress build
command.
-
Type:
string
-
Default:
`${sourceDir}/.vuepress/.temp`
-
Details:
Specify the directory for temporary files.
::: warning Since VuePress will load temp files during dev and build, the temp directory should be inside project root to resolve dependencies correctly. :::
-
Type:
string
-
Default:
`${sourceDir}/.vuepress/.cache`
-
Details:
Specify the directory for cache files.
-
Type:
string
-
Default:
`${sourceDir}/.vuepress/public`
-
Details:
Specify the directory for public files.
-
Also see:
-
Type:
boolean
-
Default:
false
-
Details:
Enable debug mode or not.
This would be helpful for developers. Also, we are using debug package for debug logging, which can be enabled via
DEBUG=vuepress*
environment variable.
-
Type:
string[]
-
Default:
['**/*.md', '!.vuepress', '!node_modules']
-
Details:
Specify the patterns of files you want to be resolved as pages. The patterns are relative to the source directory.
-
Type:
string | null
-
Default:
null
-
Details:
Specify the pattern to generate permalink.
This will be overrode by the
permalinkPattern
field of page frontmatter. -
Also see:
-
Type:
string
-
Default:
'0.0.0.0'
-
Details:
Specify the host to use for the dev server.
-
Type:
number
-
Default:
8080
-
Details:
Specify the port to use for the dev server.
-
Type:
boolean
-
Default:
false
-
Details:
Whether to open the browser after dev-server had been started.
-
Type:
string
-
Default:
'@vuepress/client/templates/dev.html'
-
Details:
Specify the path of the HTML template to be used for dev.
-
Type:
((file: string, type: string) => boolean)) | boolean
-
Default:
true
-
Details:
A function to control what files should have
<link rel="preload">
resource hints generated. Set totrue
orfalse
to enable or disable totally.By default, only those files that are required by current page will be preloaded. So you can keep it
true
in most cases.
-
Type:
((file: string, type: string) => boolean)) | boolean
-
Default:
true
-
Details:
A function to control what files should have
<link rel="prefetch">
resource hints generated. Set totrue
orfalse
to enable or disable for all files.If you set it to
true
, all files that required by other pages will be prefetched. This is good for small sites, which will speed up the navigation, but it might not be a good idea if you have lots of pages in your site.
-
Type:
string
-
Default:
'@vuepress/client/templates/build.html'
-
Details:
Specify the path of the HTML template to be used for build.
-
Type:
TemplateRenderer
-
Default:
templateRenderer
-
Details:
Specify the HTML template renderer to be used for build.
-
Type:
MarkdownOptions
-
Default:
{}
-
Details:
Configure VuePress built-in Markdown syntax extensions.
It accepts all options of markdown-it, and the following additional options.
-
Also see:
-
Type:
AnchorPluginOptions | false
-
Default:
const defaultOptions = {
level: [1, 2, 3, 4, 5, 6],
permalink: anchorPlugin.permalink.ariaHidden({
class: 'header-anchor',
symbol: '#',
space: true,
placement: 'before',
}),
}
-
Details:
Options for markdown-it-anchor.
Set to
false
to disable this plugin. -
Also see:
-
Type:
AssetsPluginOptions | false
-
Details:
Options for VuePress built-in markdown-it assets plugin.
Set to
false
to disable this plugin.
::: danger You should not configure it unless you understand what it is for. :::
-
Type:
CodePluginOptions | false
-
Details:
Options for VuePress built-in markdown-it code plugin.
Set to
false
to disable this plugin. -
Also see:
-
Type:
boolean
-
Default:
true
-
Details:
Enable code line highlighting or not.
-
Also see:
-
Type:
boolean | number
-
Default:
true
-
Details:
Configure code line numbers.
- A
boolean
value is to enable line numbers or not. - A
number
value is the minimum number of lines to enable line numbers. For example, if you set it to4
, line numbers will only be enabled when your code block has at least 4 lines of code.
- A
-
Also see:
-
Type:
boolean
-
Default:
true
-
Details:
Enable the extra wrapper of the
<pre>
tag or not.The wrapper is required by the
highlightLines
andlineNumbers
. That means, if you disablepreWrapper
, the line highlighting and line numbers will also be disabled.
::: tip You can disable it if you want to implement them in client side. For example, Prismjs Line Highlight or Prismjs Line Numbers. :::
-
Type:
boolean
-
Default:
true
-
Details:
Add
v-pre
directive to<pre>
tag of code block or not. -
Also see:
-
Type:
boolean
-
Default:
true
-
Details:
Add
v-pre
directive to<code>
tag of inline code or not. -
Also see:
-
Type:
undefined | false
-
Details:
Options for @mdit-vue/plugin-component.
Set to
false
to disable this plugin.
::: danger You should not configure it unless you understand what it is for. :::
-
Type:
EmojiPluginOptions | false
-
Details:
Options for markdown-it-emoji.
Set to
false
to disable this plugin. -
Also see:
-
Type:
FrontmatterPluginOptions | false
-
Details:
Options for @mdit-vue/plugin-frontmatter.
Set to
false
to disable this plugin. -
Also see:
::: danger You should not configure it unless you understand what it is for. :::
-
Type:
HeadersPluginOptions | false
-
Default:
const defaultOptions = {
level: [2, 3],
}
-
Details:
Options for @mdit-vue/plugin-headers.
Set to
false
to disable this plugin. -
Also see:
-
Type:
ImportCodePluginOptions | false
-
Details:
Options for VuePress built-in markdown-it import-code plugin.
Set to
false
to disable this plugin. -
Also see:
-
Type:
(str: string) => string
-
Default:
(str) => str
-
Details:
A function to handle the import path of the import code syntax.
-
Type:
LinksPluginOptions | false
-
Details:
Options for VuePress built-in markdown-it links plugin.
It will convert internal links to
<RouterLink>
, and add extra attributes and icon to external links.Set to
false
to disable this plugin. -
Also see:
-
Type:
'a' | 'RouterLink'
-
Default:
'RouterLink'
-
Details:
Tag for internal links.
By default, this plugin will transform internal links to
<RouterLink>
. You can set this option to'a'
to disable this feature.
-
Type:
Record<string, string>
-
Default:
{ target: '_blank', rel: 'noopener noreferrer' }
-
Details:
Additional attributes for external links.
-
Type:
SfcPluginOptions | false
-
Details:
Options for @mdit-vue/plugin-sfc.
Set to
false
to disable this plugin. -
Also see:
-
Type:
(str: string) => string
-
Details:
The default slugify function.
-
Type:
undefined | false
-
Details:
Options for @mdit-vue/plugin-title.
Set to
false
to disable this plugin.
::: danger You should not configure it unless you understand what it is for. :::
-
Type:
TocPluginOptions | false
-
Default:
const defaultOptions = {
level: [2, 3],
}
-
Details:
Options for @mdit-vue/plugin-toc.
Set to
false
to disable this plugin. -
Also see:
-
Type:
(Plugin | Plugin[])[]
-
Details:
Plugins to use.
This option accepts an array, each item of which could be a plugin or an array of plugins.
-
Also see:
User config file also works as a VuePress plugin, so all of the Plugin APIs are available except the name
and multiple
options.
Please check out Plugin API Reference for a full list of Plugin APIs.