This approach requires you to determine which parts of your theme could be extended. It is more suitable for those common customizations like page footer or header.
You just need to provide slots in your layouts, and tell users how to make use of them:
This approach requires you to consider which components of your theme should be replaceable, and you also need to split components into a suitable granularity.
First, set alias for replaceable components of you theme:
import type { Theme } from 'vuepress/core'
+import { getDirname } from 'vuepress/utils'
+
+const __dirname = getDirname(import.meta.url)
+
+export const fooTheme = (options): Theme => ({
+ name: 'vuepress-theme-foo',
+ alias: {
+ // set alias for replaceable components
+ '@theme/Navbar.vue': path.resolve(__dirname, 'components/Navbar.vue'),
+ '@theme/Sidebar.vue': path.resolve(__dirname, 'components/Sidebar.vue'),
+ },
+})
Next, use those components via aliases in your theme:
Each Markdown file is first compiled into HTML, and then converted to a Vue SFC. In other words, you can write a Markdown file like a Vue SFC:
Blocks <script> and <style> are treated as Vue SFC blocks as they are. In other words, they are hoisted from the <template> block to the top-level of SFC.
Everything outside <script> and <style> will be compiled into HTML, and be treated as Vue SFC <template> block.
Warning
As Vue SFC can contain only one <script> element, you should avoid using more than one <script> in VuePress markdown.
As we know, VuePress plugin entries and theme entries are processed in Node side, but sometimes you might need to pass data to client side. For example, you want to generate different data when users use different options.
You can make use of useRoutes to get all routes information.
The return value of useRoutes is a Ref object containing all routes. The keys are route paths of each route, and the values are the corresponding route information.
There is a notFound field in the returned information, which is used to indicate whether a corresponding route exists for a given path. When the route does not exist, the notFound field would be true, the path field would be the normalized path, and the meta and loader fields would point to the default 404 page.
VuePress will generate a SSR application to pre-render pages during build. Generally speaking, if a code snippet is using Browser / DOM APIs before client app is mounted, we call it non-SSR-friendly.
We already provides a ClientOnly component to wrap non-SSR-friendly content.
In the enhance function, you can make use of the __VUEPRESS_SSR__ flag for that purpose.
You can take the setup function as part of the setup hook of the root component. Thus, all composition APIs are available here.
import { provide, ref } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
+import { defineClientConfig } from 'vuepress/client'
+
+export default defineClientConfig({
+ setup() {
+ // get the current route location
+ const route = useRoute()
+ // get the vue-router instance
+ const router = useRouter()
+ // provide a value that can be injected by layouts, pages and other components
+ const count = ref(0)
+ provide('count', count)
+ },
+})
A plugin usually needs to allow user options, so we typically provide users with a function to receive options, and returns a Plugin Object or a Plugin Function. Then your plugin should be converted like this:
Set name to follow the naming convention, i.e. vuepress-plugin-xxx or @org/vuepress-plugin-xxx, which should be consistent with the name field of the Plugin Object.
Set keywords to include vuepress-plugin, so that users can search your plugin on NPM.
A VuePress theme is a special plugin, which should satisfy the Theme API. Like plugins, a theme should also be a Theme Object or a Theme Function, and could be wrapped with a function to receive options:
import { getDirname, path } from 'vuepress/utils'
+
+const __dirname = getDirname(import.meta.url)
+
+const fooTheme = (options) =>
+ // returns a theme object
+ ({
+ name: 'vuepress-theme-foo',
+
+ // path to the client config of your theme
+ clientConfigFile: path.resolve(__dirname, 'client.js'),
+
+ // set custom dev / build template
+ // if the template is not specified, the default template
+ templateBuild: path.resolve(__dirname, 'templates/build.html'),
+ templateDev: path.resolve(__dirname, 'templates/dev.html'),
+
+ // use plugins
+ plugins: [
+ // ...
+ ],
+
+ // other plugin APIs are also available
+ })
+
+const barTheme =
+ (options) =>
+ // returns a theme function
+ (app) => ({
+ name: 'vuepress-theme-bar',
+ // ...
+ })
import { defineClientConfig } from 'vuepress/client'
+import Layout from './layouts/Layout.vue'
+import NotFound from './layouts/NotFound.vue'
+
+export default defineClientConfig({
+ layouts: {
+ Layout,
+ NotFound,
+ },
+})
The layouts field declares the layouts provided by your theme. A theme must provide at least two layouts: Layout and NotFound. The former is to provide default layout for common pages, while the latter is to provide layout for 404-not-found page.
The Layout layout should contain the Content component to display the markdown content:
Set name to follow the naming convention: vuepress-theme-xxx or @org/vuepress-theme-xxx, which should be consistent with the name field of the Theme Object.
Set keywords to include vuepress-theme, so that users can search your theme on NPM.
+
+
+
diff --git a/assets/404.html-Y5XR-oHF.js b/assets/404.html-Y5XR-oHF.js
new file mode 100644
index 000000000..0e35f3ff9
--- /dev/null
+++ b/assets/404.html-Y5XR-oHF.js
@@ -0,0 +1 @@
+import{_ as e,c as o,b as n,o as r}from"./app-9HBJsLu_.js";const a={};function p(s,t){return r(),o("div",null,t[0]||(t[0]=[n("p",null,"404 Not Found",-1)]))}const l=e(a,[["render",p],["__file","404.html.vue"]]),i=JSON.parse('{"path":"/404.html","title":"","lang":"en-US","frontmatter":{"layout":"NotFound","description":"404 Not Found","head":[["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/404.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:description","content":"404 Not Found"}],["meta",{"property":"og:type","content":"website"}],["meta",{"property":"og:locale","content":"en-US"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"WebPage\\",\\"name\\":\\"\\",\\"description\\":\\"404 Not Found\\"}"]]},"headers":[],"git":{},"autoDesc":true,"filePathRelative":null}');export{l as comp,i as data};
diff --git a/assets/NpmBadge-KVBLyX2u.js b/assets/NpmBadge-KVBLyX2u.js
new file mode 100644
index 000000000..d1180fb32
--- /dev/null
+++ b/assets/NpmBadge-KVBLyX2u.js
@@ -0,0 +1 @@
+import{j as p,k as n,_ as d,o as g,c as _,b as l}from"./app-9HBJsLu_.js";const i=p({__name:"NpmBadge",props:{package:{},distTag:{default:"next"}},setup(c,{expose:s}){s();const e=c,a=n(()=>`https://www.npmjs.com/package/${e.package}`),t=n(()=>e.distTag?`${e.package}@${e.distTag}`:e.package),o=n(()=>`https://badgen.net/npm/v/${e.package}/${e.distTag}?label=${encodeURIComponent(t.value)}`),r={props:e,badgeLink:a,badgeLabel:t,badgeImg:o};return Object.defineProperty(r,"__isScriptSetup",{enumerable:!1,value:!0}),r}}),m=["href","title"],u=["src","alt"];function f(c,s,e,a,t,o){return g(),_("a",{class:"npm-badge",href:a.badgeLink,title:e.package,target:"_blank",rel:"noopener noreferrer"},[l("img",{src:a.badgeImg,alt:e.package},null,8,u)],8,m)}const b=d(i,[["render",f],["__scopeId","data-v-95cd33a3"],["__file","NpmBadge.vue"]]);export{b as default};
diff --git a/assets/adding-extra-pages.html-8wOaBP_-.js b/assets/adding-extra-pages.html-8wOaBP_-.js
new file mode 100644
index 000000000..58c7cb216
--- /dev/null
+++ b/assets/adding-extra-pages.html-8wOaBP_-.js
@@ -0,0 +1,26 @@
+import{_ as o,c as t,b as n,d as a,e as l,f as p,a as r,r as i,o as c}from"./app-9HBJsLu_.js";const d={};function D(y,s){const e=i("RouteLink");return c(),t("div",null,[s[5]||(s[5]=n("h1",{id:"添加额外页面",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#添加额外页面"},[n("span",null,"添加额外页面")])],-1)),s[6]||(s[6]=n("p",null,"有时你可能希望在不创建 Markdown 文件的情况下添加一些额外的页面。",-1)),n("p",null,[s[2]||(s[2]=a("我们可以借助于 ")),l(e,{to:"/zh/reference/plugin-api.html"},{default:p(()=>s[0]||(s[0]=[a("插件 API")])),_:1}),s[3]||(s[3]=a(" 和 ")),l(e,{to:"/zh/reference/node-api.html"},{default:p(()=>s[1]||(s[1]=[a("Node API")])),_:1}),s[4]||(s[4]=a(" 来轻松实现。"))]),s[7]||(s[7]=r(`
`,3))])}const C=o(d,[["render",D],["__file","adding-extra-pages.html.vue"]]),v=JSON.parse('{"path":"/zh/advanced/cookbook/adding-extra-pages.html","title":"添加额外页面","lang":"zh-CN","frontmatter":{"description":"添加额外页面 有时你可能希望在不创建 Markdown 文件的情况下添加一些额外的页面。 我们可以借助于 和 来轻松实现。 添加默认的主页 作为一个主题作者,你可能不想要求用户必须创建一个 /README.md 文件来作为主页,但是你希望提供一个默认的主页:","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuepress.vuejs.org/advanced/cookbook/adding-extra-pages.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/zh/advanced/cookbook/adding-extra-pages.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"添加额外页面"}],["meta",{"property":"og:description","content":"添加额外页面 有时你可能希望在不创建 Markdown 文件的情况下添加一些额外的页面。 我们可以借助于 和 来轻松实现。 添加默认的主页 作为一个主题作者,你可能不想要求用户必须创建一个 /README.md 文件来作为主页,但是你希望提供一个默认的主页:"}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2023-12-28T05:20:14.000Z"}],["meta",{"property":"article:modified_time","content":"2023-12-28T05:20:14.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"添加额外页面\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-12-28T05:20:14.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"添加默认的主页","slug":"添加默认的主页","link":"#添加默认的主页","children":[]}],"git":{"updatedTime":1703740814000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":2}]},"autoDesc":true,"filePathRelative":"zh/advanced/cookbook/adding-extra-pages.md"}');export{C as comp,v as data};
diff --git a/assets/adding-extra-pages.html-NhbwxT0R.js b/assets/adding-extra-pages.html-NhbwxT0R.js
new file mode 100644
index 000000000..dcaf0f504
--- /dev/null
+++ b/assets/adding-extra-pages.html-NhbwxT0R.js
@@ -0,0 +1,26 @@
+import{_ as t,c as p,b as a,d as e,e as l,f as o,a as r,r as i,o as c}from"./app-9HBJsLu_.js";const d={};function D(y,s){const n=i("RouteLink");return c(),p("div",null,[s[5]||(s[5]=a("h1",{id:"adding-extra-pages",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#adding-extra-pages"},[a("span",null,"Adding Extra Pages")])],-1)),s[6]||(s[6]=a("p",null,"Sometimes you might want to add some extra pages without creating a markdown file in the source directory.",-1)),a("p",null,[s[2]||(s[2]=e("With the help of ")),l(n,{to:"/reference/plugin-api.html"},{default:o(()=>s[0]||(s[0]=[e("Plugin API")])),_:1}),s[3]||(s[3]=e(" and ")),l(n,{to:"/reference/node-api.html"},{default:o(()=>s[1]||(s[1]=[e("Node API")])),_:1}),s[4]||(s[4]=e(", we can do that with ease."))]),s[7]||(s[7]=r(`
',9)),r("p",null,[e[1]||(e[1]=t("The above figure shows the core process of VuePress Node App and the hooks of ")),o(l,{to:"/reference/plugin-api.html"},{default:i(()=>e[0]||(e[0]=[t("Plugin API")])),_:1}),e[2]||(e[2]=t(":"))]),r("ul",null,[r("li",null,[e[14]||(e[14]=t("In the ")),e[15]||(e[15]=r("strong",null,"init",-1)),e[16]||(e[16]=t(" stage: ")),r("ul",null,[e[13]||(e[13]=r("li",null,"Theme and plugins will be loaded. That means all the plugins should be used before initialization.",-1)),r("li",null,[e[7]||(e[7]=t("As we are using markdown-it to parse the markdown file, so we need to create markdown-it instance before loading pages: ")),r("ul",null,[r("li",null,[o(l,{to:"/reference/plugin-api.html#extendsmarkdownoptions"},{default:i(()=>e[3]||(e[3]=[t("extendsMarkdownOptions")])),_:1}),e[4]||(e[4]=t(" hook will be processed to create markdown-it instance."))]),r("li",null,[o(l,{to:"/reference/plugin-api.html#extendsmarkdown"},{default:i(()=>e[5]||(e[5]=[t("extendsMarkdown")])),_:1}),e[6]||(e[6]=t(" hook will be processed extends markdown-it instance."))])])]),r("li",null,[e[12]||(e[12]=t("Page files will be loaded: ")),r("ul",null,[r("li",null,[o(l,{to:"/reference/plugin-api.html#extendspageoptions"},{default:i(()=>e[8]||(e[8]=[t("extendsPageOptions")])),_:1}),e[9]||(e[9]=t(" hook will be processed to create pages."))]),r("li",null,[o(l,{to:"/reference/plugin-api.html#extendspage"},{default:i(()=>e[10]||(e[10]=[t("extendsPage")])),_:1}),e[11]||(e[11]=t(" hook will be processed to extends page object."))])])])])]),e[27]||(e[27]=r("li",null,[t("In the "),r("strong",null,"prepare"),t(" stage: "),r("ul",null,[r("li",null,"Temp files will be generated, so all hooks related to client files will be processed here.")])],-1)),r("li",null,[e[24]||(e[24]=t("In the ")),e[25]||(e[25]=r("strong",null,"dev / build",-1)),e[26]||(e[26]=t(" stage: ")),r("ul",null,[r("li",null,[e[23]||(e[23]=t("Bundler will be resolved: ")),r("ul",null,[r("li",null,[o(l,{to:"/reference/plugin-api.html#extendsbundleroptions"},{default:i(()=>e[17]||(e[17]=[t("extendsBundlerOptions")])),_:1}),e[18]||(e[18]=t(" hook will be processed to create bundler configuration."))]),r("li",null,[o(l,{to:"/reference/plugin-api.html#alias"},{default:i(()=>e[19]||(e[19]=[t("alias")])),_:1}),e[21]||(e[21]=t(" hook and ")),o(l,{to:"/reference/plugin-api.html#define"},{default:i(()=>e[20]||(e[20]=[t("define")])),_:1}),e[22]||(e[22]=t(" hook would be used in bundler configuration, so they will be processed here."))])])])])])])])}const c=a(g,[["render",h],["__file","architecture.html.vue"]]),b=JSON.parse('{"path":"/advanced/architecture.html","title":"Architecture","lang":"en-US","frontmatter":{"description":"Architecture Overview vuepress-architecture-overview The above figure shows a brief overview of the VuePress architecture: Node App will generate temp files, including the pages...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/advanced/architecture.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/advanced/architecture.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Architecture"}],["meta",{"property":"og:description","content":"Architecture Overview vuepress-architecture-overview The above figure shows a brief overview of the VuePress architecture: Node App will generate temp files, including the pages..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:image","content":"https://vuepress.vuejs.org/images/guide/vuepress-architecture-overview.png"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-02-05T05:23:13.000Z"}],["meta",{"property":"article:modified_time","content":"2024-02-05T05:23:13.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Architecture\\",\\"image\\":[\\"https://vuepress.vuejs.org/images/guide/vuepress-architecture-overview.png\\",\\"https://vuepress.vuejs.org/images/guide/vuepress-core-process.png\\"],\\"dateModified\\":\\"2024-02-05T05:23:13.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Overview","slug":"overview","link":"#overview","children":[]},{"level":2,"title":"Core Process and Hooks","slug":"core-process-and-hooks","link":"#core-process-and-hooks","children":[]}],"git":{"updatedTime":1707110593000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":2},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"advanced/architecture.md"}');export{c as comp,b as data};
diff --git a/assets/architecture.html-alS37AmL.js b/assets/architecture.html-alS37AmL.js
new file mode 100644
index 000000000..a59c7594c
--- /dev/null
+++ b/assets/architecture.html-alS37AmL.js
@@ -0,0 +1 @@
+import{_ as s,a as i}from"./vuepress-core-process-C4qfrYlz.js";import{_ as p,c as u,a as d,b as l,d as t,e as n,f as o,r as a,o as m}from"./app-9HBJsLu_.js";const g={};function v(f,e){const r=a("RouteLink");return m(),u("div",null,[e[28]||(e[28]=d('
You can put some static assets inside public directory, and they will be copied to the root of the generated directory.
',9)),a("p",null,[s[1]||(s[1]=e("The default public directory is ")),s[2]||(s[2]=a("code",null,".vuepress/public",-1)),s[3]||(s[3]=e(", which can be changed by ")),l(n,{to:"/reference/config.html#public"},{default:o(()=>s[0]||(s[0]=[e("public")])),_:1}),s[4]||(s[4]=e(" option."))]),s[33]||(s[33]=t(`
It would be useful in some cases:
You may need to provide static assets that are not directly referenced in any of your Markdown files, for example, favicon and PWA icons.
You may need to serve some shared static assets, which may even be referenced outside your site, for example, logo images.
You may want to reference images using absolute URLs in your Markdown content.
Take our documentation source files as an example, we are putting the logo of VuePress inside the public directory:
└─ docs
+ ├─ .vuepress
+ | └─ public
+ | └─ images
+ | └─ hero.png # <- Logo file
+ └─ guide
+ └─ assets.md # <- Here we are
We can reference our logo in current page like this:
',10)),a("p",null,[s[6]||(s[6]=e("If your site is deployed to a non-root URL, for example, ")),s[7]||(s[7]=a("code",null,"https://foo.github.io/bar/",-1)),s[8]||(s[8]=e(", then the ")),l(n,{to:"/reference/config.html#base"},{default:o(()=>s[5]||(s[5]=[e("base")])),_:1}),s[9]||(s[9]=e(" should be set to ")),s[10]||(s[10]=a("code",null,"'/bar/'",-1)),s[11]||(s[11]=e(". Obviously, your public files would be served like ")),s[12]||(s[12]=a("code",null,"https://foo.github.io/bar/images/hero.png",-1)),s[13]||(s[13]=e(" after deployment."))]),s[34]||(s[34]=t('
In most cases, you don't need to worry about the reference path of those public files, as VuePress will automatically handle base for you:
<!-- you don't need to prepend `/bar/` to `/images/hero.png` manually -->\n\n![VuePress Logo](/images/hero.png)
',2)),a("div",m,[s[21]||(s[21]=a("p",{class:"hint-container-title"},"Tips",-1)),a("p",null,[s[16]||(s[16]=e("When using ")),l(n,{to:"/reference/bundler/webpack.html"},{default:o(()=>s[14]||(s[14]=[e("webpack bundler")])),_:1}),s[17]||(s[17]=e(", you need to set ")),l(n,{to:"/reference/config.html#markdown-assets"},{default:o(()=>s[15]||(s[15]=[e("markdown.assets.absolutePathPrependBase")])),_:1}),s[18]||(s[18]=e(" to ")),s[19]||(s[19]=a("code",null,"true",-1)),s[20]||(s[20]=e(" to automatically prepend base to markdown images."))])]),a("p",null,[s[23]||(s[23]=e("However, sometimes you may have some dynamical links referencing public files, especially when you are authoring a custom theme. In such case, the ")),s[24]||(s[24]=a("code",null,"base",-1)),s[25]||(s[25]=e(" could not be handled automatically. To help with that, VuePress provides a ")),l(n,{to:"/reference/client-api.html#withbase"},{default:o(()=>s[22]||(s[22]=[e("withBase")])),_:1}),s[26]||(s[26]=e(" helper to prepend ")),s[27]||(s[27]=a("code",null,"base",-1)),s[28]||(s[28]=e(" for you:"))]),s[35]||(s[35]=t(`
<img src="@alias/image.png" alt="Image from path alias">
`,11)),a("div",y,[s[31]||(s[31]=a("p",{class:"hint-container-title"},"Tips",-1)),a("p",null,[s[30]||(s[30]=e("Config reference: ")),l(n,{to:"/reference/plugin-api.html#alias"},{default:o(()=>s[29]||(s[29]=[e("alias")])),_:1})])])])}const b=p(u,[["render",D],["__file","assets.html.vue"]]),C=JSON.parse('{"path":"/guide/assets.html","title":"Assets","lang":"en-US","frontmatter":{"description":"Assets Relative URLs You can reference any assets using relative URLs in your Markdown content: or This is generally the suggested way to import images, as users usually place i...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/guide/assets.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/guide/assets.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Assets"}],["meta",{"property":"og:description","content":"Assets Relative URLs You can reference any assets using relative URLs in your Markdown content: or This is generally the suggested way to import images, as users usually place i..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:image","content":"https://vuepress.vuejs.org/images/hero.png"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-08-31T07:59:53.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-31T07:59:53.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Assets\\",\\"image\\":[\\"https://vuepress.vuejs.org/images/hero.png\\",\\"https://vuepress.vuejs.org/images/hero.png\\",\\"https://vuepress.vuejs.org/images/hero.png\\"],\\"dateModified\\":\\"2024-08-31T07:59:53.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Relative URLs","slug":"relative-urls","link":"#relative-urls","children":[]},{"level":2,"title":"Public Files","slug":"public-files","link":"#public-files","children":[{"level":3,"title":"Base Helper","slug":"base-helper","link":"#base-helper","children":[]}]},{"level":2,"title":"Packages and Path Aliases","slug":"packages-and-path-aliases","link":"#packages-and-path-aliases","children":[]}],"git":{"updatedTime":1725091193000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":4},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"guide/assets.md"}');export{b as comp,C as data};
diff --git a/assets/assets.html-Dq9vV_LH.js b/assets/assets.html-Dq9vV_LH.js
new file mode 100644
index 000000000..829a5b504
--- /dev/null
+++ b/assets/assets.html-Dq9vV_LH.js
@@ -0,0 +1,24 @@
+import{_ as t}from"./hero-BNkrhNQ6.js";import{_ as r,c as i,a as p,b as n,d as e,e as a,f as o,r as d,o as c}from"./app-9HBJsLu_.js";const u={},D={class:"hint-container tip"},m={class:"hint-container tip"};function y(v,s){const l=d("RouteLink");return c(),i("div",null,[s[34]||(s[34]=p('
`,11)),n("div",m,[s[33]||(s[33]=n("p",{class:"hint-container-title"},"提示",-1)),n("p",null,[s[32]||(s[32]=e("配置参考: ")),a(l,{to:"/zh/reference/plugin-api.html#alias"},{default:o(()=>s[31]||(s[31]=[e("alias")])),_:1})])])])}const C=r(u,[["render",y],["__file","assets.html.vue"]]),h=JSON.parse('{"path":"/zh/guide/assets.html","title":"静态资源","lang":"zh-CN","frontmatter":{"description":"静态资源 相对路径 你可以在你的 Markdown 内容中使用相对路径来引用静态资源: 或 一般情况下,我们推荐你使用这种方式来引用图片,因为人们通常会把图片放在引用它的 Markdown 文件附近。 Public 文件 你可以把一些静态资源放在 Public 目录中,它们会被复制到最终生成的网站的根目录下。 默认的 Public 目录是 .vuepr...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuepress.vuejs.org/guide/assets.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/zh/guide/assets.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"静态资源"}],["meta",{"property":"og:description","content":"静态资源 相对路径 你可以在你的 Markdown 内容中使用相对路径来引用静态资源: 或 一般情况下,我们推荐你使用这种方式来引用图片,因为人们通常会把图片放在引用它的 Markdown 文件附近。 Public 文件 你可以把一些静态资源放在 Public 目录中,它们会被复制到最终生成的网站的根目录下。 默认的 Public 目录是 .vuepr..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:image","content":"https://vuepress.vuejs.org/images/hero.png"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-08-31T07:59:53.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-31T07:59:53.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"静态资源\\",\\"image\\":[\\"https://vuepress.vuejs.org/images/hero.png\\",\\"https://vuepress.vuejs.org/images/hero.png\\",\\"https://vuepress.vuejs.org/images/hero.png\\"],\\"dateModified\\":\\"2024-08-31T07:59:53.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"相对路径","slug":"相对路径","link":"#相对路径","children":[]},{"level":2,"title":"Public 文件","slug":"public-文件","link":"#public-文件","children":[{"level":3,"title":"Base Helper","slug":"base-helper","link":"#base-helper","children":[]}]},{"level":2,"title":"依赖包和路径别名","slug":"依赖包和路径别名","link":"#依赖包和路径别名","children":[]}],"git":{"updatedTime":1725091193000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":4},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"zh/guide/assets.md"}');export{C as comp,h as data};
diff --git a/assets/bundler.html-CV5ajQhQ.js b/assets/bundler.html-CV5ajQhQ.js
new file mode 100644
index 000000000..1e8315e57
--- /dev/null
+++ b/assets/bundler.html-CV5ajQhQ.js
@@ -0,0 +1,16 @@
+import{_ as u,c,a as i,e as t,f as l,b as e,d as n,r as p,o as b}from"./app-9HBJsLu_.js";const m={};function v(y,s){const d=p("CodeTabs"),o=p("RouteLink");return b(),c("div",null,[s[11]||(s[11]=i('
VuePress supports using Webpack or Vite to dev and build sites. You can choose which bundler to use according to your preference, and no extra configuration is required.
When installing the vuepress package, no bundlers will be installed. You need to choose a bundler to install.
',4)),t(d,{id:"12",data:[{id:"pnpm"},{id:"yarn"},{id:"npm"}],"tab-id":"shell"},{title0:l(({value:a,isActive:r})=>s[0]||(s[0]=[n("pnpm")])),title1:l(({value:a,isActive:r})=>s[1]||(s[1]=[n("yarn")])),title2:l(({value:a,isActive:r})=>s[2]||(s[2]=[n("npm")])),tab0:l(({value:a,isActive:r})=>s[3]||(s[3]=[e("div",{class:"language-bash line-numbers-mode","data-highlighter":"shiki","data-ext":"bash","data-title":"bash",style:{"background-color":"#1E1E1E",color:"#D4D4D4"}},[e("pre",{class:"shiki dark-plus vp-code"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#6A9955"}},"# install vite bundler")]),n(`
+`),e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"pnpm"),e("span",{style:{color:"#CE9178"}}," add"),e("span",{style:{color:"#569CD6"}}," -D"),e("span",{style:{color:"#CE9178"}}," vuepress@next"),e("span",{style:{color:"#CE9178"}}," @vuepress/bundler-vite@next")]),n(`
+`),e("span",{class:"line"},[e("span",{style:{color:"#6A9955"}},"# install webpack bundler")]),n(`
+`),e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"pnpm"),e("span",{style:{color:"#CE9178"}}," add"),e("span",{style:{color:"#569CD6"}}," -D"),e("span",{style:{color:"#CE9178"}}," vuepress@next"),e("span",{style:{color:"#CE9178"}}," @vuepress/bundler-webpack@next")])])]),e("div",{class:"line-numbers","aria-hidden":"true",style:{"counter-reset":"line-number 0"}},[e("div",{class:"line-number"}),e("div",{class:"line-number"}),e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1)])),tab1:l(({value:a,isActive:r})=>s[4]||(s[4]=[e("div",{class:"language-bash line-numbers-mode","data-highlighter":"shiki","data-ext":"bash","data-title":"bash",style:{"background-color":"#1E1E1E",color:"#D4D4D4"}},[e("pre",{class:"shiki dark-plus vp-code"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#6A9955"}},"# install vite bundler")]),n(`
+`),e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"yarn"),e("span",{style:{color:"#CE9178"}}," add"),e("span",{style:{color:"#569CD6"}}," -D"),e("span",{style:{color:"#CE9178"}}," vuepress@next"),e("span",{style:{color:"#CE9178"}}," @vuepress/bundler-vite@next")]),n(`
+`),e("span",{class:"line"},[e("span",{style:{color:"#6A9955"}},"# install webpack bundler")]),n(`
+`),e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"yarn"),e("span",{style:{color:"#CE9178"}}," add"),e("span",{style:{color:"#569CD6"}}," -D"),e("span",{style:{color:"#CE9178"}}," vuepress@next"),e("span",{style:{color:"#CE9178"}}," @vuepress/bundler-webpack@next")])])]),e("div",{class:"line-numbers","aria-hidden":"true",style:{"counter-reset":"line-number 0"}},[e("div",{class:"line-number"}),e("div",{class:"line-number"}),e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1)])),tab2:l(({value:a,isActive:r})=>s[5]||(s[5]=[e("div",{class:"language-bash line-numbers-mode","data-highlighter":"shiki","data-ext":"bash","data-title":"bash",style:{"background-color":"#1E1E1E",color:"#D4D4D4"}},[e("pre",{class:"shiki dark-plus vp-code"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#6A9955"}},"# install vite bundler")]),n(`
+`),e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"npm"),e("span",{style:{color:"#CE9178"}}," install"),e("span",{style:{color:"#569CD6"}}," -D"),e("span",{style:{color:"#CE9178"}}," vuepress@next"),e("span",{style:{color:"#CE9178"}}," @vuepress/bundler-vite@next")]),n(`
+`),e("span",{class:"line"},[e("span",{style:{color:"#6A9955"}},"# install webpack bundler")]),n(`
+`),e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"npm"),e("span",{style:{color:"#CE9178"}}," install"),e("span",{style:{color:"#569CD6"}}," -D"),e("span",{style:{color:"#CE9178"}}," vuepress@next"),e("span",{style:{color:"#CE9178"}}," @vuepress/bundler-webpack@next")])])]),e("div",{class:"line-numbers","aria-hidden":"true",style:{"counter-reset":"line-number 0"}},[e("div",{class:"line-number"}),e("div",{class:"line-number"}),e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1)])),_:1}),s[12]||(s[12]=e("h2",{id:"use-a-bundler",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#use-a-bundler"},[e("span",null,"Use a Bundler")])],-1)),s[13]||(s[13]=e("p",null,"Generally, you could use a bundler without extra configuration, because we have already configured them properly to work with VuePress.",-1)),e("p",null,[s[7]||(s[7]=n("You can use a bundler via the ")),t(o,{to:"/reference/config.html#bundler"},{default:l(()=>s[6]||(s[6]=[n("bundler")])),_:1}),s[8]||(s[8]=n(" option:"))]),s[14]||(s[14]=i(`
When you need to customize the bundler, you can set the corresponding options:
`,2)),e("ul",null,[e("li",null,[t(o,{to:"/reference/bundler/vite.html"},{default:l(()=>s[9]||(s[9]=[n("Bundlers > Vite")])),_:1})]),e("li",null,[t(o,{to:"/reference/bundler/webpack.html"},{default:l(()=>s[10]||(s[10]=[n("Bundlers > Webpack")])),_:1})])])])}const g=u(m,[["render",v],["__file","bundler.html.vue"]]),C=JSON.parse('{"path":"/guide/bundler.html","title":"Bundler","lang":"en-US","frontmatter":{"description":"Bundler VuePress supports using Webpack or Vite to dev and build sites. You can choose which bundler to use according to your preference, and no extra configuration is required....","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/guide/bundler.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/guide/bundler.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Bundler"}],["meta",{"property":"og:description","content":"Bundler VuePress supports using Webpack or Vite to dev and build sites. You can choose which bundler to use according to your preference, and no extra configuration is required...."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-09-23T11:25:41.000Z"}],["meta",{"property":"article:modified_time","content":"2024-09-23T11:25:41.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Bundler\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-09-23T11:25:41.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Install a Bundler","slug":"install-a-bundler","link":"#install-a-bundler","children":[]},{"level":2,"title":"Use a Bundler","slug":"use-a-bundler","link":"#use-a-bundler","children":[]}],"git":{"updatedTime":1727090741000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":2},{"name":"Mister-Hope","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"guide/bundler.md"}');export{g as comp,C as data};
diff --git a/assets/bundler.html-D5kCpoeU.js b/assets/bundler.html-D5kCpoeU.js
new file mode 100644
index 000000000..deaf55a0a
--- /dev/null
+++ b/assets/bundler.html-D5kCpoeU.js
@@ -0,0 +1,16 @@
+import{_ as c,c as u,a as i,e as r,f as n,b as e,d as l,r as p,o as m}from"./app-9HBJsLu_.js";const b={};function v(y,s){const d=p("CodeTabs"),o=p("RouteLink");return m(),u("div",null,[s[11]||(s[11]=i('
Run vuepress --help to get following help messages:
Usage:
+ $ vuepress <command> [options]
+
+Commands:
+ dev [sourceDir] Start development server
+ build [sourceDir] Build to static site
+ info Display environment information
+
+For more info, run any command with the \`--help\` flag:
+ $ vuepress dev --help
+ $ vuepress build --help
+ $ vuepress info --help
+
+Options:
+ -v, --version Display version number
+ -h, --help Display this message
Start a development server to develop your VuePress site locally.
Usage:
+ $ vuepress dev [sourceDir]
+
+Options:
+ -c, --config <config> Set path to config file
+ -p, --port <port> Use specified port (default: 8080)
+ -t, --temp <temp> Set the directory of the temporary files
+ --host <host> Use specified host (default: 0.0.0.0)
+ --cache <cache> Set the directory of the cache files
+ --clean-temp Clean the temporary files before dev
+ --clean-cache Clean the cache files before dev
+ --open Open browser when ready
+ --debug Enable debug mode
+ --no-watch Disable watching page and config files (default: true)
+ -v, --version Display version number
+ -h, --help Display this message
Tips
Options set by CLI will override those options with the same name in your config file.
`,9)),p("p",null,[e[1]||(e[1]=n("Build your VuePress site to static files, which are ready for ")),t(a,{to:"/guide/deployment.html"},{default:r(()=>e[0]||(e[0]=[n("deployment")])),_:1}),e[2]||(e[2]=n("."))]),e[4]||(e[4]=s(`
Usage:
+ $ vuepress build [sourceDir]
+
+Options:
+ -c, --config <config> Set path to config file
+ -d, --dest <dest> Set the directory build output (default: .vuepress/dist)
+ -t, --temp <temp> Set the directory of the temporary files
+ --cache <cache> Set the directory of the cache files
+ --clean-temp Clean the temporary files before build
+ --clean-cache Clean the cache files before build
+ --debug Enable debug mode
+ -v, --version Display version number
+ -h, --help Display this message
Tips
Options set by CLI will override those options with the same name in your config file.
Outputs information about your system and dependencies.
This command would be helpful when you want to check your environment or report an issue.
`,5))])}const h=i(c,[["render",u],["__file","cli.html.vue"]]),b=JSON.parse('{"path":"/reference/cli.html","title":"Command Line Interface","lang":"en-US","frontmatter":{"description":"Command Line Interface Run vuepress --help to get following help messages: Tips VuePress is using debug module. Set environment variable DEBUG=vuepress* to enable debug logs. de...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/reference/cli.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/reference/cli.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Command Line Interface"}],["meta",{"property":"og:description","content":"Command Line Interface Run vuepress --help to get following help messages: Tips VuePress is using debug module. Set environment variable DEBUG=vuepress* to enable debug logs. de..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-02-06T15:46:43.000Z"}],["meta",{"property":"article:modified_time","content":"2024-02-06T15:46:43.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Command Line Interface\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-02-06T15:46:43.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"dev","slug":"dev","link":"#dev","children":[]},{"level":2,"title":"build","slug":"build","link":"#build","children":[]},{"level":2,"title":"info","slug":"info","link":"#info","children":[]}],"git":{"updatedTime":1707234403000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":3},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"reference/cli.md"}');export{h as comp,b as data};
diff --git a/assets/cli.html-CX21GLd1.js b/assets/cli.html-CX21GLd1.js
new file mode 100644
index 000000000..4d6b5e1f3
--- /dev/null
+++ b/assets/cli.html-CX21GLd1.js
@@ -0,0 +1,43 @@
+import{_ as i,c as l,a as n,b as p,d as s,e as t,f as r,r as d,o as c}from"./app-9HBJsLu_.js";const o={};function v(u,e){const a=d("RouteLink");return c(),l("div",null,[e[3]||(e[3]=n(`
Usage:
+ $ vuepress <command> [options]
+
+Commands:
+ dev [sourceDir] Start development server
+ build [sourceDir] Build to static site
+ info Display environment information
+
+For more info, run any command with the \`--help\` flag:
+ $ vuepress dev --help
+ $ vuepress build --help
+ $ vuepress info --help
+
+Options:
+ -v, --version Display version number
+ -h, --help Display this message
Usage:
+ $ vuepress dev [sourceDir]
+
+Options:
+ -c, --config <config> Set path to config file
+ -p, --port <port> Use specified port (default: 8080)
+ -t, --temp <temp> Set the directory of the temporary files
+ --host <host> Use specified host (default: 0.0.0.0)
+ --cache <cache> Set the directory of the cache files
+ --clean-temp Clean the temporary files before dev
+ --clean-cache Clean the cache files before dev
+ --open Open browser when ready
+ --debug Enable debug mode
+ --no-watch Disable watching page and config files (default: true)
+ -v, --version Display version number
+ -h, --help Display this message
Usage:
+ $ vuepress build [sourceDir]
+
+Options:
+ -c, --config <config> Set path to config file
+ -d, --dest <dest> Set the directory build output (default: .vuepress/dist)
+ -t, --temp <temp> Set the directory of the temporary files
+ --cache <cache> Set the directory of the cache files
+ --clean-temp Clean the temporary files before build
+ --clean-cache Clean the cache files before build
+ --debug Enable debug mode
+ -v, --version Display version number
+ -h, --help Display this message
`,4))])}const y=r(c,[["render",g],["__file","client-api.html.vue"]]),f=JSON.parse('{"path":"/zh/reference/client-api.html","title":"客户端 API","lang":"zh-CN","frontmatter":{"description":"客户端 API 客户端 API 可以通过 vuepress/client 来引入。 组合式 API useClientData 详情: 返回所有客户端数据的 Ref 对象。 每个属性也可以通过下列的组合式 API 来访问。 示例: usePageData 详情: 返回当前页面数据的 Ref 对象。 参考: usePageFrontmatter 详情: ...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuepress.vuejs.org/reference/client-api.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/zh/reference/client-api.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"客户端 API"}],["meta",{"property":"og:description","content":"客户端 API 客户端 API 可以通过 vuepress/client 来引入。 组合式 API useClientData 详情: 返回所有客户端数据的 Ref 对象。 每个属性也可以通过下列的组合式 API 来访问。 示例: usePageData 详情: 返回当前页面数据的 Ref 对象。 参考: usePageFrontmatter 详情: ..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-05-24T08:18:58.000Z"}],["meta",{"property":"article:modified_time","content":"2024-05-24T08:18:58.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"客户端 API\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-05-24T08:18:58.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"组合式 API","slug":"组合式-api","link":"#组合式-api","children":[{"level":3,"title":"useClientData","slug":"useclientdata","link":"#useclientdata","children":[]},{"level":3,"title":"usePageData","slug":"usepagedata","link":"#usepagedata","children":[]},{"level":3,"title":"usePageFrontmatter","slug":"usepagefrontmatter","link":"#usepagefrontmatter","children":[]},{"level":3,"title":"usePageHead","slug":"usepagehead","link":"#usepagehead","children":[]},{"level":3,"title":"usePageHeadTitle","slug":"usepageheadtitle","link":"#usepageheadtitle","children":[]},{"level":3,"title":"usePageLang","slug":"usepagelang","link":"#usepagelang","children":[]},{"level":3,"title":"useRoutes","slug":"useroutes","link":"#useroutes","children":[]},{"level":3,"title":"useRouteLocale","slug":"useroutelocale","link":"#useroutelocale","children":[]},{"level":3,"title":"useSiteData","slug":"usesitedata","link":"#usesitedata","children":[]},{"level":3,"title":"useSiteLocaleData","slug":"usesitelocaledata","link":"#usesitelocaledata","children":[]}]},{"level":2,"title":"工具函数","slug":"工具函数","link":"#工具函数","children":[{"level":3,"title":"defineClientConfig","slug":"defineclientconfig","link":"#defineclientconfig","children":[]},{"level":3,"title":"resolveRoute","slug":"resolveroute","link":"#resolveroute","children":[]}]},{"level":2,"title":"resolveRoutePath","slug":"resolveroutepath","link":"#resolveroutepath","children":[{"level":3,"title":"withBase","slug":"withbase","link":"#withbase","children":[]}]},{"level":2,"title":"常量","slug":"常量","link":"#常量","children":[{"level":3,"title":"__VUEPRESS_VERSION__","slug":"vuepress-version","link":"#vuepress-version","children":[]},{"level":3,"title":"__VUEPRESS_BASE__","slug":"vuepress-base","link":"#vuepress-base","children":[]},{"level":3,"title":"__VUEPRESS_DEV__","slug":"vuepress-dev","link":"#vuepress-dev","children":[]},{"level":3,"title":"__VUEPRESS_SSR__","slug":"vuepress-ssr","link":"#vuepress-ssr","children":[]}]},{"level":2,"title":"进阶能力","slug":"进阶能力","link":"#进阶能力","children":[{"level":3,"title":"resolvers","slug":"resolvers","link":"#resolvers","children":[]}]}],"git":{"updatedTime":1716538738000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":5},{"name":"Mister-Hope","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"zh/reference/client-api.md"}');export{y as comp,f as data};
diff --git a/assets/client-api.html-CS-yYR-t.js b/assets/client-api.html-CS-yYR-t.js
new file mode 100644
index 000000000..837288e07
--- /dev/null
+++ b/assets/client-api.html-CS-yYR-t.js
@@ -0,0 +1,25 @@
+import{_ as p,c as u,a as o,b as l,e as n,f as t,d as s,r as i,o as d}from"./app-9HBJsLu_.js";const c={},v={id:"resolvers",tabindex:"-1"},D={class:"header-anchor",href:"#resolvers"};function g(h,e){const a=i("RouteLink"),r=i("Badge");return d(),u("div",null,[e[43]||(e[43]=o(`
`,7)),l("ul",null,[e[3]||(e[3]=l("li",null,[l("p",null,"Details:"),l("p",null,"Returns the page data ref object of current page.")],-1)),l("li",null,[e[2]||(e[2]=l("p",null,"Also see:",-1)),l("ul",null,[l("li",null,[n(a,{to:"/reference/node-api.html#data"},{default:t(()=>e[0]||(e[0]=[s("Node API > Page Properties > data")])),_:1})]),l("li",null,[n(a,{to:"/reference/plugin-api.html#extendspage"},{default:t(()=>e[1]||(e[1]=[s("Plugin API > extendsPage")])),_:1})])])])]),e[44]||(e[44]=l("h3",{id:"usepagefrontmatter",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#usepagefrontmatter"},[l("span",null,"usePageFrontmatter")])],-1)),e[45]||(e[45]=l("ul",null,[l("li",null,[l("p",null,"Details:"),l("p",null,"Returns the frontmatter ref object of current page."),l("p",null,[s("The value is the "),l("code",null,"frontmatter"),s(" property of the page data.")])])],-1)),e[46]||(e[46]=l("h3",{id:"usepagehead",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#usepagehead"},[l("span",null,"usePageHead")])],-1)),l("ul",null,[l("li",null,[e[9]||(e[9]=l("p",null,"Details:",-1)),e[10]||(e[10]=l("p",null,"Returns the head config ref object of current page.",-1)),l("p",null,[e[6]||(e[6]=s("The value is obtained by merging and deduplicating ")),n(a,{to:"/reference/frontmatter.html#head"},{default:t(()=>e[4]||(e[4]=[s("head")])),_:1}),e[7]||(e[7]=s(" frontmatter and ")),n(a,{to:"/reference/config.html#head"},{default:t(()=>e[5]||(e[5]=[s("head")])),_:1}),e[8]||(e[8]=s(" config."))])])]),e[47]||(e[47]=o('
',5)),l("ul",null,[e[13]||(e[13]=l("li",null,[l("p",null,"Details:"),l("p",null,"Returns the routes ref object."),l("p",null,[s("The value is the "),l("code",null,"routes"),s(" property of the site data.")])],-1)),l("li",null,[e[12]||(e[12]=l("p",null,"Also see:",-1)),l("ul",null,[l("li",null,[n(a,{to:"/advanced/cookbook/resolving-routes.html"},{default:t(()=>e[11]||(e[11]=[s("Advanced > Cookbook > Resolving Routes")])),_:1})])])])]),e[48]||(e[48]=l("h3",{id:"useroutelocale",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#useroutelocale"},[l("span",null,"useRouteLocale")])],-1)),l("ul",null,[l("li",null,[e[17]||(e[17]=l("p",null,"Details:",-1)),e[18]||(e[18]=l("p",null,"Returns the locale path ref object of current route.",-1)),l("p",null,[e[15]||(e[15]=s("The value is one of the keys of the ")),n(a,{to:"/reference/config.html#locales"},{default:t(()=>e[14]||(e[14]=[s("locales")])),_:1}),e[16]||(e[16]=s(" config."))])])]),e[49]||(e[49]=o('
',6)),l("ul",null,[l("li",null,[e[22]||(e[22]=l("p",null,"Details:",-1)),l("p",null,[e[20]||(e[20]=s("Helper for creating ")),n(a,{to:"/reference/plugin-api.html#clientconfigfile"},{default:t(()=>e[19]||(e[19]=[s("clientConfigFile")])),_:1}),e[21]||(e[21]=s("."))])]),l("li",null,[e[24]||(e[24]=l("p",null,"Also see:",-1)),l("ul",null,[l("li",null,[n(a,{to:"/advanced/cookbook/usage-of-client-config.html"},{default:t(()=>e[23]||(e[23]=[s("Advanced > Cookbook > Usage of Client Config")])),_:1})])])])]),e[50]||(e[50]=l("h3",{id:"resolveroute",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#resolveroute"},[l("span",null,"resolveRoute")])],-1)),l("ul",null,[e[27]||(e[27]=l("li",null,[l("p",null,"Details:"),l("p",null,"Parses the route of the given link.")],-1)),l("li",null,[e[26]||(e[26]=l("p",null,"Also see:",-1)),l("ul",null,[l("li",null,[n(a,{to:"/advanced/cookbook/resolving-routes.html"},{default:t(()=>e[25]||(e[25]=[s("Advanced > Cookbook > Resolving Routes")])),_:1})])])])]),e[51]||(e[51]=l("h2",{id:"resolveroutepath",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#resolveroutepath"},[l("span",null,"resolveRoutePath")])],-1)),l("ul",null,[e[30]||(e[30]=l("li",null,[l("p",null,"Details:"),l("p",null,"Parses the route path of the given link.")],-1)),l("li",null,[e[29]||(e[29]=l("p",null,"Also see:",-1)),l("ul",null,[l("li",null,[n(a,{to:"/advanced/cookbook/resolving-routes.html"},{default:t(()=>e[28]||(e[28]=[s("Advanced > Cookbook > Resolving Routes")])),_:1})])])])]),e[52]||(e[52]=l("h3",{id:"withbase",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#withbase"},[l("span",null,"withBase")])],-1)),l("ul",null,[l("li",null,[e[34]||(e[34]=l("p",null,"Details:",-1)),l("p",null,[e[32]||(e[32]=s("Prefix URL with site ")),n(a,{to:"/reference/config.html#base"},{default:t(()=>e[31]||(e[31]=[s("base")])),_:1}),e[33]||(e[33]=s("."))])]),l("li",null,[e[36]||(e[36]=l("p",null,"Also see:",-1)),l("ul",null,[l("li",null,[n(a,{to:"/guide/assets.html#base-helper"},{default:t(()=>e[35]||(e[35]=[s("Guide > Assets > Base Helper")])),_:1})])])])]),e[53]||(e[53]=o(`
resolvers will affect the basic functionality of VuePress. Please make sure you have fully understood its purpose before modifying it.
`,4))])}const m=p(c,[["render",g],["__file","client-api.html.vue"]]),y=JSON.parse('{"path":"/reference/client-api.html","title":"Client API","lang":"en-US","frontmatter":{"description":"Client API Client API can be imported from vuepress/client. Composition API useClientData Details: Returns all the client data ref objects. Each property can also be accessed by...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/reference/client-api.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/reference/client-api.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Client API"}],["meta",{"property":"og:description","content":"Client API Client API can be imported from vuepress/client. Composition API useClientData Details: Returns all the client data ref objects. Each property can also be accessed by..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-05-24T08:18:58.000Z"}],["meta",{"property":"article:modified_time","content":"2024-05-24T08:18:58.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Client API\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-05-24T08:18:58.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"useClientData","slug":"useclientdata","link":"#useclientdata","children":[]},{"level":3,"title":"usePageData","slug":"usepagedata","link":"#usepagedata","children":[]},{"level":3,"title":"usePageFrontmatter","slug":"usepagefrontmatter","link":"#usepagefrontmatter","children":[]},{"level":3,"title":"usePageHead","slug":"usepagehead","link":"#usepagehead","children":[]},{"level":3,"title":"usePageHeadTitle","slug":"usepageheadtitle","link":"#usepageheadtitle","children":[]},{"level":3,"title":"usePageLang","slug":"usepagelang","link":"#usepagelang","children":[]}]},{"level":2,"title":"useRoutes","slug":"useroutes","link":"#useroutes","children":[{"level":3,"title":"useRouteLocale","slug":"useroutelocale","link":"#useroutelocale","children":[]},{"level":3,"title":"useSiteData","slug":"usesitedata","link":"#usesitedata","children":[]},{"level":3,"title":"useSiteLocaleData","slug":"usesitelocaledata","link":"#usesitelocaledata","children":[]}]},{"level":2,"title":"Helpers","slug":"helpers","link":"#helpers","children":[{"level":3,"title":"defineClientConfig","slug":"defineclientconfig","link":"#defineclientconfig","children":[]},{"level":3,"title":"resolveRoute","slug":"resolveroute","link":"#resolveroute","children":[]}]},{"level":2,"title":"resolveRoutePath","slug":"resolveroutepath","link":"#resolveroutepath","children":[{"level":3,"title":"withBase","slug":"withbase","link":"#withbase","children":[]}]},{"level":2,"title":"Constants","slug":"constants","link":"#constants","children":[{"level":3,"title":"__VUEPRESS_VERSION__","slug":"vuepress-version","link":"#vuepress-version","children":[]},{"level":3,"title":"__VUEPRESS_BASE__","slug":"vuepress-base","link":"#vuepress-base","children":[]},{"level":3,"title":"__VUEPRESS_DEV__","slug":"vuepress-dev","link":"#vuepress-dev","children":[]},{"level":3,"title":"__VUEPRESS_SSR__","slug":"vuepress-ssr","link":"#vuepress-ssr","children":[]}]},{"level":2,"title":"Advanced","slug":"advanced","link":"#advanced","children":[{"level":3,"title":"resolvers","slug":"resolvers","link":"#resolvers","children":[]}]}],"git":{"updatedTime":1716538738000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":5},{"name":"Mister-Hope","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"reference/client-api.md"}');export{m as comp,y as data};
diff --git a/assets/components.html-CHBTFX2a.js b/assets/components.html-CHBTFX2a.js
new file mode 100644
index 000000000..507925b83
--- /dev/null
+++ b/assets/components.html-CHBTFX2a.js
@@ -0,0 +1,56 @@
+import{_ as o,c as t,a as e,b as s,d as l,e as p,f as i,r as c,o as r}from"./app-9HBJsLu_.js";const d={};function u(y,n){const a=c("RouteLink");return r(),t("div",null,[n[3]||(n[3]=e(`
interface AutoLinkConfig {
+ /**
+ * Pattern to determine if the link should be active, which has higher priority than \`exact\`
+ */
+ activeMatch?: RegExp | string
+
+ /**
+ * The \`aria-label\` attribute
+ */
+ ariaLabel?: string
+
+ /**
+ * Whether the link should be active only if the url is an exact match
+ */
+ exact?: boolean
+
+ /**
+ * URL of the auto link
+ */
+ link: string
+
+ /**
+ * The \`rel\` attribute
+ */
+ rel?: string
+
+ /**
+ * The \`target\` attribute
+ */
+ target?: string
+
+ /**
+ * Text of the auto link
+ */
+ text: string
+}
This component will automatically render internal link as <RouteLink>, and render external link as <a>. It will also add necessary attributes correspondingly.
You can make use of the before and after slots to render content before and after the text. Also, you can use the default slot to render the text (default text is config.text).
This component is mainly for developing themes. Users won't need it in most cases. For theme authors, it's recommended to use this component to render links that could be either internal or external.
This component and its children will only be rendered in client-side. That means, it will not be rendered to HTML during build (SSR).
If a component is trying to access Browser / DOM APIs directly in setup(), an error will occur during build because those APIs are unavailable in Node.js environment. In such case, you could do either:
Modify the component to only access Browser / DOM APIs in onBeforeMount() or onMounted() hook.
Wrap the component with <ClientOnly>.
Tips
Since Vue 3.5, if you only want to avoid hydration mismatch, you can try the new data-allow-mismatch attribute instead of <ClientOnly> component.
`,15)),s("ul",null,[n[2]||(n[2]=s("li",null,[s("p",null,"Details:"),s("p",null,"This component will render the Markdown content of a page."),s("p",null,[e("If the "),s("code",null,"path"),e(" prop is not provided, it will render the page content of current route.")]),s("p",null,"This component is mainly for developing themes. You won't need it in most cases.")],-1)),s("li",null,[n[1]||(n[1]=s("p",null,"Also see:",-1)),s("ul",null,[s("li",null,[i(a,{to:"/reference/node-api.html#path"},{default:p(()=>n[0]||(n[0]=[e("Node API > Page Properties > path")])),_:1})])])])]),n[4]||(n[4]=l(`
<RouteLink to="/path/to/target-page.md">target page</RouteLink>
+<RouteLink active to="/path/to/current-page.md">current page</RouteLink>
Details:
This component will render a link to the target page.
If the active prop is set to true, the link will have an extra activeClass. Notice that the active status won't be updated automatically when the route changes.
This component is mainly for developing themes. Users won't need it in most cases. For theme authors, it's recommended to use this component to render internal links instead of the <RouterLink> component from vue-router.
`,4))])}const v=o(d,[["render",u],["__file","components.html.vue"]]),h=JSON.parse('{"path":"/reference/components.html","title":"Built-in Components","lang":"en-US","frontmatter":{"description":"Built-in Components AutoLink Props: config Type: AutoLinkConfig Required: true Usage: Details: This component will automatically render internal link as , and render ...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/reference/components.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/reference/components.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Built-in Components"}],["meta",{"property":"og:description","content":"Built-in Components AutoLink Props: config Type: AutoLinkConfig Required: true Usage: Details: This component will automatically render internal link as , and render ..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-09-03T15:31:59.000Z"}],["meta",{"property":"article:modified_time","content":"2024-09-03T15:31:59.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Built-in Components\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-09-03T15:31:59.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"AutoLink","slug":"autolink","link":"#autolink","children":[]},{"level":2,"title":"ClientOnly","slug":"clientonly","link":"#clientonly","children":[]},{"level":2,"title":"Content","slug":"content","link":"#content","children":[]},{"level":2,"title":"RouteLink","slug":"routelink","link":"#routelink","children":[]}],"git":{"updatedTime":1725377519000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":5},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"张怀文","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"reference/components.md"}');export{v as comp,h as data};
diff --git a/assets/config.html-8J-gA8_g.js b/assets/config.html-8J-gA8_g.js
new file mode 100644
index 000000000..00571699c
--- /dev/null
+++ b/assets/config.html-8J-gA8_g.js
@@ -0,0 +1,15 @@
+import{_ as o,c as r,a as s,b as l,e as i,f as t,d as n,r as p,o as d}from"./app-9HBJsLu_.js";const u={};function m(h,e){const a=p("RouteLink");return d(),r("div",null,[e[86]||(e[86]=s('
',9)),l("ul",null,[e[26]||(e[26]=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1)),e[27]||(e[27]=l("li",null,[l("p",null,[n("默认值: "),l("code",null,"`${sourceDir}/.vuepress/public`")])],-1)),e[28]||(e[28]=l("li",null,[l("p",null,"详情:"),l("p",null,"指定 Public 文件目录。")],-1)),l("li",null,[e[25]||(e[25]=l("p",null,"参考:",-1)),l("ul",null,[l("li",null,[i(a,{to:"/zh/guide/assets.html#public-%E6%96%87%E4%BB%B6"},{default:t(()=>e[24]||(e[24]=[n("指南 > 静态资源 > Public 文件")])),_:1})])])])]),e[95]||(e[95]=s('
",3)),l("li",null,[e[77]||(e[77]=l("p",null,"参考:",-1)),l("ul",null,[l("li",null,[i(a,{to:"/zh/guide/markdown.html#%E6%B7%BB%E5%8A%A0-v-pre"},{default:t(()=>e[76]||(e[76]=[n("指南 > Markdown > 语法扩展 > 代码块 > 添加 v-pre")])),_:1})])])])]),e[108]||(e[108]=l("h2",{id:"插件配置",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#插件配置"},[l("span",null,"插件配置")])],-1)),e[109]||(e[109]=l("h3",{id:"plugins",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#plugins"},[l("span",null,"plugins")])],-1)),l("ul",null,[e[81]||(e[81]=l("li",null,[l("p",null,[n("类型: "),l("code",null,"PluginConfig[]")])],-1)),e[82]||(e[82]=l("li",null,[l("p",null,"详情:"),l("p",null,"要使用的插件。"),l("p",null,"该配置项接收一个数组,其中的每一个数组项是一个或一组插件。")],-1)),l("li",null,[e[80]||(e[80]=l("p",null,"参考:",-1)),l("ul",null,[l("li",null,[i(a,{to:"/zh/guide/plugin.html"},{default:t(()=>e[79]||(e[79]=[n("指南 > 插件")])),_:1})])])])]),e[110]||(e[110]=l("h2",{id:"插件-api",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#插件-api"},[l("span",null,"插件 API")])],-1)),e[111]||(e[111]=l("p",null,[n("用户配置文件同样可以作为一个 VuePress 插件,所以除了 "),l("code",null,"name"),n(" 和 "),l("code",null,"multiple"),n(" 配置项以外的所有插件 API 都可以在配置文件中使用。")],-1)),l("p",null,[e[84]||(e[84]=n("前往 ")),i(a,{to:"/zh/reference/plugin-api.html"},{default:t(()=>e[83]||(e[83]=[n("插件 API 参考")])),_:1}),e[85]||(e[85]=n(" 查看所有插件 API 。"))])])}const g=o(u,[["render",m],["__file","config.html.vue"]]),k=JSON.parse('{"path":"/zh/reference/config.html","title":"配置","lang":"zh-CN","frontmatter":{"description":"配置 站点配置 base 类型: string 默认值: / 详情: 部署站点的基础路径。 如果你想让你的网站部署到一个子路径下,你将需要设置它。它的值应当总是以斜杠开始,并以斜杠结束。举例来说,如果你想将你的网站部署到 https://foo.github.io/bar/,那么 base 应该被设置成 \\"/bar/\\"。 base 将会作为前缀自动地插...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuepress.vuejs.org/reference/config.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/zh/reference/config.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"配置"}],["meta",{"property":"og:description","content":"配置 站点配置 base 类型: string 默认值: / 详情: 部署站点的基础路径。 如果你想让你的网站部署到一个子路径下,你将需要设置它。它的值应当总是以斜杠开始,并以斜杠结束。举例来说,如果你想将你的网站部署到 https://foo.github.io/bar/,那么 base 应该被设置成 \\"/bar/\\"。 base 将会作为前缀自动地插..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-07-14T14:29:58.000Z"}],["meta",{"property":"article:modified_time","content":"2024-07-14T14:29:58.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"配置\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-07-14T14:29:58.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"站点配置","slug":"站点配置","link":"#站点配置","children":[{"level":3,"title":"base","slug":"base","link":"#base","children":[]},{"level":3,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":3,"title":"title","slug":"title","link":"#title","children":[]},{"level":3,"title":"description","slug":"description","link":"#description","children":[]},{"level":3,"title":"head","slug":"head","link":"#head","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"主题配置","slug":"主题配置","link":"#主题配置","children":[{"level":3,"title":"theme","slug":"theme","link":"#theme","children":[]}]},{"level":2,"title":"打包工具配置","slug":"打包工具配置","link":"#打包工具配置","children":[{"level":3,"title":"bundler","slug":"bundler","link":"#bundler","children":[]}]},{"level":2,"title":"通用配置项","slug":"通用配置项","link":"#通用配置项","children":[{"level":3,"title":"dest","slug":"dest","link":"#dest","children":[]},{"level":3,"title":"temp","slug":"temp","link":"#temp","children":[]},{"level":3,"title":"cache","slug":"cache","link":"#cache","children":[]},{"level":3,"title":"public","slug":"public","link":"#public","children":[]},{"level":3,"title":"debug","slug":"debug","link":"#debug","children":[]},{"level":3,"title":"pagePatterns","slug":"pagepatterns","link":"#pagepatterns","children":[]},{"level":3,"title":"permalinkPattern","slug":"permalinkpattern","link":"#permalinkpattern","children":[]}]},{"level":2,"title":"Dev 配置项","slug":"dev-配置项","link":"#dev-配置项","children":[{"level":3,"title":"host","slug":"host","link":"#host","children":[]},{"level":3,"title":"port","slug":"port","link":"#port","children":[]},{"level":3,"title":"open","slug":"open","link":"#open","children":[]},{"level":3,"title":"templateDev","slug":"templatedev","link":"#templatedev","children":[]}]},{"level":2,"title":"Build 配置项","slug":"build-配置项","link":"#build-配置项","children":[{"level":3,"title":"shouldPreload","slug":"shouldpreload","link":"#shouldpreload","children":[]},{"level":3,"title":"shouldPrefetch","slug":"shouldprefetch","link":"#shouldprefetch","children":[]},{"level":3,"title":"templateBuild","slug":"templatebuild","link":"#templatebuild","children":[]},{"level":3,"title":"templateBuildRenderer","slug":"templatebuildrenderer","link":"#templatebuildrenderer","children":[]}]},{"level":2,"title":"Markdown 配置","slug":"markdown-配置","link":"#markdown-配置","children":[{"level":3,"title":"markdown","slug":"markdown","link":"#markdown","children":[]},{"level":3,"title":"markdown.anchor","slug":"markdown-anchor","link":"#markdown-anchor","children":[]},{"level":3,"title":"markdown.assets","slug":"markdown-assets","link":"#markdown-assets","children":[]},{"level":3,"title":"markdown.component","slug":"markdown-component","link":"#markdown-component","children":[]},{"level":3,"title":"markdown.emoji","slug":"markdown-emoji","link":"#markdown-emoji","children":[]},{"level":3,"title":"markdown.frontmatter","slug":"markdown-frontmatter","link":"#markdown-frontmatter","children":[]},{"level":3,"title":"markdown.headers","slug":"markdown-headers","link":"#markdown-headers","children":[]},{"level":3,"title":"markdown.importCode","slug":"markdown-importcode","link":"#markdown-importcode","children":[]},{"level":3,"title":"markdown.links","slug":"markdown-links","link":"#markdown-links","children":[]},{"level":3,"title":"markdown.sfc","slug":"markdown-sfc","link":"#markdown-sfc","children":[]},{"level":3,"title":"markdown.slugify","slug":"markdown-slugify","link":"#markdown-slugify","children":[]},{"level":3,"title":"markdown.title","slug":"markdown-title","link":"#markdown-title","children":[]},{"level":3,"title":"markdown.toc","slug":"markdown-toc","link":"#markdown-toc","children":[]}]},{"level":2,"title":"插件配置","slug":"插件配置","link":"#插件配置","children":[{"level":3,"title":"plugins","slug":"plugins","link":"#plugins","children":[]}]},{"level":2,"title":"插件 API","slug":"插件-api","link":"#插件-api","children":[]}],"git":{"updatedTime":1720967398000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":5},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":2},{"name":"lebennington","email":"100212066+lebennington@users.noreply.github.com","commits":1}]},"autoDesc":true,"filePathRelative":"zh/reference/config.md"}');export{g as comp,k as data};
diff --git a/assets/config.html-CDKipwFP.js b/assets/config.html-CDKipwFP.js
new file mode 100644
index 000000000..27a6c3be9
--- /dev/null
+++ b/assets/config.html-CDKipwFP.js
@@ -0,0 +1,15 @@
+import{_ as a,c as r,a as s,b as e,e as i,f as o,d as n,r as p,o as d}from"./app-9HBJsLu_.js";const u={};function f(h,l){const t=p("RouteLink");return d(),r("div",null,[l[90]||(l[90]=s('
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 set base 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 / .
',3)),e("li",null,[l[2]||(l[2]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/assets.html#base-helper"},{default:o(()=>l[0]||(l[0]=[n("Guide > Assets > Base Helper")])),_:1})]),e("li",null,[i(t,{to:"/guide/deployment.html"},{default:o(()=>l[1]||(l[1]=[n("Guide > Deployment")])),_:1})])])])]),l[91]||(l[91]=e("h3",{id:"lang",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#lang"},[e("span",null,"lang")])],-1)),e("ul",null,[l[7]||(l[7]=s("
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 will be the content attribute of <meta name="description" /> tag in the rendered HTML, which will be overrode by the description field of page frontmatter.
',3)),e("li",null,[l[16]||(l[16]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/i18n.html"},{default:o(()=>l[15]||(l[15]=[n("Guide > I18n")])),_:1})])])])]),l[95]||(l[95]=e("h2",{id:"theme-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#theme-config"},[e("span",null,"Theme Config")])],-1)),l[96]||(l[96]=e("h3",{id:"theme",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#theme"},[e("span",null,"theme")])],-1)),e("ul",null,[l[21]||(l[21]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"Theme")])],-1)),l[22]||(l[22]=e("li",null,[e("p",null,"Details:"),e("p",null,"Set the theme of your site."),e("p",null,"If this option is not set, the default theme will be used.")],-1)),e("li",null,[l[20]||(l[20]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/theme.html"},{default:o(()=>l[18]||(l[18]=[n("Guide > Theme")])),_:1})]),l[19]||(l[19]=e("li",null,[e("a",{href:"https://ecosystem.vuejs.press/themes/default/config.html",target:"_blank",rel:"noopener noreferrer"},"Default Theme > Config")],-1))])])]),l[97]||(l[97]=e("h2",{id:"bundler-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#bundler-config"},[e("span",null,"Bundler Config")])],-1)),l[98]||(l[98]=e("h3",{id:"bundler",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#bundler"},[e("span",null,"bundler")])],-1)),e("ul",null,[l[27]||(l[27]=s("
Type: Bundler
Details:
Set the bundler of your site.
If this option is not set, the default bundler will be used:
With vuepress or vuepress-vite, the default bundler is vite.
With vuepress-webpack, the default bundler is webpack.
',9)),e("ul",null,[l[30]||(l[30]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string")])],-1)),l[31]||(l[31]=e("li",null,[e("p",null,[n("Default: "),e("code",null,"`${sourceDir}/.vuepress/public`")])],-1)),l[32]||(l[32]=e("li",null,[e("p",null,"Details:"),e("p",null,"Specify the directory for public files.")],-1)),e("li",null,[l[29]||(l[29]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/assets.html#public-files"},{default:o(()=>l[28]||(l[28]=[n("Guide > Assets > Public Files")])),_:1})])])])]),l[100]||(l[100]=s('
This would be helpful for developers. Also, we are using debug package for debug logging, which can be enabled via DEBUG=vuepress* environment variable.
A function to control what files should have <link rel="prefetch"> resource hints generated. Set to true or false 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.
`,3)),e("ul",null,[l[42]||(l[42]=e("li",null,[e("p",null,"Details:"),e("p",null,[n("Options for "),e("a",{href:"https://github.com/valeriangalliat/markdown-it-anchor",target:"_blank",rel:"noopener noreferrer"},"markdown-it-anchor"),n(".")]),e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")])],-1)),e("li",null,[l[41]||(l[41]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/markdown.html#header-anchors"},{default:o(()=>l[40]||(l[40]=[n("Guide > Markdown > Syntax Extensions > Header Anchors")])),_:1})])])])]),l[103]||(l[103]=s('
',7)),e("ul",null,[l[45]||(l[45]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"EmojiPluginOptions | false")])],-1)),l[46]||(l[46]=e("li",null,[e("p",null,"Details:"),e("p",null,[n("Options for "),e("a",{href:"https://github.com/markdown-it/markdown-it-emoji",target:"_blank",rel:"noopener noreferrer"},"markdown-it-emoji"),n(".")]),e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")])],-1)),e("li",null,[l[44]||(l[44]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/markdown.html#emoji"},{default:o(()=>l[43]||(l[43]=[n("Guide > Markdown > Syntax Extensions > Emoji")])),_:1})])])])]),l[104]||(l[104]=e("h3",{id:"markdown-frontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-frontmatter"},[e("span",null,"markdown.frontmatter")])],-1)),e("ul",null,[l[50]||(l[50]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"FrontmatterPluginOptions | false")])],-1)),l[51]||(l[51]=e("li",null,[e("p",null,"Details:"),e("p",null,[n("Options for "),e("a",{href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-frontmatter",target:"_blank",rel:"noopener noreferrer"},"@mdit-vue/plugin-frontmatter"),n(".")]),e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")])],-1)),e("li",null,[l[49]||(l[49]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/page.html#frontmatter"},{default:o(()=>l[47]||(l[47]=[n("Guide > Page > Frontmatter")])),_:1})]),e("li",null,[i(t,{to:"/reference/node-api.html#frontmatter"},{default:o(()=>l[48]||(l[48]=[n("Node API > Page Properties > frontmatter")])),_:1})])])])]),l[105]||(l[105]=s(`
Caution
You should not configure it unless you understand what it is for.
`,4)),e("ul",null,[l[54]||(l[54]=e("li",null,[e("p",null,"Details:"),e("p",null,[n("Options for "),e("a",{href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-headers",target:"_blank",rel:"noopener noreferrer"},"@mdit-vue/plugin-headers"),n(".")]),e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")])],-1)),e("li",null,[l[53]||(l[53]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/reference/node-api.html#headers"},{default:o(()=>l[52]||(l[52]=[n("Node API > Page Properties > headers")])),_:1})])])])]),l[106]||(l[106]=e("h3",{id:"markdown-importcode",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-importcode"},[e("span",null,"markdown.importCode")])],-1)),e("ul",null,[l[57]||(l[57]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"ImportCodePluginOptions | false")])],-1)),l[58]||(l[58]=e("li",null,[e("p",null,"Details:"),e("p",null,"Options for VuePress built-in markdown-it import-code plugin."),e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")])],-1)),e("li",null,[l[56]||(l[56]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/markdown.html#import-code-blocks"},{default:o(()=>l[55]||(l[55]=[n("Guide > Markdown > Syntax Extensions > Import Code Blocks")])),_:1})])])])]),l[107]||(l[107]=s('
',3)),e("ul",null,[l[72]||(l[72]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"SfcPluginOptions | false")])],-1)),l[73]||(l[73]=e("li",null,[e("p",null,"Details:"),e("p",null,[n("Options for "),e("a",{href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-sfc",target:"_blank",rel:"noopener noreferrer"},"@mdit-vue/plugin-sfc"),n(".")]),e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")])],-1)),e("li",null,[l[71]||(l[71]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/advanced/cookbook/markdown-and-vue-sfc.html"},{default:o(()=>l[69]||(l[69]=[n("Cookbook > Markdown and Vue SFC")])),_:1})]),e("li",null,[i(t,{to:"/reference/node-api.html#sfcblocks"},{default:o(()=>l[70]||(l[70]=[n("Node API > Page Properties > sfcBlocks")])),_:1})])])])]),l[110]||(l[110]=s(`
Caution
You should not configure it unless you understand what it is for.
`,9)),e("ul",null,[l[76]||(l[76]=e("li",null,[e("p",null,"Details:"),e("p",null,[n("Options for "),e("a",{href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc",target:"_blank",rel:"noopener noreferrer"},"@mdit-vue/plugin-toc"),n(".")]),e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")])],-1)),e("li",null,[l[75]||(l[75]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/markdown.html#table-of-contents"},{default:o(()=>l[74]||(l[74]=[n("Guide > Markdown > Syntax Extensions > Table of Contents")])),_:1})])])])]),l[111]||(l[111]=e("h4",{id:"markdown-vpre-block",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-vpre-block"},[e("span",null,"markdown.vPre.block")])],-1)),e("ul",null,[l[79]||(l[79]=s("
Type: boolean
Default: true
Details:
Add v-pre directive to <pre> tag of code block or not.
Add v-pre directive to <code> tag of inline code or not.
",3)),e("li",null,[l[81]||(l[81]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/markdown.html#wrap-with-v-pre"},{default:o(()=>l[80]||(l[80]=[n("Guide > Markdown > Syntax Extensions > Code Blocks > Wrap with v-pre")])),_:1})])])])]),l[113]||(l[113]=e("h2",{id:"plugin-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugin-config"},[e("span",null,"Plugin Config")])],-1)),l[114]||(l[114]=e("h3",{id:"plugins",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugins"},[e("span",null,"plugins")])],-1)),e("ul",null,[l[85]||(l[85]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"(Plugin | Plugin[])[]")])],-1)),l[86]||(l[86]=e("li",null,[e("p",null,"Details:"),e("p",null,"Plugins to use."),e("p",null,"This option accepts an array, each item of which could be a plugin or an array of plugins.")],-1)),e("li",null,[l[84]||(l[84]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[i(t,{to:"/guide/plugin.html"},{default:o(()=>l[83]||(l[83]=[n("Guide > Plugin")])),_:1})])])])]),l[115]||(l[115]=e("h2",{id:"plugin-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugin-api"},[e("span",null,"Plugin API")])],-1)),l[116]||(l[116]=e("p",null,[n("User config file also works as a VuePress plugin, so all of the Plugin APIs are available except the "),e("code",null,"name"),n(" and "),e("code",null,"multiple"),n(" options.")],-1)),e("p",null,[l[88]||(l[88]=n("Please check out ")),i(t,{to:"/reference/plugin-api.html"},{default:o(()=>l[87]||(l[87]=[n("Plugin API Reference")])),_:1}),l[89]||(l[89]=n(" for a full list of Plugin APIs."))])])}const m=a(u,[["render",f],["__file","config.html.vue"]]),g=JSON.parse('{"path":"/reference/config.html","title":"Config","lang":"en-US","frontmatter":{"description":"Config Site Config base 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. I...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/reference/config.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/reference/config.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Config"}],["meta",{"property":"og:description","content":"Config Site Config base 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. I..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-07-14T14:29:58.000Z"}],["meta",{"property":"article:modified_time","content":"2024-07-14T14:29:58.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Config\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-07-14T14:29:58.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Site Config","slug":"site-config","link":"#site-config","children":[{"level":3,"title":"base","slug":"base","link":"#base","children":[]},{"level":3,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":3,"title":"title","slug":"title","link":"#title","children":[]},{"level":3,"title":"description","slug":"description","link":"#description","children":[]},{"level":3,"title":"head","slug":"head","link":"#head","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Theme Config","slug":"theme-config","link":"#theme-config","children":[{"level":3,"title":"theme","slug":"theme","link":"#theme","children":[]}]},{"level":2,"title":"Bundler Config","slug":"bundler-config","link":"#bundler-config","children":[{"level":3,"title":"bundler","slug":"bundler","link":"#bundler","children":[]}]},{"level":2,"title":"Common Config","slug":"common-config","link":"#common-config","children":[{"level":3,"title":"dest","slug":"dest","link":"#dest","children":[]},{"level":3,"title":"temp","slug":"temp","link":"#temp","children":[]},{"level":3,"title":"cache","slug":"cache","link":"#cache","children":[]},{"level":3,"title":"public","slug":"public","link":"#public","children":[]},{"level":3,"title":"debug","slug":"debug","link":"#debug","children":[]},{"level":3,"title":"pagePatterns","slug":"pagepatterns","link":"#pagepatterns","children":[]},{"level":3,"title":"permalinkPattern","slug":"permalinkpattern","link":"#permalinkpattern","children":[]}]},{"level":2,"title":"Dev Config","slug":"dev-config","link":"#dev-config","children":[{"level":3,"title":"host","slug":"host","link":"#host","children":[]},{"level":3,"title":"port","slug":"port","link":"#port","children":[]},{"level":3,"title":"open","slug":"open","link":"#open","children":[]},{"level":3,"title":"templateDev","slug":"templatedev","link":"#templatedev","children":[]}]},{"level":2,"title":"Build Config","slug":"build-config","link":"#build-config","children":[{"level":3,"title":"shouldPreload","slug":"shouldpreload","link":"#shouldpreload","children":[]},{"level":3,"title":"shouldPrefetch","slug":"shouldprefetch","link":"#shouldprefetch","children":[]},{"level":3,"title":"templateBuild","slug":"templatebuild","link":"#templatebuild","children":[]},{"level":3,"title":"templateBuildRenderer","slug":"templatebuildrenderer","link":"#templatebuildrenderer","children":[]}]},{"level":2,"title":"Markdown Config","slug":"markdown-config","link":"#markdown-config","children":[{"level":3,"title":"markdown","slug":"markdown","link":"#markdown","children":[]},{"level":3,"title":"markdown.anchor","slug":"markdown-anchor","link":"#markdown-anchor","children":[]},{"level":3,"title":"markdown.assets","slug":"markdown-assets","link":"#markdown-assets","children":[]},{"level":3,"title":"markdown.component","slug":"markdown-component","link":"#markdown-component","children":[]},{"level":3,"title":"markdown.emoji","slug":"markdown-emoji","link":"#markdown-emoji","children":[]},{"level":3,"title":"markdown.frontmatter","slug":"markdown-frontmatter","link":"#markdown-frontmatter","children":[]},{"level":3,"title":"markdown.headers","slug":"markdown-headers","link":"#markdown-headers","children":[]},{"level":3,"title":"markdown.importCode","slug":"markdown-importcode","link":"#markdown-importcode","children":[]},{"level":3,"title":"markdown.links","slug":"markdown-links","link":"#markdown-links","children":[]},{"level":3,"title":"markdown.sfc","slug":"markdown-sfc","link":"#markdown-sfc","children":[]},{"level":3,"title":"markdown.slugify","slug":"markdown-slugify","link":"#markdown-slugify","children":[]},{"level":3,"title":"markdown.title","slug":"markdown-title","link":"#markdown-title","children":[]},{"level":3,"title":"markdown.toc","slug":"markdown-toc","link":"#markdown-toc","children":[]}]},{"level":2,"title":"Plugin Config","slug":"plugin-config","link":"#plugin-config","children":[{"level":3,"title":"plugins","slug":"plugins","link":"#plugins","children":[]}]},{"level":2,"title":"Plugin API","slug":"plugin-api","link":"#plugin-api","children":[]}],"git":{"updatedTime":1720967398000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":5},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":2},{"name":"lebennington","email":"100212066+lebennington@users.noreply.github.com","commits":1}]},"autoDesc":true,"filePathRelative":"reference/config.md"}');export{m as comp,g as data};
diff --git a/assets/configuration.html-DM_-Lxly.js b/assets/configuration.html-DM_-Lxly.js
new file mode 100644
index 000000000..201a214b8
--- /dev/null
+++ b/assets/configuration.html-DM_-Lxly.js
@@ -0,0 +1,24 @@
+import{_ as t,c as r,a as i,b as s,d as n,e as o,f as a,r as p,o as c}from"./app-9HBJsLu_.js";const d={},u={class:"hint-container tip"},f={class:"hint-container tip"};function g(v,e){const l=p("RouteLink");return c(),r("div",null,[e[13]||(e[13]=i('
The essential file for configuring a VuePress site is .vuepress/config.js, while TypeScript config file is also supported. You can use .vuepress/config.ts instead to get better types hint for VuePress config.
To be more specific, we have a convention for config file paths (in order of precedence):
In current working directory cwd:
vuepress.config.ts
vuepress.config.js
vuepress.config.mjs
In source directory sourceDir:
.vuepress/config.ts
.vuepress/config.js
.vuepress/config.mjs
',5)),s("p",null,[e[1]||(e[1]=n("You can also specify the config file via ")),e[2]||(e[2]=s("code",null,"--config",-1)),e[3]||(e[3]=n(" option of ")),o(l,{to:"/reference/cli.html"},{default:a(()=>e[0]||(e[0]=[n("CLI")])),_:1}),e[4]||(e[4]=n(":"))]),e[14]||(e[14]=i(`
`,3)),s("div",u,[e[8]||(e[8]=s("p",{class:"hint-container-title"},"Tips",-1)),s("p",null,[e[6]||(e[6]=n("Check out the ")),o(l,{to:"/reference/config.html"},{default:a(()=>e[5]||(e[5]=[n("Config Reference")])),_:1}),e[7]||(e[7]=n(" for a full list of VuePress config."))])]),e[15]||(e[15]=i(`
In most cases, the config file is sufficient to configure your VuePress site. However, sometimes users may want to add some client-side code directly. To help with this, VuePress also supports a client config file:
`,7)),s("div",f,[e[11]||(e[11]=s("p",{class:"hint-container-title"},"Tips",-1)),e[12]||(e[12]=s("p",null,"Unlike config file, client config file could not be specified via CLI options.",-1)),s("p",null,[e[10]||(e[10]=n("To learn more about client config file, see ")),o(l,{to:"/advanced/cookbook/usage-of-client-config.html"},{default:a(()=>e[9]||(e[9]=[n("Advanced > Cookbook > Usage of Client Config")])),_:1})])])])}const m=t(d,[["render",g],["__file","configuration.html.vue"]]),C=JSON.parse('{"path":"/guide/configuration.html","title":"Configuration","lang":"en-US","frontmatter":{"description":"Configuration Config File The essential file for configuring a VuePress site is .vuepress/config.js, while TypeScript config file is also supported. You can use .vuepress/config...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/guide/configuration.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/guide/configuration.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Configuration"}],["meta",{"property":"og:description","content":"Configuration Config File The essential file for configuring a VuePress site is .vuepress/config.js, while TypeScript config file is also supported. You can use .vuepress/config..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-01-26T16:29:43.000Z"}],["meta",{"property":"article:modified_time","content":"2024-01-26T16:29:43.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Configuration\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-01-26T16:29:43.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Config File","slug":"config-file","link":"#config-file","children":[]},{"level":2,"title":"Client Config File","slug":"client-config-file","link":"#client-config-file","children":[]}],"git":{"updatedTime":1706286583000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":4}]},"autoDesc":true,"filePathRelative":"guide/configuration.md"}');export{m as comp,C as data};
diff --git a/assets/configuration.html-DvWzyqpP.js b/assets/configuration.html-DvWzyqpP.js
new file mode 100644
index 000000000..9b9566d11
--- /dev/null
+++ b/assets/configuration.html-DvWzyqpP.js
@@ -0,0 +1,24 @@
+import{_ as p,c as t,a,b as n,d as e,e as o,f as i,r,o as c}from"./app-9HBJsLu_.js";const d={},u={class:"hint-container tip"},v={class:"hint-container tip"};function D(m,s){const l=r("RouteLink");return c(),t("div",null,[s[14]||(s[14]=a('
`,5)),e("ol",null,[e("li",null,[e("p",null,[s[1]||(s[1]=n("Set the correct ")),i(l,{to:"/reference/config.html#base"},{default:p(()=>s[0]||(s[0]=[n("base")])),_:1}),s[2]||(s[2]=n(" config."))]),s[3]||(s[3]=a("
If you are deploying to https://<USERNAME>.github.io/, you can omit this step as base defaults to "/".
If you are deploying to https://<USERNAME>.github.io/<REPO>/, for example your repository is at https://github.com/<USERNAME>/<REPO>, then set base to "/<REPO>/".
",2))]),s[4]||(s[4]=e("li",null,[e("p",null,[n("Choose your preferred CI tools. Here we take "),e("a",{href:"https://github.com/features/actions",target:"_blank",rel:"noopener noreferrer"},"GitHub Actions"),n(" as an example.")]),e("p",null,[n("Create "),e("code",null,".github/workflows/docs.yml"),n(" to set up the workflow.")])],-1))]),s[11]||(s[11]=a(`Click to expand sample config
name: docs
+
+on:
+ # trigger deployment on every push to main branch
+ push:
+ branches: [main]
+ # trigger deployment manually
+ workflow_dispatch:
+
+jobs:
+ docs:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ # fetch all commits to get last updated time or other git log info
+ fetch-depth: 0
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ # choose pnpm version to use
+ version: 8
+ # install deps with pnpm
+ run_install: true
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ # choose node.js version to use
+ node-version: 20
+ # cache deps for pnpm
+ cache: pnpm
+
+ # run build script
+ - name: Build VuePress site
+ run: pnpm docs:build
+
+ # please check out the docs of the workflow for more details
+ # @see https://github.com/crazy-max/ghaction-github-pages
+ - name: Deploy to GitHub Pages
+ uses: crazy-max/ghaction-github-pages@v4
+ with:
+ # deploy to gh-pages branch
+ target_branch: gh-pages
+ # deploy the default output dir of VuePress
+ build_dir: docs/.vuepress/dist
+ env:
+ # @see https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
`,3)),e("ol",null,[e("li",null,[e("p",null,[s[6]||(s[6]=n("Set the correct ")),i(l,{to:"/reference/config.html#base"},{default:p(()=>s[5]||(s[5]=[n("base")])),_:1}),s[7]||(s[7]=n(" config."))]),s[8]||(s[8]=a("
If you are deploying to https://<USERNAME>.gitlab.io/, you can omit base as it defaults to "/".
If you are deploying to https://<USERNAME>.gitlab.io/<REPO>/, for example your repository is at https://gitlab.com/<USERNAME>/<REPO>, then set base to "/<REPO>/".
",2))]),s[9]||(s[9]=e("li",null,[e("p",null,[n("Create "),e("code",null,".gitlab-ci.yml"),n(" to set up "),e("a",{href:"https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/",target:"_blank",rel:"noopener noreferrer"},"GitLab CI"),n(" workflow.")])],-1))]),s[12]||(s[12]=a(`Click to expand sample config
# choose a docker image to use
+image: node:18-buster
+
+pages:
+ # trigger deployment on every push to main branch
+ only:
+ - main
+
+ # cache node_modules
+ cache:
+ key:
+ files:
+ - pnpm-lock.yaml
+ paths:
+ - .pnpm-store
+
+ # Install pnpm
+ before_script:
+ - curl -fsSL https://get.pnpm.io/install.sh | sh -
+ - pnpm config set store-dir .pnpm-store
+
+ # install dependencies and run build script
+ script:
+ - pnpm i --frozen-lockfile
+ - pnpm docs:build --dest public
+
+ artifacts:
+ paths:
+ - public
Go to Vercel, set up a new project from GitHub with the following settings:
FRAMEWORK PRESET:Other
BUILD COMMAND:pnpm docs:build
OUTPUT DIRECTORY:docs/.vuepress/dist
Hit the deploy button.
`,25))])}const b=o(c,[["render",u],["__file","deployment.html.vue"]]),h=JSON.parse('{"path":"/guide/deployment.html","title":"Deployment","lang":"en-US","frontmatter":{"description":"Deployment The following guides are based on some shared assumptions: You are placing your Markdown source files inside the docs directory of your project; You are using the def...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/guide/deployment.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/guide/deployment.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Deployment"}],["meta",{"property":"og:description","content":"Deployment The following guides are based on some shared assumptions: You are placing your Markdown source files inside the docs directory of your project; You are using the def..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-10-03T04:37:36.000Z"}],["meta",{"property":"article:modified_time","content":"2024-10-03T04:37:36.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Deployment\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-10-03T04:37:36.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"GitHub Pages","slug":"github-pages","link":"#github-pages","children":[]},{"level":2,"title":"GitLab Pages","slug":"gitlab-pages","link":"#gitlab-pages","children":[]},{"level":2,"title":"Google Firebase","slug":"google-firebase","link":"#google-firebase","children":[]},{"level":2,"title":"Heroku","slug":"heroku","link":"#heroku","children":[]},{"level":2,"title":"Kinsta","slug":"kinsta","link":"#kinsta","children":[]},{"level":2,"title":"Edgio","slug":"edgio","link":"#edgio","children":[]},{"level":2,"title":"Netlify","slug":"netlify","link":"#netlify","children":[]},{"level":2,"title":"Vercel","slug":"vercel","link":"#vercel","children":[]}],"git":{"updatedTime":1727930256000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":3},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"autoDesc":true,"filePathRelative":"guide/deployment.md"}');export{b as comp,h as data};
diff --git a/assets/frontmatter.html-Diet5G1N.js b/assets/frontmatter.html-Diet5G1N.js
new file mode 100644
index 000000000..d89d2ce39
--- /dev/null
+++ b/assets/frontmatter.html-Diet5G1N.js
@@ -0,0 +1,24 @@
+import{_ as r,c as i,b as l,d as n,e as s,f as a,a as o,r as p,o as d}from"./app-9HBJsLu_.js";const u={};function m(c,e){const t=p("RouteLink");return d(),i("div",null,[e[34]||(e[34]=l("h1",{id:"frontmatter",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#frontmatter"},[l("span",null,"Frontmatter")])],-1)),e[35]||(e[35]=l("h2",{id:"date",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#date"},[l("span",null,"date")])],-1)),l("ul",null,[e[2]||(e[2]=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1)),e[3]||(e[3]=l("li",null,[l("p",null,"详情:"),l("p",null,"页面的创建日期。"),l("p",null,[n("应按照 "),l("code",null,"yyyy-MM-dd"),n(" 的格式来指定日期,或者遵循 "),l("a",{href:"https://yaml.org/type/timestamp.html",target:"_blank",rel:"noopener noreferrer"},"YAML Timestamp Type"),n(" 。")])],-1)),l("li",null,[e[1]||(e[1]=l("p",null,"参考:",-1)),l("ul",null,[l("li",null,[s(t,{to:"/zh/reference/node-api.html#date"},{default:a(()=>e[0]||(e[0]=[n("Node API > Page 属性 > date")])),_:1})])])])]),e[36]||(e[36]=l("h2",{id:"description",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#description"},[l("span",null,"description")])],-1)),l("ul",null,[e[6]||(e[6]=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1)),e[7]||(e[7]=l("li",null,[l("p",null,"详情:"),l("p",null,"页面的描述。"),l("p",null,[n("它将会覆盖站点配置中的 "),l("code",null,"description"),n(" 配置项。")])],-1)),l("li",null,[e[5]||(e[5]=l("p",null,"参考:",-1)),l("ul",null,[l("li",null,[s(t,{to:"/zh/reference/config.html#description"},{default:a(()=>e[4]||(e[4]=[n("配置 > description")])),_:1})])])])]),e[37]||(e[37]=o(`
`,7)),l("ul",null,[l("li",null,[e[25]||(e[25]=n("参考: ")),l("ul",null,[l("li",null,[s(t,{to:"/zh/reference/config.html#permalinkpattern"},{default:a(()=>e[21]||(e[21]=[n("配置 > permalinkPattern")])),_:1})]),e[23]||(e[23]=l("li",null,[l("a",{href:"#date"},"Frontmatter > date")],-1)),e[24]||(e[24]=l("li",null,[l("a",{href:"#permalink"},"Frontmatter > permalink")],-1)),l("li",null,[s(t,{to:"/zh/reference/node-api.html#permalink"},{default:a(()=>e[22]||(e[22]=[n("Node API > Page 属性 > permalink")])),_:1})])])])]),e[41]||(e[41]=l("h2",{id:"routemeta",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#routemeta"},[l("span",null,"routeMeta")])],-1)),l("ul",null,[e[28]||(e[28]=l("li",null,[l("p",null,[n("类型: "),l("code",null,"Record")])],-1)),e[29]||(e[29]=l("li",null,[l("p",null,"详情:"),l("p",null,"附加到页面路由的自定义数据。")],-1)),l("li",null,[e[27]||(e[27]=l("p",null,"参考:",-1)),l("ul",null,[l("li",null,[s(t,{to:"/zh/reference/node-api.html#routeMeta"},{default:a(()=>e[26]||(e[26]=[n("Node API > Page 属性 > routeMeta")])),_:1})])])])]),e[42]||(e[42]=l("h2",{id:"title",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#title"},[l("span",null,"title")])],-1)),l("ul",null,[e[32]||(e[32]=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1)),e[33]||(e[33]=l("li",null,[l("p",null,"详情:"),l("p",null,"页面的标题。"),l("p",null,[n("如果你不在 Frontmatter 中设置 "),l("code",null,"title"),n(" ,那么页面中第一个一级标题(即 "),l("code",null,"# title"),n(")的内容会被当作标题使用。")])],-1)),l("li",null,[e[31]||(e[31]=l("p",null,"参考:",-1)),l("ul",null,[l("li",null,[s(t,{to:"/zh/reference/node-api.html#title"},{default:a(()=>e[30]||(e[30]=[n("Node API > Page 属性 > title")])),_:1})])])])])])}const D=r(u,[["render",m],["__file","frontmatter.html.vue"]]),v=JSON.parse('{"path":"/zh/reference/frontmatter.html","title":"Frontmatter","lang":"zh-CN","frontmatter":{"description":"Frontmatter date 类型: string 详情: 页面的创建日期。 应按照 yyyy-MM-dd 的格式来指定日期,或者遵循 YAML Timestamp Type 。 参考: description 类型: string 详情: 页面的描述。 它将会覆盖站点配置中的 description 配置项。 参考: head 类型: HeadC...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuepress.vuejs.org/reference/frontmatter.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/zh/reference/frontmatter.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Frontmatter"}],["meta",{"property":"og:description","content":"Frontmatter date 类型: string 详情: 页面的创建日期。 应按照 yyyy-MM-dd 的格式来指定日期,或者遵循 YAML Timestamp Type 。 参考: description 类型: string 详情: 页面的描述。 它将会覆盖站点配置中的 description 配置项。 参考: head 类型: HeadC..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-05-16T12:45:44.000Z"}],["meta",{"property":"article:modified_time","content":"2024-05-16T12:45:44.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Frontmatter\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-05-16T12:45:44.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"date","slug":"date","link":"#date","children":[]},{"level":2,"title":"description","slug":"description","link":"#description","children":[]},{"level":2,"title":"head","slug":"head","link":"#head","children":[]},{"level":2,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":2,"title":"layout","slug":"layout","link":"#layout","children":[]},{"level":2,"title":"permalink","slug":"permalink","link":"#permalink","children":[]},{"level":2,"title":"permalinkPattern","slug":"permalinkpattern","link":"#permalinkpattern","children":[]},{"level":2,"title":"routeMeta","slug":"routemeta","link":"#routemeta","children":[]},{"level":2,"title":"title","slug":"title","link":"#title","children":[]}],"git":{"updatedTime":1715863544000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":5},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"张怀文","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"zh/reference/frontmatter.md"}');export{D as comp,v as data};
diff --git a/assets/frontmatter.html-DjGtDI42.js b/assets/frontmatter.html-DjGtDI42.js
new file mode 100644
index 000000000..b6cd4f822
--- /dev/null
+++ b/assets/frontmatter.html-DjGtDI42.js
@@ -0,0 +1,24 @@
+import{_ as i,c as r,b as e,d as n,e as a,f as s,a as o,r as p,o as d}from"./app-9HBJsLu_.js";const u={};function m(c,l){const t=p("RouteLink");return d(),r("div",null,[l[34]||(l[34]=e("h1",{id:"frontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#frontmatter"},[e("span",null,"Frontmatter")])],-1)),l[35]||(l[35]=e("h2",{id:"date",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#date"},[e("span",null,"date")])],-1)),e("ul",null,[l[2]||(l[2]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string")])],-1)),l[3]||(l[3]=e("li",null,[e("p",null,"Details:"),e("p",null,"Created date for the page."),e("p",null,[n("You should specify the date in the form of "),e("code",null,"yyyy-MM-dd"),n(", or follow the "),e("a",{href:"https://yaml.org/type/timestamp.html",target:"_blank",rel:"noopener noreferrer"},"YAML Timestamp Type"),n(".")])],-1)),e("li",null,[l[1]||(l[1]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[a(t,{to:"/reference/node-api.html#date"},{default:s(()=>l[0]||(l[0]=[n("Node API > Page Properties > date")])),_:1})])])])]),l[36]||(l[36]=e("h2",{id:"description",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#description"},[e("span",null,"description")])],-1)),e("ul",null,[l[6]||(l[6]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string")])],-1)),l[7]||(l[7]=e("li",null,[e("p",null,"Details:"),e("p",null,"Description for the page."),e("p",null,[n("This will override the "),e("code",null,"description"),n(" option in your site config.")])],-1)),e("li",null,[l[5]||(l[5]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[a(t,{to:"/reference/config.html#description"},{default:s(()=>l[4]||(l[4]=[n("Config > description")])),_:1})])])])]),l[37]||(l[37]=o(`
`,5)),e("ul",null,[e("li",null,[l[9]||(l[9]=n("Also see: ")),e("ul",null,[e("li",null,[a(t,{to:"/reference/config.html#head"},{default:s(()=>l[8]||(l[8]=[n("Config > head")])),_:1})])])])]),l[38]||(l[38]=e("h2",{id:"lang",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#lang"},[e("span",null,"lang")])],-1)),e("ul",null,[l[13]||(l[13]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string")])],-1)),l[14]||(l[14]=e("li",null,[e("p",null,"Details:"),e("p",null,"Language for the page."),e("p",null,[n("This will override the "),e("code",null,"lang"),n(" option in your site config.")])],-1)),e("li",null,[l[12]||(l[12]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[a(t,{to:"/reference/config.html#lang"},{default:s(()=>l[10]||(l[10]=[n("Config > lang")])),_:1})]),e("li",null,[a(t,{to:"/reference/node-api.html#lang"},{default:s(()=>l[11]||(l[11]=[n("Node API > Page Properties > lang")])),_:1})])])])]),l[39]||(l[39]=o(`
Layouts are provided by theme. If you don't specify this frontmatter, the default layout will be used. You should refer to the theme's own documentation to find what layouts it provides.
If the theme layouts cannot meet your needs, you can use a custom layout component.
Example:
Register a layout component in .vuepress/client.ts file:
`,7)),e("ul",null,[l[19]||(l[19]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string | null")])],-1)),l[20]||(l[20]=e("li",null,[e("p",null,"Details:"),e("p",null,"Permalink for the page."),e("p",null,"This will override the default route path that determined by the file path of the page."),e("p",null,[n("When it is set to "),e("code",null,"null"),n(", the permalink of the page will be disabled.")])],-1)),e("li",null,[l[18]||(l[18]=e("p",null,"Also see:",-1)),e("ul",null,[l[17]||(l[17]=e("li",null,[e("a",{href:"#permalinkpattern"},"Frontmatter > permalinkPattern")],-1)),e("li",null,[a(t,{to:"/guide/page.html#routing"},{default:s(()=>l[15]||(l[15]=[n("Guide > Page > Routing")])),_:1})]),e("li",null,[a(t,{to:"/reference/node-api.html#permalink"},{default:s(()=>l[16]||(l[16]=[n("Node API > Page Properties > permalink")])),_:1})])])])]),l[40]||(l[40]=o(`
Then the permalink of the page would be 2021/01/03/bar-baz.html.
`,7)),e("ul",null,[e("li",null,[l[25]||(l[25]=n("Also see: ")),e("ul",null,[e("li",null,[a(t,{to:"/reference/config.html#permalinkpattern"},{default:s(()=>l[21]||(l[21]=[n("Config > permalinkPattern")])),_:1})]),l[23]||(l[23]=e("li",null,[e("a",{href:"#date"},"Frontmatter > date")],-1)),l[24]||(l[24]=e("li",null,[e("a",{href:"#permalink"},"Frontmatter > permalink")],-1)),e("li",null,[a(t,{to:"/reference/node-api.html#permalink"},{default:s(()=>l[22]||(l[22]=[n("Node API > Page Properties > permalink")])),_:1})])])])]),l[41]||(l[41]=e("h2",{id:"routemeta",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#routemeta"},[e("span",null,"routeMeta")])],-1)),e("ul",null,[l[28]||(l[28]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"Record")])],-1)),l[29]||(l[29]=e("li",null,[e("p",null,"Details:"),e("p",null,"Custom data to be attached to the page route.")],-1)),e("li",null,[l[27]||(l[27]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[a(t,{to:"/reference/node-api.html#routeMeta"},{default:s(()=>l[26]||(l[26]=[n("Node API > Page Properties > routeMeta")])),_:1})])])])]),l[42]||(l[42]=e("h2",{id:"title",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#title"},[e("span",null,"title")])],-1)),e("ul",null,[l[32]||(l[32]=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string")])],-1)),l[33]||(l[33]=e("li",null,[e("p",null,"Details:"),e("p",null,"Title for the page."),e("p",null,[n("If you don't specify "),e("code",null,"title"),n(" in frontmatter, content of the first level-one header (i.e. "),e("code",null,"# title"),n(") will be used as the title.")])],-1)),e("li",null,[l[31]||(l[31]=e("p",null,"Also see:",-1)),e("ul",null,[e("li",null,[a(t,{to:"/reference/node-api.html#title"},{default:s(()=>l[30]||(l[30]=[n("Node API > Page Properties > title")])),_:1})])])])])])}const h=i(u,[["render",m],["__file","frontmatter.html.vue"]]),f=JSON.parse('{"path":"/reference/frontmatter.html","title":"Frontmatter","lang":"en-US","frontmatter":{"description":"Frontmatter date Type: string Details: Created date for the page. You should specify the date in the form of yyyy-MM-dd, or follow the YAML Timestamp Type. Also see: description...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/reference/frontmatter.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/reference/frontmatter.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Frontmatter"}],["meta",{"property":"og:description","content":"Frontmatter date Type: string Details: Created date for the page. You should specify the date in the form of yyyy-MM-dd, or follow the YAML Timestamp Type. Also see: description..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-05-16T12:45:44.000Z"}],["meta",{"property":"article:modified_time","content":"2024-05-16T12:45:44.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Frontmatter\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-05-16T12:45:44.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"date","slug":"date","link":"#date","children":[]},{"level":2,"title":"description","slug":"description","link":"#description","children":[]},{"level":2,"title":"head","slug":"head","link":"#head","children":[]},{"level":2,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":2,"title":"layout","slug":"layout","link":"#layout","children":[]},{"level":2,"title":"permalink","slug":"permalink","link":"#permalink","children":[]},{"level":2,"title":"permalinkPattern","slug":"permalinkpattern","link":"#permalinkpattern","children":[]},{"level":2,"title":"routeMeta","slug":"routemeta","link":"#routemeta","children":[]},{"level":2,"title":"title","slug":"title","link":"#title","children":[]}],"git":{"updatedTime":1715863544000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":5},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"张怀文","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"reference/frontmatter.md"}');export{h as comp,f as data};
diff --git a/assets/getting-started.html-CbWxeq6y.js b/assets/getting-started.html-CbWxeq6y.js
new file mode 100644
index 000000000..b56b9bd2f
--- /dev/null
+++ b/assets/getting-started.html-CbWxeq6y.js
@@ -0,0 +1,36 @@
+import{_ as c,c as u,a as o,e as r,f as a,b as e,d as l,r as d,o as v}from"./app-9HBJsLu_.js";const m={};function b(h,s){const t=d("CodeTabs"),p=d("RouteLink");return v(),u("div",null,[s[38]||(s[38]=o('
VuePress v2 is currently in RC (Release Candidate) stage. It's ready to be used for building your site, but the config and API are not stable enough, which is possibly to have minor breaking changes. So make sure to read the changelog carefully each time you upgrade a RC version.
The docs directory is where you put your markdown files, and it will be used as the source directory of VuePress.
The docs/.vuepress directory, i.e. the .vuepress directory in the source directory, is where all VuePress-specific files will be placed. Currently there is only one config file in it. By default, the temp, cache and output directory will also be generated inside this directory. It is suggested to add them to your .gitignore file.
Then, run docs:dev script to start the dev server:
`,17)),r(i,{id:"169",data:[{id:"pnpm"},{id:"yarn"},{id:"npm"}],"tab-id":"shell"},{title0:n(({value:a,isActive:t})=>s[18]||(s[18]=[l("pnpm")])),title1:n(({value:a,isActive:t})=>s[19]||(s[19]=[l("yarn")])),title2:n(({value:a,isActive:t})=>s[20]||(s[20]=[l("npm")])),tab0:n(({value:a,isActive:t})=>s[21]||(s[21]=[e("div",{class:"language-bash line-numbers-mode","data-highlighter":"shiki","data-ext":"bash","data-title":"bash",style:{"background-color":"#1E1E1E",color:"#D4D4D4"}},[e("pre",{class:"shiki dark-plus vp-code"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"pnpm"),e("span",{style:{color:"#CE9178"}}," docs:dev")])])]),e("div",{class:"line-numbers","aria-hidden":"true",style:{"counter-reset":"line-number 0"}},[e("div",{class:"line-number"})])],-1)])),tab1:n(({value:a,isActive:t})=>s[22]||(s[22]=[e("div",{class:"language-bash line-numbers-mode","data-highlighter":"shiki","data-ext":"bash","data-title":"bash",style:{"background-color":"#1E1E1E",color:"#D4D4D4"}},[e("pre",{class:"shiki dark-plus vp-code"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"yarn"),e("span",{style:{color:"#CE9178"}}," docs:dev")])])]),e("div",{class:"line-numbers","aria-hidden":"true",style:{"counter-reset":"line-number 0"}},[e("div",{class:"line-number"})])],-1)])),tab2:n(({value:a,isActive:t})=>s[23]||(s[23]=[e("div",{class:"language-bash line-numbers-mode","data-highlighter":"shiki","data-ext":"bash","data-title":"bash",style:{"background-color":"#1E1E1E",color:"#D4D4D4"}},[e("pre",{class:"shiki dark-plus vp-code"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"npm"),e("span",{style:{color:"#CE9178"}}," run"),e("span",{style:{color:"#CE9178"}}," docs:dev")])])]),e("div",{class:"line-numbers","aria-hidden":"true",style:{"counter-reset":"line-number 0"}},[e("div",{class:"line-number"})])],-1)])),_:1}),s[42]||(s[42]=e("p",null,[l("VuePress will start a hot-reloading development server at "),e("a",{href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"},"http://localhost:8080"),l(". When you modify your markdown files, the content in the browser will be auto updated.")],-1)),s[43]||(s[43]=e("h3",{id:"build-your-site",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#build-your-site"},[e("span",null,"Build Your Site")])],-1)),s[44]||(s[44]=e("p",null,[l("To build your site, run "),e("code",null,"docs:build"),l(" script:")],-1)),r(i,{id:"189",data:[{id:"pnpm"},{id:"yarn"},{id:"npm"}],"tab-id":"shell"},{title0:n(({value:a,isActive:t})=>s[24]||(s[24]=[l("pnpm")])),title1:n(({value:a,isActive:t})=>s[25]||(s[25]=[l("yarn")])),title2:n(({value:a,isActive:t})=>s[26]||(s[26]=[l("npm")])),tab0:n(({value:a,isActive:t})=>s[27]||(s[27]=[e("div",{class:"language-bash line-numbers-mode","data-highlighter":"shiki","data-ext":"bash","data-title":"bash",style:{"background-color":"#1E1E1E",color:"#D4D4D4"}},[e("pre",{class:"shiki dark-plus vp-code"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"pnpm"),e("span",{style:{color:"#CE9178"}}," docs:build")])])]),e("div",{class:"line-numbers","aria-hidden":"true",style:{"counter-reset":"line-number 0"}},[e("div",{class:"line-number"})])],-1)])),tab1:n(({value:a,isActive:t})=>s[28]||(s[28]=[e("div",{class:"language-bash line-numbers-mode","data-highlighter":"shiki","data-ext":"bash","data-title":"bash",style:{"background-color":"#1E1E1E",color:"#D4D4D4"}},[e("pre",{class:"shiki dark-plus vp-code"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"yarn"),e("span",{style:{color:"#CE9178"}}," docs:build")])])]),e("div",{class:"line-numbers","aria-hidden":"true",style:{"counter-reset":"line-number 0"}},[e("div",{class:"line-number"})])],-1)])),tab2:n(({value:a,isActive:t})=>s[29]||(s[29]=[e("div",{class:"language-bash line-numbers-mode","data-highlighter":"shiki","data-ext":"bash","data-title":"bash",style:{"background-color":"#1E1E1E",color:"#D4D4D4"}},[e("pre",{class:"shiki dark-plus vp-code"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"npm"),e("span",{style:{color:"#CE9178"}}," run"),e("span",{style:{color:"#CE9178"}}," docs:build")])])]),e("div",{class:"line-numbers","aria-hidden":"true",style:{"counter-reset":"line-number 0"}},[e("div",{class:"line-number"})])],-1)])),_:1}),e("p",null,[s[31]||(s[31]=l("You will see the generated static files in the ")),s[32]||(s[32]=e("code",null,"docs/.vuepress/dist",-1)),s[33]||(s[33]=l(" directory. You can check out ")),r(d,{to:"/guide/deployment.html"},{default:n(()=>s[30]||(s[30]=[l("deployment")])),_:1}),s[34]||(s[34]=l(" for how to deploy them."))]),s[45]||(s[45]=e("h2",{id:"learn-more-about-vuepress",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#learn-more-about-vuepress"},[e("span",null,"Learn More about VuePress")])],-1)),s[46]||(s[46]=e("p",null,"By now, you should have a basic but functional VuePress site. But you may still need to read the subsequent guide to learn more about VuePress.",-1)),e("p",null,[s[36]||(s[36]=l("Next step, learn more about the ")),r(d,{to:"/guide/configuration.html"},{default:n(()=>s[35]||(s[35]=[l("configuration")])),_:1}),s[37]||(s[37]=l("."))])])}const g=u(m,[["render",b],["__file","getting-started.html.vue"]]),D=JSON.parse(`{"path":"/guide/getting-started.html","title":"Getting Started","lang":"en-US","frontmatter":{"description":"Getting Started Warning VuePress v2 is currently in RC (Release Candidate) stage. It's ready to be used for building your site, but the config and API are not stable enough, whi...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/guide/getting-started.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/guide/getting-started.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Getting Started"}],["meta",{"property":"og:description","content":"Getting Started Warning VuePress v2 is currently in RC (Release Candidate) stage. It's ready to be used for building your site, but the config and API are not stable enough, whi..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-09-23T11:25:41.000Z"}],["meta",{"property":"article:modified_time","content":"2024-09-23T11:25:41.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Getting Started\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-09-23T11:25:41.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Try It Online","slug":"try-it-online","link":"#try-it-online","children":[]},{"level":2,"title":"Installation","slug":"installation","link":"#installation","children":[{"level":3,"title":"Prerequisites","slug":"prerequisites","link":"#prerequisites","children":[]},{"level":3,"title":"Project Setup","slug":"project-setup","link":"#project-setup","children":[]}]},{"level":2,"title":"Directory Structure","slug":"directory-structure","link":"#directory-structure","children":[]},{"level":2,"title":"Work with VuePress","slug":"work-with-vuepress","link":"#work-with-vuepress","children":[{"level":3,"title":"Start Dev Server","slug":"start-dev-server","link":"#start-dev-server","children":[]},{"level":3,"title":"Build Your Site","slug":"build-your-site","link":"#build-your-site","children":[]}]},{"level":2,"title":"Learn More about VuePress","slug":"learn-more-about-vuepress","link":"#learn-more-about-vuepress","children":[]}],"git":{"updatedTime":1727090741000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":5},{"name":"Mister-Hope","email":"mister-hope@outlook.com","commits":1},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"guide/getting-started.md"}`);export{g as comp,D as data};
diff --git a/assets/hero-BNkrhNQ6.js b/assets/hero-BNkrhNQ6.js
new file mode 100644
index 000000000..d90d6d577
--- /dev/null
+++ b/assets/hero-BNkrhNQ6.js
@@ -0,0 +1 @@
+const o="/images/hero.png";export{o as _};
diff --git a/assets/i18n.html-BxHmK_XU.js b/assets/i18n.html-BxHmK_XU.js
new file mode 100644
index 000000000..4d434d22b
--- /dev/null
+++ b/assets/i18n.html-BxHmK_XU.js
@@ -0,0 +1,39 @@
+import{_ as t,c as p,a,b as n,d as e,e as i,f as o,r,o as c}from"./app-9HBJsLu_.js";const d={},u={class:"hint-container tip"};function m(D,s){const l=r("RouteLink");return c(),p("div",null,[s[8]||(s[8]=a(`
`,4)),n("p",null,[s[1]||(s[1]=e("Then, specify the ")),s[2]||(s[2]=n("code",null,"locales",-1)),s[3]||(s[3]=e(" option in your ")),i(l,{to:"/guide/configuration.html#config-file"},{default:o(()=>s[0]||(s[0]=[e("config file")])),_:1}),s[4]||(s[4]=e(":"))]),s[9]||(s[9]=a(`
export default {
+ locales: {
+ // The key is the path for the locale to be nested under.
+ // As a special case, the default locale can use '/' as its path.
+ '/': {
+ lang: 'en-US',
+ title: 'VuePress',
+ description: 'Vue-powered Static Site Generator',
+ },
+ '/zh/': {
+ lang: 'zh-CN',
+ title: 'VuePress',
+ description: 'Vue 驱动的静态网站生成器',
+ },
+ },
+}
If a locale does not have a lang, title, description or head, VuePress will fallback to the root-level values. You can omit the root level config as long as they are provided in each locale.
VuePress does not restrict how themes provide multi-language support, so each theme may have different way to handle i18n, and some themes may not provide multi-language support at all. You'd better refer to the theme documentation for detailed guide.
If you are using default theme, the multi-language support is the same as above:
`,5))])}const y=t(d,[["render",m],["__file","i18n.html.vue"]]),h=JSON.parse('{"path":"/guide/i18n.html","title":"I18n","lang":"en-US","frontmatter":{"description":"I18n Site I18n Config To take advantage of multi-language support in VuePress, you first need to use the following file and directory structure: Then, specify the locales option...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/guide/i18n.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/guide/i18n.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"I18n"}],["meta",{"property":"og:description","content":"I18n Site I18n Config To take advantage of multi-language support in VuePress, you first need to use the following file and directory structure: Then, specify the locales option..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-02-01T10:07:08.000Z"}],["meta",{"property":"article:modified_time","content":"2024-02-01T10:07:08.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"I18n\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-02-01T10:07:08.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Site I18n Config","slug":"site-i18n-config","link":"#site-i18n-config","children":[]},{"level":2,"title":"Theme I18n Config","slug":"theme-i18n-config","link":"#theme-i18n-config","children":[]}],"git":{"updatedTime":1706782028000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":2},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":2}]},"autoDesc":true,"filePathRelative":"guide/i18n.md"}');export{y as comp,h as data};
diff --git a/assets/i18n.html-cok13upx.js b/assets/i18n.html-cok13upx.js
new file mode 100644
index 000000000..a3117cbdc
--- /dev/null
+++ b/assets/i18n.html-cok13upx.js
@@ -0,0 +1,39 @@
+import{_ as o,c as t,a,b as e,d as n,e as p,f as i,r,o as c}from"./app-9HBJsLu_.js";const d={},D={class:"hint-container tip"};function u(m,s){const l=r("RouteLink");return c(),t("div",null,[s[8]||(s[8]=a(`
We are introducing essential concepts in the Guide, but you may not know how to dig deeper.
We are listing APIs in the Reference, but you may not know how to take full advantage of them.
So here comes the Cookbook.
Each recipe will focus on one specific aspect, providing more detailed examples to show you the usages and possibilities of VuePress.
',5)]))}const d=o(r,[["render",i],["__file","index.html.vue"]]),l=JSON.parse(`{"path":"/advanced/cookbook/","title":"Introduction","lang":"en-US","frontmatter":{"description":"Introduction What's the Cookbook for? We are introducing essential concepts in the Guide, but you may not know how to dig deeper. We are listing APIs in the Reference, but you m...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/advanced/cookbook/"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/advanced/cookbook/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Introduction"}],["meta",{"property":"og:description","content":"Introduction What's the Cookbook for? We are introducing essential concepts in the Guide, but you may not know how to dig deeper. We are listing APIs in the Reference, but you m..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2023-12-03T14:44:37.000Z"}],["meta",{"property":"article:modified_time","content":"2023-12-03T14:44:37.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Introduction\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-12-03T14:44:37.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"What's the Cookbook for?","slug":"what-s-the-cookbook-for","link":"#what-s-the-cookbook-for","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"autoDesc":true,"filePathRelative":"advanced/cookbook/README.md"}`);export{d as comp,l as data};
diff --git a/assets/index.html-CoimyeYp.js b/assets/index.html-CoimyeYp.js
new file mode 100644
index 000000000..ec2b84a23
--- /dev/null
+++ b/assets/index.html-CoimyeYp.js
@@ -0,0 +1 @@
+import{_ as e,c as t,a,o as r}from"./app-9HBJsLu_.js";const n={};function c(s,o){return r(),t("div",null,o[0]||(o[0]=[a('
VuePress is a markdown-centered static site generator. You can write your content (documentations, blogs, etc.) in Markdown, then VuePress will help you to generate a static site to host them.
The purpose of creating VuePress was to support the documentation of Vue.js and its sub-projects, but now it has been helping a large amount of users to build their documentation, blogs, and other static sites.
A VuePress site is in fact a single-page application (SPA) powered by Vue and Vue Router.
Routes are generated according to the relative path of your markdown files. Each Markdown file is compiled into HTML with markdown-it and then processed as the template of a Vue component. This allows you to directly use Vue inside your Markdown files and is great when you need to embed dynamic content.
During development, we start a normal dev-server, and serve the VuePress site as a normal SPA. If you’ve used Vue before, you will notice the familiar development experience when you are writing and developing with VuePress.
During build, we create a server-rendered version of the VuePress site and render the corresponding HTML by virtually visiting each route. This approach is inspired by Nuxt's nuxt generate command and other projects like Gatsby.
Nuxt is an outstanding Vue SSR framework, and it is capable of doing what VuePress does. But Nuxt is designed for building applications, while VuePress is more lightweight and focused on content-centric static sites.
VitePress is the little brother of VuePress. It's also created and maintained by our Vue.js team. It's even more lightweight and faster than VuePress. However, as a tradeoff, it's more opinionated and less configurable. For example, it does not support plugins. But VitePress is powerful enough to make your content online if you don't need advanced customizations.
It might not be an appropriate comparison, but you can take VuePress and VitePress as Laravel and Lumen.
Both are great projects and also Vue-powered. Except they are both fully runtime-driven and therefore not SEO-friendly. If you don’t care for SEO and don’t want to mess with installing dependencies, these are still great choices.
Hexo has been serving the Vue 2.x docs well. The biggest problem is that its theming system is static and string-based - we want to take advantage of Vue for both the layout and the interactivity. Also, Hexo’s Markdown rendering isn’t the most flexible to configure.
We’ve been using GitBook for most of our sub project docs. The primary problem with GitBook is that its development reload performance is intolerable with a large amount of files. The default theme also has a pretty limiting navigation structure, and the theming system is, again, not Vue based. The team behind GitBook is also more focused on turning it into a commercial product rather than an open-source tool.
',20)]))}const l=t(a,[["render",i],["__file","introduction.html.vue"]]),c=JSON.parse('{"path":"/guide/introduction.html","title":"Introduction","lang":"en-US","frontmatter":{"description":"Introduction VuePress is a markdown-centered static site generator. You can write your content (documentations, blogs, etc.) in Markdown, then VuePress will help you to generate...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/guide/introduction.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/guide/introduction.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Introduction"}],["meta",{"property":"og:description","content":"Introduction VuePress is a markdown-centered static site generator. You can write your content (documentations, blogs, etc.) in Markdown, then VuePress will help you to generate..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2023-12-20T05:41:12.000Z"}],["meta",{"property":"article:modified_time","content":"2023-12-20T05:41:12.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Introduction\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-12-20T05:41:12.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"How It Works","slug":"how-it-works","link":"#how-it-works","children":[]},{"level":2,"title":"Why Not ...?","slug":"why-not","link":"#why-not","children":[{"level":3,"title":"Nuxt","slug":"nuxt","link":"#nuxt","children":[]},{"level":3,"title":"VitePress","slug":"vitepress","link":"#vitepress","children":[]},{"level":3,"title":"Docsify / Docute","slug":"docsify-docute","link":"#docsify-docute","children":[]},{"level":3,"title":"Hexo","slug":"hexo","link":"#hexo","children":[]},{"level":3,"title":"GitBook","slug":"gitbook","link":"#gitbook","children":[]}]}],"git":{"updatedTime":1703050872000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"autoDesc":true,"filePathRelative":"guide/introduction.md"}');export{l as comp,c as data};
diff --git a/assets/introduction.html-DV4zKs5N.js b/assets/introduction.html-DV4zKs5N.js
new file mode 100644
index 000000000..cd67a9522
--- /dev/null
+++ b/assets/introduction.html-DV4zKs5N.js
@@ -0,0 +1 @@
+import{_ as t,c as r,a as o,o as a}from"./app-9HBJsLu_.js";const n={};function s(i,e){return a(),r("div",null,e[0]||(e[0]=[o('
`,12))])}const v=l(d,[["render",y],["__file","making-a-theme-extendable.html.vue"]]),C=JSON.parse('{"path":"/zh/advanced/cookbook/making-a-theme-extendable.html","title":"开发一个可继承的主题","lang":"zh-CN","frontmatter":{"description":"开发一个可继承的主题 有时用户可能希望对一个主题进行一些小改动,但是又不想 Fork 并修改整个项目。 借助于 ,你可以让用户继承你的主题,允许用户对你的主题进行改动。 你肯定已经知道了如何 继承默认主题 。接下来我们将介绍如何让你的主题像默认主题一样被用户继承。 布局插槽 这种方式需要你来决定主题的哪些部分是可以被扩展的,它更适合用于一些常见的自定义...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuepress.vuejs.org/advanced/cookbook/making-a-theme-extendable.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/zh/advanced/cookbook/making-a-theme-extendable.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"开发一个可继承的主题"}],["meta",{"property":"og:description","content":"开发一个可继承的主题 有时用户可能希望对一个主题进行一些小改动,但是又不想 Fork 并修改整个项目。 借助于 ,你可以让用户继承你的主题,允许用户对你的主题进行改动。 你肯定已经知道了如何 继承默认主题 。接下来我们将介绍如何让你的主题像默认主题一样被用户继承。 布局插槽 这种方式需要你来决定主题的哪些部分是可以被扩展的,它更适合用于一些常见的自定义..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-08-31T07:59:53.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-31T07:59:53.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"开发一个可继承的主题\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-08-31T07:59:53.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"布局插槽","slug":"布局插槽","link":"#布局插槽","children":[]},{"level":2,"title":"组件别名","slug":"组件别名","link":"#组件别名","children":[]}],"git":{"updatedTime":1725091193000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":3},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"zh/advanced/cookbook/making-a-theme-extendable.md"}');export{v as comp,C as data};
diff --git a/assets/making-a-theme-extendable.html-H08JTuS9.js b/assets/making-a-theme-extendable.html-H08JTuS9.js
new file mode 100644
index 000000000..d9ddb11e6
--- /dev/null
+++ b/assets/making-a-theme-extendable.html-H08JTuS9.js
@@ -0,0 +1,30 @@
+import{_ as l,c as o,b as e,d as n,e as t,f as p,a as r,r as i,o as c}from"./app-9HBJsLu_.js";const d={};function m(y,s){const a=i("RouteLink");return c(),o("div",null,[s[3]||(s[3]=e("h1",{id:"making-a-theme-extendable",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#making-a-theme-extendable"},[e("span",null,"Making a Theme Extendable")])],-1)),s[4]||(s[4]=e("p",null,"Sometimes users might want make some minor changes to a theme, but they don't want to fork and modify the entire project.",-1)),e("p",null,[s[1]||(s[1]=n("With the help of ")),t(a,{to:"/reference/theme-api.html"},{default:p(()=>s[0]||(s[0]=[n("Theme API")])),_:1}),s[2]||(s[2]=n(", you can make your theme extendable, allowing users to make their own modifications easily."))]),s[5]||(s[5]=r(`
You must have known that how to extend default theme. Here we'll introduce how to make your own theme extendable like default theme.
This approach requires you to determine which parts of your theme could be extended. It is more suitable for those common customizations like page footer or header.
You just need to provide slots in your layouts, and tell users how to make use of them:
This approach requires you to consider which components of your theme should be replaceable, and you also need to split components into a suitable granularity.
First, set alias for replaceable components of you theme:
import type { Theme } from 'vuepress/core'
+import { getDirname } from 'vuepress/utils'
+
+const __dirname = getDirname(import.meta.url)
+
+export const fooTheme = (options): Theme => ({
+ name: 'vuepress-theme-foo',
+ alias: {
+ // set alias for replaceable components
+ '@theme/Navbar.vue': path.resolve(__dirname, 'components/Navbar.vue'),
+ '@theme/Sidebar.vue': path.resolve(__dirname, 'components/Sidebar.vue'),
+ },
+})
Next, use those components via aliases in your theme:
Then, users can replace specific components by overriding the alias when extending or using your theme.
`,12))])}const D=l(d,[["render",m],["__file","making-a-theme-extendable.html.vue"]]),h=JSON.parse(`{"path":"/advanced/cookbook/making-a-theme-extendable.html","title":"Making a Theme Extendable","lang":"en-US","frontmatter":{"description":"Making a Theme Extendable Sometimes users might want make some minor changes to a theme, but they don't want to fork and modify the entire project. With the help of , you can ma...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress.vuejs.org/zh/advanced/cookbook/making-a-theme-extendable.html"}],["meta",{"property":"og:url","content":"https://vuepress.vuejs.org/advanced/cookbook/making-a-theme-extendable.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Making a Theme Extendable"}],["meta",{"property":"og:description","content":"Making a Theme Extendable Sometimes users might want make some minor changes to a theme, but they don't want to fork and modify the entire project. With the help of , you can ma..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-08-31T07:59:53.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-31T07:59:53.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Making a Theme Extendable\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-08-31T07:59:53.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Layout Slots","slug":"layout-slots","link":"#layout-slots","children":[]},{"level":2,"title":"Component Aliases","slug":"component-aliases","link":"#component-aliases","children":[]}],"git":{"updatedTime":1725091193000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":3},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"autoDesc":true,"filePathRelative":"advanced/cookbook/making-a-theme-extendable.md"}`);export{D as comp,h as data};
diff --git a/assets/markdown-and-vue-sfc.html-CMOmEnQT.js b/assets/markdown-and-vue-sfc.html-CMOmEnQT.js
new file mode 100644
index 000000000..de3e83132
--- /dev/null
+++ b/assets/markdown-and-vue-sfc.html-CMOmEnQT.js
@@ -0,0 +1,30 @@
+import{_ as d,h as p,c as D,a as u,b as a,t,e as y,f as m,i as c,o as v}from"./app-9HBJsLu_.js";const C="Markdown 中的 Vue",g={__name:"markdown-and-vue-sfc.html",setup(r,{expose:s}){s();const l=(i,o)=>c("div",{class:"red-div"},o.slots.default()),n=p(0),e={RedDiv:l,msg:C,count:n,h:c,ref:p};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}};function b(r,s,l,n,e,i){return v(),D("div",null,[s[1]||(s[1]=u(`
If your site is deployed to a non-root URL, for example, https://foo.github.io/bar/, then the base should be set to '/bar/'. Obviously, your public files would be served like https://foo.github.io/bar/images/hero.png after deployment.
In most cases, you don't need to worry about the reference path of those public files, as VuePress will automatically handle base for you:
<!-- you don't need to prepend `/bar/` to `/images/hero.png` manually -->
+
+![VuePress Logo](/images/hero.png)
However, sometimes you may have some dynamical links referencing public files, especially when you are authoring a custom theme. In such case, the base could not be handled automatically. To help with that, VuePress provides a withBase helper to prepend base for you: