diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 5d126348..00000000 --- a/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 9f77618a..00000000 --- a/.gitattributes +++ /dev/null @@ -1,12 +0,0 @@ -* text eol=lf -*.txt text eol=crlf - -*.png binary -*.jpg binary -*.jpeg binary -*.ico binary -*.tff binary -*.woff binary -*.woff2 binary - -docs/.vuepress/** -linguist-documentation diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 400fc670..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Bug Report -description: Create a report to help us improve -title: '[Bug report] ' -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - type: textarea - id: bug-description - attributes: - label: Description - description: A clear and concise description of what the bug is. If applicable, add screenshots to help explain your problem. If you intend to submit a PR for this issue, tell us in the description. Thanks! - placeholder: Bug description - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 3aee83f9..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Question & Discussion - url: https://github.com/vuepress/docs/discussions - about: Please ask and answer questions here. diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml deleted file mode 100644 index 25e5232d..00000000 --- a/.github/workflows/check-docs.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: check-docs - -on: - push: - branches: - - main - pull_request: - branches: - - main - workflow_dispatch: - -jobs: - check-docs: - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - - macos-latest - node: - - 20 - - 22 - bundler: - - vite - - webpack - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Lint - run: pnpm lint - - - name: Build docs with ${{ matrix.bundler }} - run: pnpm docs:build - env: - DOCS_BUNDLER: ${{ matrix.bundler }} - - check-docs-result: - if: ${{ always() }} - name: check-docs result - runs-on: ubuntu-latest - needs: - - check-docs - steps: - - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} - run: exit 1 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 341b385d..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: docs - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - docs: - runs-on: ubuntu-latest - - env: - DOCS_GA_ID: G-CTB8FQ7VMW - NODE_VERSION: '22' - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build documentation site - run: pnpm docs:build - - - name: Deploy to GitHub Pages - uses: crazy-max/ghaction-github-pages@v4 - with: - repo: vuepress/vuepress.github.io - target_branch: main - build_dir: docs/.vuepress/dist - env: - GH_PAT: ${{ secrets.GH_PAGES_TOKEN }} diff --git a/.github/workflows/issue-commented.yml b/.github/workflows/issue-commented.yml deleted file mode 100644 index 1f09e871..00000000 --- a/.github/workflows/issue-commented.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: issue-commented - -on: - issue_comment: - types: - - created - -jobs: - issue-commented: - name: remove stale on commented - if: contains(github.event.issue.labels.*.name, 'stale') - runs-on: ubuntu-latest - steps: - - uses: actions-cool/issues-helper@v3 - with: - actions: 'remove-labels' - token: ${{ secrets.GITHUB_TOKEN }} - labels: 'stale' diff --git a/.github/workflows/issue-daily.yml b/.github/workflows/issue-daily.yml deleted file mode 100644 index 4b51b033..00000000 --- a/.github/workflows/issue-daily.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: issue-daily - -on: - schedule: - - cron: '0 0 * * *' - -jobs: - issue-label-stale: - name: label stale issues - runs-on: ubuntu-latest - steps: - - uses: actions-cool/issues-helper@v3 - with: - actions: 'check-inactive' - token: ${{ secrets.GITHUB_TOKEN }} - inactive-day: 15 - inactive-label: 'stale' - exclude-labels: 'bug, documentation, enhancement, feature, help wanted, need reproduction, need review, stale' - body: | - This issue is marked as `stale` because it has not had recent activity. Issues marked with `stale` will be closed if they have no activity within 7 days. - - issue-close-stale: - name: close stale issues - runs-on: ubuntu-latest - steps: - - uses: actions-cool/issues-helper@v3 - with: - actions: 'close-issues' - token: ${{ secrets.GITHUB_TOKEN }} - labels: 'stale' - inactive-day: 7 - - issue-close-need-reproduction: - name: close need-reproduction issues - runs-on: ubuntu-latest - steps: - - uses: actions-cool/issues-helper@v3 - with: - actions: 'close-issues' - token: ${{ secrets.GITHUB_TOKEN }} - labels: 'need reproduction' - inactive-day: 7 diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml deleted file mode 100644 index 227d6760..00000000 --- a/.github/workflows/issue-labeled.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: issue-labeled - -on: - issues: - types: [labeled] - -jobs: - issue-invalid: - name: close invalid issue - if: github.event.label.name == 'invalid' - runs-on: ubuntu-latest - steps: - - uses: actions-cool/issues-helper@v3 - with: - actions: 'close-issue, create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - body: | - Hello @${{ github.event.issue.user.login }}. This issue is marked as `invalid` and closed. Please follow the issue template. - - issue-need-reproduction: - name: need reproduction - if: github.event.label.name == 'need reproduction' - runs-on: ubuntu-latest - steps: - - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - body: | - Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [vuepress.vuejs.org/new](https://vuepress.vuejs.org/new). Issues marked with `need reproduction` will be closed if they have no activity within 7 days. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 91ed4fba..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: release - -on: - push: - tags: - - 'v*' - workflow_dispatch: - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Push to release branch - run: git push origin HEAD:release diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e3fdda76..00000000 --- a/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -# VuePress files -docs/.vuepress/.temp/ -docs/.vuepress/.cache/ -docs/.vuepress/dist/ - -# Node modules -node_modules/ - -# MacOS Desktop Services Store -.DS_Store - -# Log files -*.log diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100755 index cfe75101..00000000 --- a/.husky/commit-msg +++ /dev/null @@ -1 +0,0 @@ -pnpm commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 74821141..00000000 --- a/.husky/pre-commit +++ /dev/null @@ -1 +0,0 @@ -pnpm nano-staged diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 88deb460..00000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -message="build: version %s" diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index bd5535a6..00000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -pnpm-lock.yaml diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index adc12201..00000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "recommendations": [ - "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode", - "vue.volar" - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 611c9559..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true, - "editor.insertSpaces": true, - "editor.tabSize": 2, - "files.encoding": "utf8", - "files.eol": "\n", - "files.trimFinalNewlines": true, - "files.trimTrailingWhitespace": true, - "[markdown]": { - "files.trimTrailingWhitespace": false - }, - "typescript.tsdk": "node_modules/typescript/lib", - "eslint.validate": [ - "javascript", - "javascriptreact", - "typescript", - "typescriptreact", - "vue" - ], - "cSpell.words": [ - "bumpp", - "composables", - "devtool", - "docsearch", - "envinfo", - "esbuild", - "frontmatter", - "globby", - "gtag", - "mdit", - "nprogress", - "prefetch", - "preload", - "prismjs", - "shiki", - "shikiji", - "slugify", - "unmount", - "vuejs", - "vuepress", - "vueuse", - "zoomable" - ] -} diff --git a/404.html b/404.html new file mode 100644 index 00000000..6a541f36 --- /dev/null +++ b/404.html @@ -0,0 +1,40 @@ + + + + + + + + VuePress + + + + + + +

404

Page not found

Looks like we've got some broken links.

+ + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 7a01c18b..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,15 +0,0 @@ -# VuePress Documentation Contributing Guide - -## Overview - -VuePress documentation is powered by VuePress itself, which is built from the source code of this repository. - -All the markdown source files are placed in `docs` directory. We are maintaining two translations: - -- English (en-US) in `/` path -- Chinese (zh-CN) in `/zh/` path - -We have two different deployments: - -- Release deployment powered by [Netlify](https://www.netlify.com). This deployment is built from the latest released version, so users will not see unreleased changes. The domain name is [https://vuepress.vuejs.org](https://vuepress.vuejs.org). -- Developer deployment powered by [GitHub Pages](https://pages.github.com). This deployment is built from the latest commit, so developers could preview the latest changes. The domain name is [https://vuepress.github.io](https://vuepress.github.io). diff --git a/CONTRIBUTING_zh.md b/CONTRIBUTING_zh.md deleted file mode 100644 index 58bafe6a..00000000 --- a/CONTRIBUTING_zh.md +++ /dev/null @@ -1,15 +0,0 @@ -# VuePress 文档贡献指南 - -## 概览 - -VuePress 的文档是由 VuePress 自己驱动的,是由该仓库中的源码构建而来。 - -所有的 Markdown 源文件都放置在 `docs` 目录下。我们维护了两种翻译: - -- 英语 (en-US) 在 `/` 路径下 -- 中文 (zh-CN) 在 `/zh/` 路径下 - -我们部署了两套站点: - -- 在 [Netlify](https://www.netlify.com) 部署的 Release 版本。该站点是从最新发布的版本中构建而来,因此用户不会看到未发布的改动。域名为 [https://vuepress.vuejs.org](https://vuepress.vuejs.org)。 -- 在 [GitHub Pages](https://pages.github.com) 部署的 Developer 版本。该站点是从最新的提交中构建而来,因此开发者可以预览最新的改动。域名为 [https://vuepress.github.io](https://vuepress.github.io)。 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 44387d62..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018-present, VuePress Community - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 551f0688..00000000 --- a/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# VuePress Documentation - -[![github check-docs](https://github.com/vuepress/docs/workflows/check-docs/badge.svg)](https://github.com/vuepress/docs/actions/workflows/check-docs.yml) -[![github docs](https://github.com/vuepress/docs/workflows/docs/badge.svg)](https://github.com/vuepress/docs/actions/workflows/docs.yml) -[![license](https://badgen.net/github/license/vuepress/docs)](https://github.com/vuepress/docs/blob/main/LICENSE) - -VuePress documentation repository. - -## Deployments - -- Release deployment: -- Developer deployment: - -## License - -[MIT](https://github.com/vuepress/docs/blob/main/LICENSE) diff --git a/advanced/architecture.html b/advanced/architecture.html new file mode 100644 index 00000000..37bebb6d --- /dev/null +++ b/advanced/architecture.html @@ -0,0 +1,40 @@ + + + + + + + + Architecture | VuePress + + + + + + +

Architecture

About 1 min

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, routes, etc.
  • Bundler will handle Client App together with the temp files, just like a common Vue SPA.

As a developer, you must be aware of that VuePress has two main parts: Node App and Client App, which is important when developing plugins and themes:

  • The entry file of a plugin or a theme will be loaded in Node App.
  • Client files will be loaded in Client App, which will be handled by bundler. For example, components, client config files, etc.

Core Process and Hooks

vuepress-core-process

The above figure shows the core process of VuePress Node App and the hooks of Plugin API:

  • In the init stage:
    • Theme and plugins will be loaded. That means all the plugins should be used before initialization.
    • As we are using markdown-it to parse the markdown file, so we need to create markdown-it instance before loading pages:
    • Page files will be loaded:
  • In the prepare stage:
    • Temp files will be generated, so all hooks related to client files will be processed here.
  • In the dev / build stage:
    • Bundler will be resolved:
      • extendsBundlerOptions hook will be processed to create bundler configuration.
      • alias hook and define hook would be used in bundler configuration, so they will be processed here.
+ + + diff --git a/advanced/cookbook/adding-extra-pages.html b/advanced/cookbook/adding-extra-pages.html new file mode 100644 index 00000000..d0bb8da8 --- /dev/null +++ b/advanced/cookbook/adding-extra-pages.html @@ -0,0 +1,66 @@ + + + + + + + + Adding Extra Pages | VuePress + + + + + + +

Adding Extra Pages

Less than 1 minute

Adding Extra Pages

Sometimes you might want to add some extra pages without creating a markdown file in the source directory.

With the help of Plugin API and Node API, we can do that with ease.

Add a Default Homepage

As a theme author, you may not require users to create a /README.md file as the homepage, but you want to provide a default one:

import { createPage } from "@vuepress/core";
+
+export default {
+  // all pages have been loaded after initialization
+  async onInitialized(app) {
+    // if the homepage does not exist
+    if (app.pages.every((page) => page.path !== "/")) {
+      // create a homepage
+      const homepage = await createPage(app, {
+        path: "/",
+        // set frontmatter
+        frontmatter: {
+          layout: "Layout",
+        },
+        // set markdown content
+        content: `\
+# Welcome to ${app.options.title}
+
+This is the default homepage
+`,
+      });
+      // add it to `app.pages`
+      app.pages.push(homepage);
+    }
+  },
+};
+
+ + + diff --git a/advanced/cookbook/index.html b/advanced/cookbook/index.html new file mode 100644 index 00000000..ee69ceac --- /dev/null +++ b/advanced/cookbook/index.html @@ -0,0 +1,40 @@ + + + + + + + + Introduction | VuePress + + + + + + +

Introduction

Less than 1 minute

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 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.

+ + + diff --git a/advanced/cookbook/making-a-theme-extendable.html b/advanced/cookbook/making-a-theme-extendable.html new file mode 100644 index 00000000..669270b5 --- /dev/null +++ b/advanced/cookbook/making-a-theme-extendable.html @@ -0,0 +1,74 @@ + + + + + + + + Making a Theme Extendable | VuePress + + + + + + +

Making a Theme Extendable

Less than 1 minute

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 Theme API, you can make your theme extendable, allowing users to make their own modifications easily.

You must have known that how to extend default theme. Here we'll introduce how to make your own theme extendable like default theme.

Layout Slots

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:

<template>
+  <div class="my-theme-layout">
+    <slot name="page-header" />
+    <Content />
+    <slot name="page-footer" />
+  </div>
+</template>
+

Component Aliases

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 => {
+  return {
+    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:

<script setup lang="ts">
+import Navbar from "@theme/Navbar.vue";
+import Sidebar from "@theme/Sidebar.vue";
+</script>
+
+<template>
+  <div class="my-theme-layout">
+    <Navbar />
+    <Sidebar />
+    <Content />
+  </div>
+</template>
+

Then, users can replace specific components by overriding the alias when extending or using your theme.

+ + + diff --git a/advanced/cookbook/markdown-and-vue-sfc.html b/advanced/cookbook/markdown-and-vue-sfc.html new file mode 100644 index 00000000..74aa8f6a --- /dev/null +++ b/advanced/cookbook/markdown-and-vue-sfc.html @@ -0,0 +1,70 @@ + + + + + + + + Markdown and Vue SFC | VuePress + + + + + + +

Markdown and Vue SFC

Less than 1 minute

Markdown and Vue SFC

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.

Note

As Vue SFC can contain only one <script> element, you should avoid using more than one <script> in VuePress markdown.

Here comes an example:

Input

_Hello, {{ msg }}_
+
+<RedDiv>
+
+_Current count is: {{ count }}_
+
+</RedDiv>
+
+<button @click="count++">Click Me!</button>
+
+<script setup>
+import { h, ref } from "vue";
+
+const RedDiv = (_, ctx) =>
+  h(
+    "div",
+    {
+      class: "red-div",
+    },
+    ctx.slots.default()
+  );
+const msg = "Vue in Markdown";
+const count = ref(0);
+</script>
+
+<style>
+.red-div {
+  color: red;
+}
+</style>
+

Output

Hello, Vue in Markdown

Current count is: 0

+ + + diff --git a/advanced/cookbook/passing-data-to-client-code.html b/advanced/cookbook/passing-data-to-client-code.html new file mode 100644 index 00000000..31192764 --- /dev/null +++ b/advanced/cookbook/passing-data-to-client-code.html @@ -0,0 +1,65 @@ + + + + + + + + Passing Data to Client Code | VuePress + + + + + + +

Passing Data to Client Code

Less than 1 minute

Passing Data to Client Code

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.

Use define Hook

Plugin API provides a define hook to define global constants for client code. You can make use of it to pass data to client.

First, define some constants in define hook:

export default (options) => ({
+  define: {
+    __FOO__: options.foo || "str",
+    __OBJ__: {
+      bar: options.bar || 123,
+    },
+  },
+});
+

Then use them in client code directly:

const foo = __FOO__;
+const obj = __OBJ__;
+

If you are using TypeScript in client code, you may need to declare the types of the global constants manually:

declare const __FOO__: string;
+declare const __OBJ__: { bar: number };
+

Write and Load Temp Files

If you need to achieve some more complex features, you can write temp files and load them dynamically in client code.

First, write a temp file foo.js, which will be generated in the temp directory:

export default (options) => ({
+  async onPrepared(app) {
+    // write temp file
+    await app.writeTemp(
+      "foo.js",
+      `export const foo = ${JSON.stringify(options.foo)}`
+    );
+  },
+});
+

Then, load the temp file via @temp alias in client code:

import { foo } from "@temp/foo";
+

If you are using TypeScript in client code, you may need to declare the type of the temp module manually:

declare module "@temp/foo" {
+  export const foo: string;
+}
+
+ + + diff --git a/advanced/cookbook/usage-of-client-config.html b/advanced/cookbook/usage-of-client-config.html new file mode 100644 index 00000000..fc117b03 --- /dev/null +++ b/advanced/cookbook/usage-of-client-config.html @@ -0,0 +1,126 @@ + + + + + + + + Usage of Client Config | VuePress + + + + + + +

Usage of Client Config

About 2 min

Usage of Client Config

You can make use of the client config file directly in your project, or specify the file path in your plugin or theme via clientConfigFile hook:

import { getDirname, path } from "@vuepress/utils";
+
+const __dirname = getDirname(import.meta.url);
+
+const pluginOrTheme = {
+  clientConfigFile: path.resolve(__dirname, "./path/to/clientConfig.ts"),
+};
+

Inside the client config file, @vuepress/client package provides a helper function defineClientConfig to help you define the client config:

import { defineClientConfig } from "@vuepress/client";
+
+export default defineClientConfig({
+  enhance({ app, router, siteData }) {},
+  setup() {},
+  layouts: {},
+  rootComponents: [],
+});
+

enhance

The enhance function could be either synchronous or asynchronous. It accepts a context param with following properties:

The enhance function will be invoked after the client app is created. It's possible to implement any enhancements to the Vue application.

Register Vue Components

You can register global Vue components via the app.componentopen in new window method:

import { defineClientConfig } from "@vuepress/client";
+import MyComponent from "./MyComponent.vue";
+
+export default defineClientConfig({
+  enhance({ app }) {
+    app.component("MyComponent", MyComponent);
+  },
+});
+

Use Non-SSR-Friendly Features

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.

import { defineClientConfig } from "@vuepress/client";
+
+export default defineClientConfig({
+  async enhance() {
+    if (!__VUEPRESS_SSR__) {
+      const nonSsrFriendlyModule = await import("non-ssr-friendly-module");
+      // ...
+    }
+  },
+});
+

Use Router Methods

You can make use of the Router Methodsopen in new window that provided by vue-router. For example, add navigation guard:

import { defineClientConfig } from "@vuepress/client";
+
+export default defineClientConfig({
+  enhance({ router }) {
+    router.beforeEach((to) => {
+      console.log("before navigation");
+    });
+
+    router.afterEach((to) => {
+      console.log("after navigation");
+    });
+  },
+});
+

Note

It's not recommended to use addRoute method to add dynamic routes here, because those routes will NOT be pre-rendered in build mode.

But you can still do that if you understand the drawback.

setup

The setup function would be invoked inside the setupopen in new window hook of the client vue app.

Use Composition API

You can take the setup function as part of the setupopen in new window hook of the root component. Thus, all composition APIs are available here.

import { defineClientConfig } from "@vuepress/client";
+import { provide, ref } from "vue";
+import { useRoute, useRouter } from "vue-router";
+
+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);
+  },
+});
+

Use Non-SSR-Friendly Features

In the setup function, the __VUEPRESS_SSR__ flag is also available.

Another way to use non-ssr-friendly features is to put them inside the onMountedopen in new window hook:

import { defineClientConfig } from "@vuepress/client";
+import { onMounted } from "vue";
+
+export default defineClientConfig({
+  setup() {
+    onMounted(() => {
+      // use DOM API after mounted
+      document.querySelector("#app");
+    });
+  },
+});
+

layouts

The layouts options is to set layout components. After layout components are registered here, users can use it via layout frontmatter.

import { defineClientConfig } from "@vuepress/client";
+import MyLayout from "./layouts/MyLayout.vue";
+
+export default defineClientConfig({
+  layouts: {
+    MyLayout,
+  },
+});
+

rootComponents

The rootComponents is a components array to be placed directly into the root node of the client vue app.

Typical usage of this option is to put some global UI components, like global popup or so:

import { defineClientConfig } from "@vuepress/client";
+import GlobalPopup from "./components/GlobalPopup.vue";
+
+export default defineClientConfig({
+  rootComponents: [GlobalPopup],
+});
+
+ + + diff --git a/advanced/index.html b/advanced/index.html new file mode 100644 index 00000000..94a33bb4 --- /dev/null +++ b/advanced/index.html @@ -0,0 +1,40 @@ + + + + + + + + Advanced | VuePress + + + + + + + + + + diff --git a/advanced/plugin.html b/advanced/plugin.html new file mode 100644 index 00000000..c50e1441 --- /dev/null +++ b/advanced/plugin.html @@ -0,0 +1,69 @@ + + + + + + + + Writing a Plugin | VuePress + + + + + + +

Writing a Plugin

Less than 1 minute

Writing a Plugin

Tips

Before reading this guide, you'd better learn the VuePress architecture first.

Create a Plugin

A plugin should be a plain JavaScript object that satisfies the Plugin API, which is called a Plugin Object:

const fooPlugin = {
+  name: "vuepress-plugin-foo",
+  // ...
+};
+

A plugin could also be a function that receives the app instance as the param and returns a Plugin Object, which is called a Plugin Function:

const barPlugin = (app) => {
+  return {
+    name: "vuepress-plugin-bar",
+    // ...
+  };
+};
+

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:

const fooPlugin = (options) => {
+  return {
+    name: "vuepress-plugin-foo",
+    // ...
+  };
+};
+
+const barPlugin = (options) => {
+  return (app) => {
+    return {
+      name: "vuepress-plugin-bar",
+      // ...
+    };
+  };
+};
+

Publish to NPM

After creating a plugin, you should follow some conventions in the package.jsonopen in new window file before publishing it to NPM:

{
+  "name": "vuepress-plugin-foo",
+  "keywords": ["vuepress-plugin"]
+}
+
  • 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.
+ + + diff --git a/advanced/theme.html b/advanced/theme.html new file mode 100644 index 00000000..7c7f50cb --- /dev/null +++ b/advanced/theme.html @@ -0,0 +1,97 @@ + + + + + + + + Writing a Theme | VuePress + + + + + + +

Writing a Theme

About 1 min

Writing a Theme

Tips

Before reading this guide, you'd better learn the guide of Writing a Plugin first.

Create a Theme

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
+  return {
+    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 from `@vuepress/client` will be used
+    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
+  return (app) => {
+    return {
+      name: "vuepress-theme-bar",
+      // ...
+    };
+  };
+};
+

Then, create theme's client config file client.js :

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:

<template>
+  <div>
+    <Content />
+  </div>
+</template>
+

The NotFound layout will be used for the 404.html page:

<template>
+  <div>404 Not Found</div>
+</template>
+

You can provide more layouts, and users can change layout via layout frontmatter.

Publish to NPM

Also, there are some conventions for theme in package.jsonopen in new window:

{
+  "name": "vuepress-theme-foo",
+  "keywords": ["vuepress-theme"]
+}
+
  • 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-15746044.js b/assets/404.html-15746044.js new file mode 100644 index 00000000..2e54f319 --- /dev/null +++ b/assets/404.html-15746044.js @@ -0,0 +1 @@ +import{_ as e,W as t,X as _}from"./framework-46b0e263.js";const c={};function r(n,o){return t(),_("div")}const a=e(c,[["render",r],["__file","404.html.vue"]]);export{a as default}; diff --git a/assets/404.html-c1720e4d.js b/assets/404.html-c1720e4d.js new file mode 100644 index 00000000..c4855cee --- /dev/null +++ b/assets/404.html-c1720e4d.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-3706649a","path":"/404.html","title":"","lang":"en-US","frontmatter":{"layout":"NotFound","description":"","head":[["meta",{"property":"og:url","content":"https://vuejs.press/404.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["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\\":\\"\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0,"words":0},"filePathRelative":null,"autoDesc":true}');export{t as data}; diff --git a/assets/active-header-links.html-7f2d6108.js b/assets/active-header-links.html-7f2d6108.js new file mode 100644 index 00000000..918af30b --- /dev/null +++ b/assets/active-header-links.html-7f2d6108.js @@ -0,0 +1,11 @@ +import{_ as c,W as d,X as p,Y as a,$ as e,a0 as n,Z as o,a1 as i,D as s}from"./framework-46b0e263.js";const h={},u=e("h1",{id:"active-header-links",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#active-header-links","aria-hidden":"true"},"#"),n(" active-header-links")],-1),m=i(`

This plugin will listen to page scroll event. When the page scrolls to a certain header anchor, this plugin will change the route hash to that header anchor if there is a corresponding header link.

This plugin is mainly used to develop themes, and has been integrated into the default theme. You won't need to use it directly in most cases.

Usage

npm i -D @vuepress/plugin-active-header-links@next
+
import { activeHeaderLinksPlugin } from "@vuepress/plugin-active-header-links";
+
+export default {
+  plugins: [
+    activeHeaderLinksPlugin({
+      // options
+    }),
+  ],
+};
+

Options

headerLinkSelector

headerAnchorSelector

`,9),k=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string")])],-1),v=e("li",null,[e("p",null,[n("Default: "),e("code",null,"'.header-anchor'")])],-1),f=e("p",null,"Details:",-1),g=e("p",null,[n("Selector of "),e("em",null,"header anchor"),n(".")],-1),_=e("code",null,"permalinkClass",-1),b={href:"https://github.com/valeriangalliat/markdown-it-anchor#readme",target:"_blank",rel:"noopener noreferrer"},y=e("p",null,"Also see:",-1),x=i('

delay

offset

',4);function w(D,T){const l=s("NpmBadge"),r=s("ExternalLinkIcon"),t=s("RouterLink");return d(),p("div",null,[u,a(l,{package:"@vuepress/plugin-active-header-links"}),m,e("ul",null,[k,v,e("li",null,[f,g,e("p",null,[n("You don't need to specify this option unless you have changed the "),_,n(" option of "),e("a",b,[n("markdown-it-anchor"),a(r)]),n(" via "),a(t,{to:"/reference/config.html#markdown-anchor"},{default:o(()=>[n("markdown.anchor")]),_:1}),n(".")])]),e("li",null,[y,e("ul",null,[e("li",null,[a(t,{to:"/guide/markdown.html#header-anchors"},{default:o(()=>[n("Guide > Markdown > Syntax Extensions > Header Anchors")]),_:1})])])])]),x])}const N=c(h,[["render",w],["__file","active-header-links.html.vue"]]);export{N as default}; diff --git a/assets/active-header-links.html-91a347f7.js b/assets/active-header-links.html-91a347f7.js new file mode 100644 index 00000000..918409e2 --- /dev/null +++ b/assets/active-header-links.html-91a347f7.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3ba02eb8","path":"/reference/plugin/active-header-links.html","title":"active-header-links","lang":"en-US","frontmatter":{"description":"This plugin will listen to page scroll event. When the page scrolls to a certain header anchor, this plugin will change the route hash to that header anchor if there is a corres...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/plugin/active-header-links.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/plugin/active-header-links.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"active-header-links"}],["meta",{"property":"og:description","content":"This plugin will listen to page scroll event. When the page scrolls to a certain header anchor, this plugin will change the route hash to that header anchor if there is a corres..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"active-header-links\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"headerLinkSelector","slug":"headerlinkselector","link":"#headerlinkselector","children":[]},{"level":3,"title":"headerAnchorSelector","slug":"headeranchorselector","link":"#headeranchorselector","children":[]},{"level":3,"title":"delay","slug":"delay","link":"#delay","children":[]},{"level":3,"title":"offset","slug":"offset","link":"#offset","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.83,"words":248},"filePathRelative":"reference/plugin/active-header-links.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/active-header-links.html-a98aa233.js b/assets/active-header-links.html-a98aa233.js new file mode 100644 index 00000000..f3c5697f --- /dev/null +++ b/assets/active-header-links.html-a98aa233.js @@ -0,0 +1 @@ +const e=JSON.parse(`{"key":"v-231b4d69","path":"/zh/reference/plugin/active-header-links.html","title":"active-header-links","lang":"zh-CN","frontmatter":{"description":"该插件会监听页面滚动事件。当页面滚动至某个 标题锚点 后,如果存在对应的 标题链接 ,那么该插件会将路由 Hash 更改为该 标题锚点 。 该插件主要用于开发主题,并且已经集成到默认主题中。大部分情况下你不需要直接使用它。 使用方法 配置项 headerLinkSelector 类型: string; 默认值: 'a.sidebar-item'; 详情...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/plugin/active-header-links.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/plugin/active-header-links.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"active-header-links"}],["meta",{"property":"og:description","content":"该插件会监听页面滚动事件。当页面滚动至某个 标题锚点 后,如果存在对应的 标题链接 ,那么该插件会将路由 Hash 更改为该 标题锚点 。 该插件主要用于开发主题,并且已经集成到默认主题中。大部分情况下你不需要直接使用它。 使用方法 配置项 headerLinkSelector 类型: string; 默认值: 'a.sidebar-item'; 详情..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"active-header-links\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"headerLinkSelector","slug":"headerlinkselector","link":"#headerlinkselector","children":[]},{"level":3,"title":"headerAnchorSelector","slug":"headeranchorselector","link":"#headeranchorselector","children":[]},{"level":3,"title":"delay","slug":"delay","link":"#delay","children":[]},{"level":3,"title":"offset","slug":"offset","link":"#offset","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.25,"words":374},"filePathRelative":"zh/reference/plugin/active-header-links.md","localizedDate":"2023年2月22日","autoDesc":true}`);export{e as data}; diff --git a/assets/active-header-links.html-bb25d530.js b/assets/active-header-links.html-bb25d530.js new file mode 100644 index 00000000..09521555 --- /dev/null +++ b/assets/active-header-links.html-bb25d530.js @@ -0,0 +1,11 @@ +import{_ as r,W as d,X as p,Y as a,$ as e,a0 as n,Z as l,a1 as t,D as s}from"./framework-46b0e263.js";const u={},h=e("h1",{id:"active-header-links",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#active-header-links","aria-hidden":"true"},"#"),n(" active-header-links")],-1),m=t(`

该插件会监听页面滚动事件。当页面滚动至某个 标题锚点 后,如果存在对应的 标题链接 ,那么该插件会将路由 Hash 更改为该 标题锚点

该插件主要用于开发主题,并且已经集成到默认主题中。大部分情况下你不需要直接使用它。

使用方法

npm i -D @vuepress/plugin-active-header-links@next
+
import { activeHeaderLinksPlugin } from "@vuepress/plugin-active-header-links";
+
+export default {
+  plugins: [
+    activeHeaderLinksPlugin({
+      // 配置项
+    }),
+  ],
+};
+

配置项

headerLinkSelector

headerAnchorSelector

`,9),k=e("li",null,[e("p",null,[n("类型: "),e("code",null,"string")])],-1),v=e("li",null,[e("p",null,[n("默认值: "),e("code",null,"'.header-anchor'")])],-1),_=e("p",null,"详情:",-1),f=e("p",null,[e("em",null,"标题锚点"),n(" 的选择器。")],-1),b={href:"https://github.com/valeriangalliat/markdown-it-anchor#readme",target:"_blank",rel:"noopener noreferrer"},g=e("code",null,"permalinkClass",-1),x=e("p",null,"参考:",-1),w=t('

delay

offset

',4);function y(L,E){const o=s("NpmBadge"),i=s("RouterLink"),c=s("ExternalLinkIcon");return d(),p("div",null,[h,a(o,{package:"@vuepress/plugin-active-header-links"}),m,e("ul",null,[k,v,e("li",null,[_,f,e("p",null,[n("你通常不需要设置该选项,除非你通过 "),a(i,{to:"/zh/reference/config.html#markdown-anchor"},{default:l(()=>[n("markdown.anchor")]),_:1}),n(" 修改了 "),e("a",b,[n("markdown-it-anchor"),a(c)]),n(" 的 "),g,n(" 选项。")])]),e("li",null,[x,e("ul",null,[e("li",null,[a(i,{to:"/zh/guide/markdown.html#%E6%A0%87%E9%A2%98%E9%94%9A%E7%82%B9"},{default:l(()=>[n("指南 > Markdown > 语法扩展 > 标题锚点")]),_:1})])])])]),w])}const N=r(u,[["render",y],["__file","active-header-links.html.vue"]]);export{N as default}; diff --git a/assets/adding-extra-pages.html-7488d932.js b/assets/adding-extra-pages.html-7488d932.js new file mode 100644 index 00000000..0967ccdb --- /dev/null +++ b/assets/adding-extra-pages.html-7488d932.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5b617736","path":"/zh/advanced/cookbook/adding-extra-pages.html","title":"添加额外页面","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:circle-plus","description":"有时你可能希望在不创建 Markdown 文件的情况下添加一些额外的页面。 我们可以借助于 插件 API (../../reference/plugin-api.md) 和 Node API (../../reference/node-api.md) 来轻松实现。 添加默认的主页 作为一个主题作者,你可能不想要求用户必须创建一个 /README.md ...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/advanced/cookbook/adding-extra-pages.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/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 文件的情况下添加一些额外的页面。 我们可以借助于 插件 API (../../reference/plugin-api.md) 和 Node API (../../reference/node-api.md) 来轻松实现。 添加默认的主页 作为一个主题作者,你可能不想要求用户必须创建一个 /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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"添加额外页面\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"添加默认的主页","slug":"添加默认的主页","link":"#添加默认的主页","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.68,"words":204},"filePathRelative":"zh/advanced/cookbook/adding-extra-pages.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/adding-extra-pages.html-85fbc8d4.js b/assets/adding-extra-pages.html-85fbc8d4.js new file mode 100644 index 00000000..093d24a5 --- /dev/null +++ b/assets/adding-extra-pages.html-85fbc8d4.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2a57b498","path":"/advanced/cookbook/adding-extra-pages.html","title":"Adding Extra Pages","lang":"en-US","frontmatter":{"icon":"fa6-solid:circle-plus","description":"Sometimes you might want to add some extra pages without creating a markdown file in the source directory. With the help of Plugin API (../../reference/plugin-api.md) and Node A...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/advanced/cookbook/adding-extra-pages.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/advanced/cookbook/adding-extra-pages.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Adding Extra Pages"}],["meta",{"property":"og:description","content":"Sometimes you might want to add some extra pages without creating a markdown file in the source directory. With the help of Plugin API (../../reference/plugin-api.md) and Node A..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Adding Extra Pages\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Add a Default Homepage","slug":"add-a-default-homepage","link":"#add-a-default-homepage","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.49,"words":146},"filePathRelative":"advanced/cookbook/adding-extra-pages.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/adding-extra-pages.html-9002b717.js b/assets/adding-extra-pages.html-9002b717.js new file mode 100644 index 00000000..0f1c53a1 --- /dev/null +++ b/assets/adding-extra-pages.html-9002b717.js @@ -0,0 +1,27 @@ +import{_ as p,W as o,X as i,$ as a,a0 as n,Y as t,Z as e,a1 as c,D as l}from"./framework-46b0e263.js";const u={},d=a("h1",{id:"adding-extra-pages",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#adding-extra-pages","aria-hidden":"true"},"#"),n(" Adding Extra Pages")],-1),r=a("p",null,"Sometimes you might want to add some extra pages without creating a markdown file in the source directory.",-1),k=c(`

Add a Default Homepage

As a theme author, you may not require users to create a /README.md file as the homepage, but you want to provide a default one:

import { createPage } from "@vuepress/core";
+
+export default {
+  // all pages have been loaded after initialization
+  async onInitialized(app) {
+    // if the homepage does not exist
+    if (app.pages.every((page) => page.path !== "/")) {
+      // create a homepage
+      const homepage = await createPage(app, {
+        path: "/",
+        // set frontmatter
+        frontmatter: {
+          layout: "Layout",
+        },
+        // set markdown content
+        content: \`\\
+# Welcome to \${app.options.title}
+
+This is the default homepage
+\`,
+      });
+      // add it to \`app.pages\`
+      app.pages.push(homepage);
+    }
+  },
+};
+
`,3);function m(v,h){const s=l("RouterLink");return o(),i("div",null,[d,r,a("p",null,[n("With the help of "),t(s,{to:"/reference/plugin-api.html"},{default:e(()=>[n("Plugin API")]),_:1}),n(" and "),t(s,{to:"/reference/node-api.html"},{default:e(()=>[n("Node API")]),_:1}),n(", we can do that with ease.")]),k])}const b=p(u,[["render",m],["__file","adding-extra-pages.html.vue"]]);export{b as default}; diff --git a/assets/adding-extra-pages.html-d579a0d0.js b/assets/adding-extra-pages.html-d579a0d0.js new file mode 100644 index 00000000..e78d5b6b --- /dev/null +++ b/assets/adding-extra-pages.html-d579a0d0.js @@ -0,0 +1,27 @@ +import{_ as p,W as o,X as c,$ as s,a0 as n,Y as t,Z as e,a1 as i,D as l}from"./framework-46b0e263.js";const u={},r=s("h1",{id:"添加额外页面",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#添加额外页面","aria-hidden":"true"},"#"),n(" 添加额外页面")],-1),d=s("p",null,"有时你可能希望在不创建 Markdown 文件的情况下添加一些额外的页面。",-1),k=i(`

添加默认的主页

作为一个主题作者,你可能不想要求用户必须创建一个 /README.md 文件来作为主页,但是你希望提供一个默认的主页:

import { createPage } from "@vuepress/core";
+
+export default {
+  // 初始化之后,所有的页面已经加载完毕
+  async onInitialized(app) {
+    // 如果主页不存在
+    if (app.pages.every((page) => page.path !== "/")) {
+      // 创建一个主页
+      const homepage = await createPage(app, {
+        path: "/",
+        // 设置 frontmatter
+        frontmatter: {
+          layout: "Layout",
+        },
+        // 设置 markdown 内容
+        content: \`\\
+# 欢迎来到 \${app.options.title}
+
+这是默认主页
+\`,
+      });
+      // 把它添加到 \`app.pages\`
+      app.pages.push(homepage);
+    }
+  },
+};
+
`,3);function m(v,b){const a=l("RouterLink");return o(),c("div",null,[r,d,s("p",null,[n("我们可以借助于 "),t(a,{to:"/zh/reference/plugin-api.html"},{default:e(()=>[n("插件 API")]),_:1}),n(" 和 "),t(a,{to:"/zh/reference/node-api.html"},{default:e(()=>[n("Node API")]),_:1}),n(" 来轻松实现。")]),k])}const h=p(u,[["render",m],["__file","adding-extra-pages.html.vue"]]);export{h as default}; diff --git a/assets/app-4a36f290.js b/assets/app-4a36f290.js new file mode 100644 index 00000000..28d46fe5 --- /dev/null +++ b/assets/app-4a36f290.js @@ -0,0 +1,17 @@ +import{d as S,r as z,a as mr,b as Nc,c as j,i as be,e as _n,f as Hc,g as Bc,o as re,h as I,j as d,k as Vt,l as ka,m as Ve,n as vr,p as Vr,q as Fc,u as Ee,w as X,s as qc,t as zt,v as hr,x as Uc,y as Wc,z as Gc,A as Kc,T as dt,B as Se,C as Yc,R as Re,D as ye,E as Pa,F as gr,G as Jc,H as cn,I as Qc,J as bn,K as Ia,L as Zc,M as _r,N as Xc,O as zr,P as el,S as tl,Q as nl,U as rl,V as ol}from"./framework-46b0e263.js";const al="modulepreload",il=function(e){return"/"+e},Mr={},h=function(t,n,r){if(!n||n.length===0)return t();const o=document.getElementsByTagName("link");return Promise.all(n.map(a=>{if(a=il(a),a in Mr)return;Mr[a]=!0;const i=a.endsWith(".css"),c=i?'[rel="stylesheet"]':"";if(!!r)for(let u=o.length-1;u>=0;u--){const p=o[u];if(p.href===a&&(!i||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${c}`))return;const s=document.createElement("link");if(s.rel=i?"stylesheet":al,i||(s.as="script",s.crossOrigin=""),s.href=a,document.head.appendChild(s),i)return new Promise((u,p)=>{s.addEventListener("load",u),s.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())},cl={"v-8daa1a0e":()=>h(()=>import("./index.html-fb5c6011.js"),[]).then(({data:e})=>e),"v-6ce48554":()=>h(()=>import("./contributing.html-f20968df.js"),[]).then(({data:e})=>e),"v-b4ed4f1c":()=>h(()=>import("./architecture.html-bfe48eba.js"),[]).then(({data:e})=>e),"v-301ab792":()=>h(()=>import("./plugin.html-ebe09bff.js"),[]).then(({data:e})=>e),"v-06329db8":()=>h(()=>import("./theme.html-cacc09fb.js"),[]).then(({data:e})=>e),"v-fffb8e28":()=>h(()=>import("./index.html-80a01853.js"),[]).then(({data:e})=>e),"v-3c32c2ca":()=>h(()=>import("./assets.html-2f37d46f.js"),[]).then(({data:e})=>e),"v-6f1f3595":()=>h(()=>import("./bundler.html-f028d973.js"),[]).then(({data:e})=>e),"v-4f4ccb8f":()=>h(()=>import("./configuration.html-8cfe2e2f.js"),[]).then(({data:e})=>e),"v-e8a66a70":()=>h(()=>import("./deployment.html-69247d56.js"),[]).then(({data:e})=>e),"v-fb0f0066":()=>h(()=>import("./getting-started.html-218659cd.js"),[]).then(({data:e})=>e),"v-acb10be2":()=>h(()=>import("./i18n.html-cd078675.js"),[]).then(({data:e})=>e),"v-0978b044":()=>h(()=>import("./markdown.html-daca0316.js"),[]).then(({data:e})=>e),"v-d0112c92":()=>h(()=>import("./migration.html-2aa2394a.js"),[]).then(({data:e})=>e),"v-4eaf9f84":()=>h(()=>import("./page.html-207516b6.js"),[]).then(({data:e})=>e),"v-1d14d5cc":()=>h(()=>import("./plugin.html-95fad35f.js"),[]).then(({data:e})=>e),"v-4d76029c":()=>h(()=>import("./theme.html-c65f5d90.js"),[]).then(({data:e})=>e),"v-a951be94":()=>h(()=>import("./cli.html-2761a139.js"),[]).then(({data:e})=>e),"v-a84e51b8":()=>h(()=>import("./client-api.html-787be4ae.js"),[]).then(({data:e})=>e),"v-55453034":()=>h(()=>import("./components.html-478c036d.js"),[]).then(({data:e})=>e),"v-b249668c":()=>h(()=>import("./config.html-d093ed05.js"),[]).then(({data:e})=>e),"v-3590f0ec":()=>h(()=>import("./frontmatter.html-5c8a8e5d.js"),[]).then(({data:e})=>e),"v-4986678d":()=>h(()=>import("./node-api.html-18ff42ee.js"),[]).then(({data:e})=>e),"v-51569e88":()=>h(()=>import("./plugin-api.html-e5d3923f.js"),[]).then(({data:e})=>e),"v-6b76c1c0":()=>h(()=>import("./theme-api.html-a169223d.js"),[]).then(({data:e})=>e),"v-2d0ad528":()=>h(()=>import("./index.html-5b546a26.js"),[]).then(({data:e})=>e),"v-e012c1f2":()=>h(()=>import("./contributing.html-6dc0f72e.js"),[]).then(({data:e})=>e),"v-03c9312a":()=>h(()=>import("./index.html-3afbf148.js"),[]).then(({data:e})=>e),"v-2a57b498":()=>h(()=>import("./adding-extra-pages.html-85fbc8d4.js"),[]).then(({data:e})=>e),"v-06adec7d":()=>h(()=>import("./making-a-theme-extendable.html-f8f662ca.js"),[]).then(({data:e})=>e),"v-4e3c9b8c":()=>h(()=>import("./markdown-and-vue-sfc.html-0af2e2a9.js"),[]).then(({data:e})=>e),"v-3bc3633f":()=>h(()=>import("./passing-data-to-client-code.html-a8002c66.js"),[]).then(({data:e})=>e),"v-3d6c80f5":()=>h(()=>import("./usage-of-client-config.html-7ce03b78.js"),[]).then(({data:e})=>e),"v-cf5a290e":()=>h(()=>import("./vite.html-9326e178.js"),[]).then(({data:e})=>e),"v-d4319af0":()=>h(()=>import("./webpack.html-c03c48a3.js"),[]).then(({data:e})=>e),"v-2e97e858":()=>h(()=>import("./components.html-da84c67b.js"),[]).then(({data:e})=>e),"v-0f0d17a8":()=>h(()=>import("./config.html-9875b777.js"),[]).then(({data:e})=>e),"v-6175ace0":()=>h(()=>import("./extending.html-475b2487.js"),[]).then(({data:e})=>e),"v-e5e26a84":()=>h(()=>import("./frontmatter.html-60124b9c.js"),[]).then(({data:e})=>e),"v-176c9c4a":()=>h(()=>import("./markdown.html-02e69834.js"),[]).then(({data:e})=>e),"v-31e08608":()=>h(()=>import("./styles.html-cf9c349d.js"),[]).then(({data:e})=>e),"v-3ba02eb8":()=>h(()=>import("./active-header-links.html-91a347f7.js"),[]).then(({data:e})=>e),"v-6474e88f":()=>h(()=>import("./back-to-top.html-a351fd04.js"),[]).then(({data:e})=>e),"v-3df91977":()=>h(()=>import("./container.html-343c4b32.js"),[]).then(({data:e})=>e),"v-ec0baf10":()=>h(()=>import("./docsearch.html-96cbfce9.js"),[]).then(({data:e})=>e),"v-5c864690":()=>h(()=>import("./external-link-icon.html-b9e0c3f1.js"),[]).then(({data:e})=>e),"v-0f9e4c06":()=>h(()=>import("./git.html-3f427683.js"),[]).then(({data:e})=>e),"v-b3f1b470":()=>h(()=>import("./google-analytics.html-fe5b25b3.js"),[]).then(({data:e})=>e),"v-2ad6454d":()=>h(()=>import("./medium-zoom.html-926244f2.js"),[]).then(({data:e})=>e),"v-46d4f19d":()=>h(()=>import("./nprogress.html-1022e6a7.js"),[]).then(({data:e})=>e),"v-37c5e106":()=>h(()=>import("./palette.html-e4b95f90.js"),[]).then(({data:e})=>e),"v-35ebfb0e":()=>h(()=>import("./prismjs.html-c9458bed.js"),[]).then(({data:e})=>e),"v-5f86289f":()=>h(()=>import("./pwa-popup.html-bb82625d.js"),[]).then(({data:e})=>e),"v-7ab4099e":()=>h(()=>import("./pwa.html-a8bc73bb.js"),[]).then(({data:e})=>e),"v-7f8fee18":()=>h(()=>import("./register-components.html-3824e3d5.js"),[]).then(({data:e})=>e),"v-260e1012":()=>h(()=>import("./search.html-c7cf299c.js"),[]).then(({data:e})=>e),"v-bb2079f4":()=>h(()=>import("./shiki.html-c91adaea.js"),[]).then(({data:e})=>e),"v-18fd0fcc":()=>h(()=>import("./theme-data.html-2029f336.js"),[]).then(({data:e})=>e),"v-76709450":()=>h(()=>import("./toc.html-6a6abe62.js"),[]).then(({data:e})=>e),"v-0754cde1":()=>h(()=>import("./architecture.html-3196f842.js"),[]).then(({data:e})=>e),"v-574aac41":()=>h(()=>import("./plugin.html-6b68f3b2.js"),[]).then(({data:e})=>e),"v-66c42ad6":()=>h(()=>import("./theme.html-cb66f31b.js"),[]).then(({data:e})=>e),"v-47357bdb":()=>h(()=>import("./index.html-7e872e5b.js"),[]).then(({data:e})=>e),"v-029ba47b":()=>h(()=>import("./assets.html-9a1cabf8.js"),[]).then(({data:e})=>e),"v-75d28a04":()=>h(()=>import("./bundler.html-1e3cd6ec.js"),[]).then(({data:e})=>e),"v-81f65e84":()=>h(()=>import("./configuration.html-0d5a74e7.js"),[]).then(({data:e})=>e),"v-4a7b6bf9":()=>h(()=>import("./deployment.html-24cc7f5b.js"),[]).then(({data:e})=>e),"v-37781588":()=>h(()=>import("./getting-started.html-7cb9cdb6.js"),[]).then(({data:e})=>e),"v-4b8f1400":()=>h(()=>import("./i18n.html-d3e7282a.js"),[]).then(({data:e})=>e),"v-6a0a3d62":()=>h(()=>import("./markdown.html-f0b871b8.js"),[]).then(({data:e})=>e),"v-81b14334":()=>h(()=>import("./migration.html-cc0874ae.js"),[]).then(({data:e})=>e),"v-7a8fca2f":()=>h(()=>import("./page.html-69e8d1e1.js"),[]).then(({data:e})=>e),"v-9043126a":()=>h(()=>import("./plugin.html-b89655ab.js"),[]).then(({data:e})=>e),"v-2efcb26a":()=>h(()=>import("./theme.html-6daccb0c.js"),[]).then(({data:e})=>e),"v-9beb15b6":()=>h(()=>import("./cli.html-e7d4e52b.js"),[]).then(({data:e})=>e),"v-332177d5":()=>h(()=>import("./client-api.html-79f0beda.js"),[]).then(({data:e})=>e),"v-5ca60897":()=>h(()=>import("./components.html-ef948022.js"),[]).then(({data:e})=>e),"v-65a9edeb":()=>h(()=>import("./config.html-8c5b48e3.js"),[]).then(({data:e})=>e),"v-d147334a":()=>h(()=>import("./frontmatter.html-bdbde184.js"),[]).then(({data:e})=>e),"v-e19cff04":()=>h(()=>import("./node-api.html-85bdab9d.js"),[]).then(({data:e})=>e),"v-5e9d516d":()=>h(()=>import("./plugin-api.html-5e3b2303.js"),[]).then(({data:e})=>e),"v-49a27222":()=>h(()=>import("./theme-api.html-b6aae4d8.js"),[]).then(({data:e})=>e),"v-0a7c8599":()=>h(()=>import("./index.html-c8256226.js"),[]).then(({data:e})=>e),"v-5b617736":()=>h(()=>import("./adding-extra-pages.html-7488d932.js"),[]).then(({data:e})=>e),"v-04c514ac":()=>h(()=>import("./making-a-theme-extendable.html-8d323011.js"),[]).then(({data:e})=>e),"v-63e02eaa":()=>h(()=>import("./markdown-and-vue-sfc.html-5c47f4ae.js"),[]).then(({data:e})=>e),"v-10b13bae":()=>h(()=>import("./passing-data-to-client-code.html-74bf54bf.js"),[]).then(({data:e})=>e),"v-c03241b4":()=>h(()=>import("./usage-of-client-config.html-01b482fe.js"),[]).then(({data:e})=>e),"v-6ff623ea":()=>h(()=>import("./vite.html-1cf3b6bd.js"),[]).then(({data:e})=>e),"v-dde74f12":()=>h(()=>import("./webpack.html-52b8a648.js"),[]).then(({data:e})=>e),"v-551922c5":()=>h(()=>import("./components.html-47cc2388.js"),[]).then(({data:e})=>e),"v-03a561ce":()=>h(()=>import("./config.html-66333531.js"),[]).then(({data:e})=>e),"v-90ed1862":()=>h(()=>import("./extending.html-d6c7b1f5.js"),[]).then(({data:e})=>e),"v-a566dc26":()=>h(()=>import("./frontmatter.html-5f732d4f.js"),[]).then(({data:e})=>e),"v-c78c5de8":()=>h(()=>import("./markdown.html-8eab8112.js"),[]).then(({data:e})=>e),"v-2100bd79":()=>h(()=>import("./styles.html-f0854e57.js"),[]).then(({data:e})=>e),"v-231b4d69":()=>h(()=>import("./active-header-links.html-a98aa233.js"),[]).then(({data:e})=>e),"v-6c6e4840":()=>h(()=>import("./back-to-top.html-5a088d40.js"),[]).then(({data:e})=>e),"v-b10e9d30":()=>h(()=>import("./container.html-3cbbe523.js"),[]).then(({data:e})=>e),"v-190c7f2e":()=>h(()=>import("./docsearch.html-fea1bb38.js"),[]).then(({data:e})=>e),"v-7cc40dbf":()=>h(()=>import("./external-link-icon.html-bf5c4074.js"),[]).then(({data:e})=>e),"v-d2322692":()=>h(()=>import("./git.html-fe8105d2.js"),[]).then(({data:e})=>e),"v-07ca2692":()=>h(()=>import("./google-analytics.html-86042f8e.js"),[]).then(({data:e})=>e),"v-32cfa4fe":()=>h(()=>import("./medium-zoom.html-b884d404.js"),[]).then(({data:e})=>e),"v-9f56ece4":()=>h(()=>import("./nprogress.html-bcdc2bc9.js"),[]).then(({data:e})=>e),"v-5fd3efae":()=>h(()=>import("./palette.html-96b6024a.js"),[]).then(({data:e})=>e),"v-9cba4982":()=>h(()=>import("./prismjs.html-b41398b8.js"),[]).then(({data:e})=>e),"v-6df47ee0":()=>h(()=>import("./pwa-popup.html-7ff33522.js"),[]).then(({data:e})=>e),"v-01fcaa4f":()=>h(()=>import("./pwa.html-48090ed1.js"),[]).then(({data:e})=>e),"v-670b0cc9":()=>h(()=>import("./register-components.html-865034f7.js"),[]).then(({data:e})=>e),"v-42d1e5c1":()=>h(()=>import("./search.html-61d47ae9.js"),[]).then(({data:e})=>e),"v-7a12fb77":()=>h(()=>import("./shiki.html-d52b252b.js"),[]).then(({data:e})=>e),"v-411f140a":()=>h(()=>import("./theme-data.html-03afc4d1.js"),[]).then(({data:e})=>e),"v-048d95fe":()=>h(()=>import("./toc.html-aac1b6d6.js"),[]).then(({data:e})=>e),"v-3706649a":()=>h(()=>import("./404.html-c1720e4d.js"),[]).then(({data:e})=>e),"v-638c1d18":()=>h(()=>import("./index.html-ee294b98.js"),[]).then(({data:e})=>e),"v-22a2f9fd":()=>h(()=>import("./index.html-96c02e47.js"),[]).then(({data:e})=>e),"v-2b10d2fc":()=>h(()=>import("./index.html-d88310ab.js"),[]).then(({data:e})=>e),"v-43e2b7cf":()=>h(()=>import("./index.html-1c40c637.js"),[]).then(({data:e})=>e),"v-d61a9282":()=>h(()=>import("./index.html-842ca072.js"),[]).then(({data:e})=>e),"v-16d7d7b6":()=>h(()=>import("./index.html-2130e344.js"),[]).then(({data:e})=>e),"v-70e5a528":()=>h(()=>import("./index.html-3a17c39d.js"),[]).then(({data:e})=>e),"v-31c4276b":()=>h(()=>import("./index.html-d2bb853d.js"),[]).then(({data:e})=>e),"v-98ca8604":()=>h(()=>import("./index.html-dc3052e6.js"),[]).then(({data:e})=>e),"v-5b5b9870":()=>h(()=>import("./index.html-b5987a1c.js"),[]).then(({data:e})=>e)},ll=JSON.parse('{"base":"/","lang":"en-US","title":"","description":"","head":[["link",{"rel":"icon","type":"image/png","sizes":"16x16","href":"/images/icons/favicon-16x16.png"}],["link",{"rel":"icon","type":"image/png","sizes":"32x32","href":"/images/icons/favicon-32x32.png"}],["link",{"rel":"manifest","href":"/manifest.webmanifest"}],["meta",{"name":"application-name","content":"VuePress"}],["meta",{"name":"apple-mobile-web-app-title","content":"VuePress"}],["meta",{"name":"apple-mobile-web-app-status-bar-style","content":"black"}],["link",{"rel":"apple-touch-icon","href":"/images/icons/apple-touch-icon.png"}],["link",{"rel":"mask-icon","href":"/images/icons/safari-pinned-tab.svg","color":"#3eaf7c"}],["meta",{"name":"msapplication-TileColor","content":"#3eaf7c"}],["meta",{"name":"theme-color","content":"#3eaf7c"}]],"locales":{"/":{"lang":"en-US","title":"VuePress","description":"Vue-powered Static Site Generator"},"/zh/":{"lang":"zh-CN","title":"VuePress","description":"Vue 驱动的静态网站生成器"}}}'),Ta={"v-8daa1a0e":S(()=>h(()=>import("./index.html-1fc2b45e.js"),["assets/index.html-1fc2b45e.js","assets/framework-46b0e263.js"])),"v-6ce48554":S(()=>h(()=>import("./contributing.html-4ed8de19.js"),["assets/contributing.html-4ed8de19.js","assets/framework-46b0e263.js"])),"v-b4ed4f1c":S(()=>h(()=>import("./architecture.html-60a60be6.js"),["assets/architecture.html-60a60be6.js","assets/vuepress-core-process-3a7a342e.js","assets/framework-46b0e263.js"])),"v-301ab792":S(()=>h(()=>import("./plugin.html-70d14bec.js"),["assets/plugin.html-70d14bec.js","assets/framework-46b0e263.js"])),"v-06329db8":S(()=>h(()=>import("./theme.html-18dd2f4e.js"),["assets/theme.html-18dd2f4e.js","assets/framework-46b0e263.js"])),"v-fffb8e28":S(()=>h(()=>import("./index.html-62511030.js"),["assets/index.html-62511030.js","assets/framework-46b0e263.js"])),"v-3c32c2ca":S(()=>h(()=>import("./assets.html-1b1d6062.js"),["assets/assets.html-1b1d6062.js","assets/hero-8a9eb0cf.js","assets/framework-46b0e263.js"])),"v-6f1f3595":S(()=>h(()=>import("./bundler.html-f9a502f3.js"),["assets/bundler.html-f9a502f3.js","assets/framework-46b0e263.js"])),"v-4f4ccb8f":S(()=>h(()=>import("./configuration.html-59431c6a.js"),["assets/configuration.html-59431c6a.js","assets/framework-46b0e263.js"])),"v-e8a66a70":S(()=>h(()=>import("./deployment.html-355f7597.js"),["assets/deployment.html-355f7597.js","assets/framework-46b0e263.js"])),"v-fb0f0066":S(()=>h(()=>import("./getting-started.html-82d2dd43.js"),["assets/getting-started.html-82d2dd43.js","assets/framework-46b0e263.js"])),"v-acb10be2":S(()=>h(()=>import("./i18n.html-979c3eb8.js"),["assets/i18n.html-979c3eb8.js","assets/framework-46b0e263.js"])),"v-0978b044":S(()=>h(()=>import("./markdown.html-c9777236.js"),["assets/markdown.html-c9777236.js","assets/framework-46b0e263.js"])),"v-d0112c92":S(()=>h(()=>import("./migration.html-feaf251f.js"),["assets/migration.html-feaf251f.js","assets/framework-46b0e263.js"])),"v-4eaf9f84":S(()=>h(()=>import("./page.html-713a4212.js"),["assets/page.html-713a4212.js","assets/framework-46b0e263.js"])),"v-1d14d5cc":S(()=>h(()=>import("./plugin.html-bed3198b.js"),["assets/plugin.html-bed3198b.js","assets/framework-46b0e263.js"])),"v-4d76029c":S(()=>h(()=>import("./theme.html-3d462c1b.js"),["assets/theme.html-3d462c1b.js","assets/framework-46b0e263.js"])),"v-a951be94":S(()=>h(()=>import("./cli.html-cfbcbfaf.js"),["assets/cli.html-cfbcbfaf.js","assets/framework-46b0e263.js"])),"v-a84e51b8":S(()=>h(()=>import("./client-api.html-9d516b34.js"),["assets/client-api.html-9d516b34.js","assets/framework-46b0e263.js"])),"v-55453034":S(()=>h(()=>import("./components.html-45ddf801.js"),["assets/components.html-45ddf801.js","assets/framework-46b0e263.js"])),"v-b249668c":S(()=>h(()=>import("./config.html-58974c3b.js"),["assets/config.html-58974c3b.js","assets/framework-46b0e263.js"])),"v-3590f0ec":S(()=>h(()=>import("./frontmatter.html-9281febe.js"),["assets/frontmatter.html-9281febe.js","assets/framework-46b0e263.js"])),"v-4986678d":S(()=>h(()=>import("./node-api.html-d6fde234.js"),["assets/node-api.html-d6fde234.js","assets/framework-46b0e263.js"])),"v-51569e88":S(()=>h(()=>import("./plugin-api.html-48f54d30.js"),["assets/plugin-api.html-48f54d30.js","assets/framework-46b0e263.js"])),"v-6b76c1c0":S(()=>h(()=>import("./theme-api.html-089c0c83.js"),["assets/theme-api.html-089c0c83.js","assets/framework-46b0e263.js"])),"v-2d0ad528":S(()=>h(()=>import("./index.html-a94da676.js"),["assets/index.html-a94da676.js","assets/framework-46b0e263.js"])),"v-e012c1f2":S(()=>h(()=>import("./contributing.html-e03745b5.js"),["assets/contributing.html-e03745b5.js","assets/framework-46b0e263.js"])),"v-03c9312a":S(()=>h(()=>import("./index.html-a8ad45ea.js"),["assets/index.html-a8ad45ea.js","assets/framework-46b0e263.js"])),"v-2a57b498":S(()=>h(()=>import("./adding-extra-pages.html-9002b717.js"),["assets/adding-extra-pages.html-9002b717.js","assets/framework-46b0e263.js"])),"v-06adec7d":S(()=>h(()=>import("./making-a-theme-extendable.html-9a9a0ccd.js"),["assets/making-a-theme-extendable.html-9a9a0ccd.js","assets/framework-46b0e263.js"])),"v-4e3c9b8c":S(()=>h(()=>import("./markdown-and-vue-sfc.html-dc45e8fd.js"),["assets/markdown-and-vue-sfc.html-dc45e8fd.js","assets/framework-46b0e263.js"])),"v-3bc3633f":S(()=>h(()=>import("./passing-data-to-client-code.html-e7881e68.js"),["assets/passing-data-to-client-code.html-e7881e68.js","assets/framework-46b0e263.js"])),"v-3d6c80f5":S(()=>h(()=>import("./usage-of-client-config.html-77c30a87.js"),["assets/usage-of-client-config.html-77c30a87.js","assets/framework-46b0e263.js"])),"v-cf5a290e":S(()=>h(()=>import("./vite.html-27bceae1.js"),["assets/vite.html-27bceae1.js","assets/framework-46b0e263.js"])),"v-d4319af0":S(()=>h(()=>import("./webpack.html-c223bdb5.js"),["assets/webpack.html-c223bdb5.js","assets/framework-46b0e263.js"])),"v-2e97e858":S(()=>h(()=>import("./components.html-2cd38e14.js"),["assets/components.html-2cd38e14.js","assets/framework-46b0e263.js"])),"v-0f0d17a8":S(()=>h(()=>import("./config.html-e743ca54.js"),["assets/config.html-e743ca54.js","assets/framework-46b0e263.js"])),"v-6175ace0":S(()=>h(()=>import("./extending.html-f332bc2d.js"),["assets/extending.html-f332bc2d.js","assets/extending-a-theme-01-9eaa80a2.js","assets/framework-46b0e263.js"])),"v-e5e26a84":S(()=>h(()=>import("./frontmatter.html-96a3ef5a.js"),["assets/frontmatter.html-96a3ef5a.js","assets/framework-46b0e263.js"])),"v-176c9c4a":S(()=>h(()=>import("./markdown.html-72308ea5.js"),["assets/markdown.html-72308ea5.js","assets/framework-46b0e263.js"])),"v-31e08608":S(()=>h(()=>import("./styles.html-2c440e5c.js"),["assets/styles.html-2c440e5c.js","assets/framework-46b0e263.js"])),"v-3ba02eb8":S(()=>h(()=>import("./active-header-links.html-7f2d6108.js"),["assets/active-header-links.html-7f2d6108.js","assets/framework-46b0e263.js"])),"v-6474e88f":S(()=>h(()=>import("./back-to-top.html-5f6d8d82.js"),["assets/back-to-top.html-5f6d8d82.js","assets/framework-46b0e263.js"])),"v-3df91977":S(()=>h(()=>import("./container.html-78c33ddf.js"),["assets/container.html-78c33ddf.js","assets/framework-46b0e263.js"])),"v-ec0baf10":S(()=>h(()=>import("./docsearch.html-80a50c1e.js"),["assets/docsearch.html-80a50c1e.js","assets/framework-46b0e263.js"])),"v-5c864690":S(()=>h(()=>import("./external-link-icon.html-57fd9332.js"),["assets/external-link-icon.html-57fd9332.js","assets/framework-46b0e263.js"])),"v-0f9e4c06":S(()=>h(()=>import("./git.html-33f0c5bb.js"),["assets/git.html-33f0c5bb.js","assets/framework-46b0e263.js"])),"v-b3f1b470":S(()=>h(()=>import("./google-analytics.html-bb077b11.js"),["assets/google-analytics.html-bb077b11.js","assets/framework-46b0e263.js"])),"v-2ad6454d":S(()=>h(()=>import("./medium-zoom.html-bf739c54.js"),["assets/medium-zoom.html-bf739c54.js","assets/framework-46b0e263.js"])),"v-46d4f19d":S(()=>h(()=>import("./nprogress.html-64571246.js"),["assets/nprogress.html-64571246.js","assets/framework-46b0e263.js"])),"v-37c5e106":S(()=>h(()=>import("./palette.html-56c56250.js"),["assets/palette.html-56c56250.js","assets/framework-46b0e263.js"])),"v-35ebfb0e":S(()=>h(()=>import("./prismjs.html-22d9c496.js"),["assets/prismjs.html-22d9c496.js","assets/framework-46b0e263.js"])),"v-5f86289f":S(()=>h(()=>import("./pwa-popup.html-f245bee2.js"),["assets/pwa-popup.html-f245bee2.js","assets/framework-46b0e263.js"])),"v-7ab4099e":S(()=>h(()=>import("./pwa.html-4dcccf61.js"),["assets/pwa.html-4dcccf61.js","assets/framework-46b0e263.js"])),"v-7f8fee18":S(()=>h(()=>import("./register-components.html-7bbc9716.js"),["assets/register-components.html-7bbc9716.js","assets/framework-46b0e263.js"])),"v-260e1012":S(()=>h(()=>import("./search.html-41912ea0.js"),["assets/search.html-41912ea0.js","assets/framework-46b0e263.js"])),"v-bb2079f4":S(()=>h(()=>import("./shiki.html-e11165ea.js"),["assets/shiki.html-e11165ea.js","assets/framework-46b0e263.js"])),"v-18fd0fcc":S(()=>h(()=>import("./theme-data.html-71846647.js"),["assets/theme-data.html-71846647.js","assets/framework-46b0e263.js"])),"v-76709450":S(()=>h(()=>import("./toc.html-35e9d7bb.js"),["assets/toc.html-35e9d7bb.js","assets/framework-46b0e263.js"])),"v-0754cde1":S(()=>h(()=>import("./architecture.html-5185fb7b.js"),["assets/architecture.html-5185fb7b.js","assets/vuepress-core-process-3a7a342e.js","assets/framework-46b0e263.js"])),"v-574aac41":S(()=>h(()=>import("./plugin.html-7408e888.js"),["assets/plugin.html-7408e888.js","assets/framework-46b0e263.js"])),"v-66c42ad6":S(()=>h(()=>import("./theme.html-ee0c13ce.js"),["assets/theme.html-ee0c13ce.js","assets/framework-46b0e263.js"])),"v-47357bdb":S(()=>h(()=>import("./index.html-a809ce07.js"),["assets/index.html-a809ce07.js","assets/framework-46b0e263.js"])),"v-029ba47b":S(()=>h(()=>import("./assets.html-4d2615e1.js"),["assets/assets.html-4d2615e1.js","assets/hero-8a9eb0cf.js","assets/framework-46b0e263.js"])),"v-75d28a04":S(()=>h(()=>import("./bundler.html-4a16a5de.js"),["assets/bundler.html-4a16a5de.js","assets/framework-46b0e263.js"])),"v-81f65e84":S(()=>h(()=>import("./configuration.html-782c9432.js"),["assets/configuration.html-782c9432.js","assets/framework-46b0e263.js"])),"v-4a7b6bf9":S(()=>h(()=>import("./deployment.html-868cba60.js"),["assets/deployment.html-868cba60.js","assets/framework-46b0e263.js"])),"v-37781588":S(()=>h(()=>import("./getting-started.html-b0306b71.js"),["assets/getting-started.html-b0306b71.js","assets/framework-46b0e263.js"])),"v-4b8f1400":S(()=>h(()=>import("./i18n.html-c6901264.js"),["assets/i18n.html-c6901264.js","assets/framework-46b0e263.js"])),"v-6a0a3d62":S(()=>h(()=>import("./markdown.html-aac5e40a.js"),["assets/markdown.html-aac5e40a.js","assets/framework-46b0e263.js"])),"v-81b14334":S(()=>h(()=>import("./migration.html-41dd8c51.js"),["assets/migration.html-41dd8c51.js","assets/framework-46b0e263.js"])),"v-7a8fca2f":S(()=>h(()=>import("./page.html-c8245648.js"),["assets/page.html-c8245648.js","assets/framework-46b0e263.js"])),"v-9043126a":S(()=>h(()=>import("./plugin.html-d44754d7.js"),["assets/plugin.html-d44754d7.js","assets/framework-46b0e263.js"])),"v-2efcb26a":S(()=>h(()=>import("./theme.html-2c740ba6.js"),["assets/theme.html-2c740ba6.js","assets/framework-46b0e263.js"])),"v-9beb15b6":S(()=>h(()=>import("./cli.html-13a56669.js"),["assets/cli.html-13a56669.js","assets/framework-46b0e263.js"])),"v-332177d5":S(()=>h(()=>import("./client-api.html-e1254874.js"),["assets/client-api.html-e1254874.js","assets/framework-46b0e263.js"])),"v-5ca60897":S(()=>h(()=>import("./components.html-d0e3e42b.js"),["assets/components.html-d0e3e42b.js","assets/framework-46b0e263.js"])),"v-65a9edeb":S(()=>h(()=>import("./config.html-e71cb202.js"),["assets/config.html-e71cb202.js","assets/framework-46b0e263.js"])),"v-d147334a":S(()=>h(()=>import("./frontmatter.html-397e5aab.js"),["assets/frontmatter.html-397e5aab.js","assets/framework-46b0e263.js"])),"v-e19cff04":S(()=>h(()=>import("./node-api.html-3f616fc7.js"),["assets/node-api.html-3f616fc7.js","assets/framework-46b0e263.js"])),"v-5e9d516d":S(()=>h(()=>import("./plugin-api.html-c8d9418d.js"),["assets/plugin-api.html-c8d9418d.js","assets/framework-46b0e263.js"])),"v-49a27222":S(()=>h(()=>import("./theme-api.html-c8d9fb01.js"),["assets/theme-api.html-c8d9fb01.js","assets/framework-46b0e263.js"])),"v-0a7c8599":S(()=>h(()=>import("./index.html-01e674f5.js"),["assets/index.html-01e674f5.js","assets/framework-46b0e263.js"])),"v-5b617736":S(()=>h(()=>import("./adding-extra-pages.html-d579a0d0.js"),["assets/adding-extra-pages.html-d579a0d0.js","assets/framework-46b0e263.js"])),"v-04c514ac":S(()=>h(()=>import("./making-a-theme-extendable.html-4a2e0dc4.js"),["assets/making-a-theme-extendable.html-4a2e0dc4.js","assets/framework-46b0e263.js"])),"v-63e02eaa":S(()=>h(()=>import("./markdown-and-vue-sfc.html-ed00f986.js"),["assets/markdown-and-vue-sfc.html-ed00f986.js","assets/framework-46b0e263.js"])),"v-10b13bae":S(()=>h(()=>import("./passing-data-to-client-code.html-e724cdf3.js"),["assets/passing-data-to-client-code.html-e724cdf3.js","assets/framework-46b0e263.js"])),"v-c03241b4":S(()=>h(()=>import("./usage-of-client-config.html-02d1b251.js"),["assets/usage-of-client-config.html-02d1b251.js","assets/framework-46b0e263.js"])),"v-6ff623ea":S(()=>h(()=>import("./vite.html-a42b420e.js"),["assets/vite.html-a42b420e.js","assets/framework-46b0e263.js"])),"v-dde74f12":S(()=>h(()=>import("./webpack.html-bc54a5d7.js"),["assets/webpack.html-bc54a5d7.js","assets/framework-46b0e263.js"])),"v-551922c5":S(()=>h(()=>import("./components.html-6dbfa22c.js"),["assets/components.html-6dbfa22c.js","assets/framework-46b0e263.js"])),"v-03a561ce":S(()=>h(()=>import("./config.html-432c6100.js"),["assets/config.html-432c6100.js","assets/framework-46b0e263.js"])),"v-90ed1862":S(()=>h(()=>import("./extending.html-1e64d2ab.js"),["assets/extending.html-1e64d2ab.js","assets/extending-a-theme-01-9eaa80a2.js","assets/framework-46b0e263.js"])),"v-a566dc26":S(()=>h(()=>import("./frontmatter.html-457ea87f.js"),["assets/frontmatter.html-457ea87f.js","assets/framework-46b0e263.js"])),"v-c78c5de8":S(()=>h(()=>import("./markdown.html-f26fa0b6.js"),["assets/markdown.html-f26fa0b6.js","assets/framework-46b0e263.js"])),"v-2100bd79":S(()=>h(()=>import("./styles.html-18ac6f01.js"),["assets/styles.html-18ac6f01.js","assets/framework-46b0e263.js"])),"v-231b4d69":S(()=>h(()=>import("./active-header-links.html-bb25d530.js"),["assets/active-header-links.html-bb25d530.js","assets/framework-46b0e263.js"])),"v-6c6e4840":S(()=>h(()=>import("./back-to-top.html-3d105bf2.js"),["assets/back-to-top.html-3d105bf2.js","assets/framework-46b0e263.js"])),"v-b10e9d30":S(()=>h(()=>import("./container.html-98692cc1.js"),["assets/container.html-98692cc1.js","assets/framework-46b0e263.js"])),"v-190c7f2e":S(()=>h(()=>import("./docsearch.html-e0be4873.js"),["assets/docsearch.html-e0be4873.js","assets/framework-46b0e263.js"])),"v-7cc40dbf":S(()=>h(()=>import("./external-link-icon.html-58c8c6e2.js"),["assets/external-link-icon.html-58c8c6e2.js","assets/framework-46b0e263.js"])),"v-d2322692":S(()=>h(()=>import("./git.html-e47476ae.js"),["assets/git.html-e47476ae.js","assets/framework-46b0e263.js"])),"v-07ca2692":S(()=>h(()=>import("./google-analytics.html-6e744845.js"),["assets/google-analytics.html-6e744845.js","assets/framework-46b0e263.js"])),"v-32cfa4fe":S(()=>h(()=>import("./medium-zoom.html-7c5262ed.js"),["assets/medium-zoom.html-7c5262ed.js","assets/framework-46b0e263.js"])),"v-9f56ece4":S(()=>h(()=>import("./nprogress.html-aaaab1e3.js"),["assets/nprogress.html-aaaab1e3.js","assets/framework-46b0e263.js"])),"v-5fd3efae":S(()=>h(()=>import("./palette.html-5cc582af.js"),["assets/palette.html-5cc582af.js","assets/framework-46b0e263.js"])),"v-9cba4982":S(()=>h(()=>import("./prismjs.html-1adf5589.js"),["assets/prismjs.html-1adf5589.js","assets/framework-46b0e263.js"])),"v-6df47ee0":S(()=>h(()=>import("./pwa-popup.html-a135b6f9.js"),["assets/pwa-popup.html-a135b6f9.js","assets/framework-46b0e263.js"])),"v-01fcaa4f":S(()=>h(()=>import("./pwa.html-80ca55ab.js"),["assets/pwa.html-80ca55ab.js","assets/framework-46b0e263.js"])),"v-670b0cc9":S(()=>h(()=>import("./register-components.html-f40c1c68.js"),["assets/register-components.html-f40c1c68.js","assets/framework-46b0e263.js"])),"v-42d1e5c1":S(()=>h(()=>import("./search.html-52d32298.js"),["assets/search.html-52d32298.js","assets/framework-46b0e263.js"])),"v-7a12fb77":S(()=>h(()=>import("./shiki.html-d54efc8e.js"),["assets/shiki.html-d54efc8e.js","assets/framework-46b0e263.js"])),"v-411f140a":S(()=>h(()=>import("./theme-data.html-a62c4182.js"),["assets/theme-data.html-a62c4182.js","assets/framework-46b0e263.js"])),"v-048d95fe":S(()=>h(()=>import("./toc.html-d4b62f4b.js"),["assets/toc.html-d4b62f4b.js","assets/framework-46b0e263.js"])),"v-3706649a":S(()=>h(()=>import("./404.html-15746044.js"),["assets/404.html-15746044.js","assets/framework-46b0e263.js"])),"v-638c1d18":S(()=>h(()=>import("./index.html-9ac61946.js"),["assets/index.html-9ac61946.js","assets/framework-46b0e263.js"])),"v-22a2f9fd":S(()=>h(()=>import("./index.html-baec65eb.js"),["assets/index.html-baec65eb.js","assets/framework-46b0e263.js"])),"v-2b10d2fc":S(()=>h(()=>import("./index.html-a69c820c.js"),["assets/index.html-a69c820c.js","assets/framework-46b0e263.js"])),"v-43e2b7cf":S(()=>h(()=>import("./index.html-2f61641e.js"),["assets/index.html-2f61641e.js","assets/framework-46b0e263.js"])),"v-d61a9282":S(()=>h(()=>import("./index.html-78973204.js"),["assets/index.html-78973204.js","assets/framework-46b0e263.js"])),"v-16d7d7b6":S(()=>h(()=>import("./index.html-48204d48.js"),["assets/index.html-48204d48.js","assets/framework-46b0e263.js"])),"v-70e5a528":S(()=>h(()=>import("./index.html-89525fb9.js"),["assets/index.html-89525fb9.js","assets/framework-46b0e263.js"])),"v-31c4276b":S(()=>h(()=>import("./index.html-ca328bf3.js"),["assets/index.html-ca328bf3.js","assets/framework-46b0e263.js"])),"v-98ca8604":S(()=>h(()=>import("./index.html-5e4b3f7a.js"),["assets/index.html-5e4b3f7a.js","assets/framework-46b0e263.js"])),"v-5b5b9870":S(()=>h(()=>import("./index.html-f6507965.js"),["assets/index.html-f6507965.js","assets/framework-46b0e263.js"]))};var ul=Symbol(""),sl=z(cl),Da=mr({key:"",path:"",title:"",lang:"",frontmatter:{},headers:[]}),Be=z(Da),J=()=>Be,La=Symbol(""),oe=()=>{const e=Ve(La);if(!e)throw new Error("usePageFrontmatter() is called without provider.");return e},Aa=Symbol(""),dl=()=>{const e=Ve(Aa);if(!e)throw new Error("usePageHead() is called without provider.");return e},fl=Symbol(""),xa=Symbol(""),br=()=>{const e=Ve(xa);if(!e)throw new Error("usePageLang() is called without provider.");return e},Ca=Symbol(""),pl=()=>{const e=Ve(Ca);if(!e)throw new Error("usePageLayout() is called without provider.");return e},yr=Symbol(""),Je=()=>{const e=Ve(yr);if(!e)throw new Error("useRouteLocale() is called without provider.");return e},at=z(ll),Er=()=>at,Ra=Symbol(""),yn=()=>{const e=Ve(Ra);if(!e)throw new Error("useSiteLocaleData() is called without provider.");return e},ml=Symbol(""),vl="Layout",hl="NotFound",xe=Nc({resolveLayouts:e=>e.reduce((t,n)=>({...t,...n.layouts}),{}),resolvePageData:async e=>{const t=sl.value[e];return await(t==null?void 0:t())??Da},resolvePageFrontmatter:e=>e.frontmatter,resolvePageHead:(e,t,n)=>{const r=be(t.description)?t.description:n.description,o=[..._n(t.head)?t.head:[],...n.head,["title",{},e],["meta",{name:"description",content:r}]];return Hc(o)},resolvePageHeadTitle:(e,t)=>[e.title,t.title].filter(n=>!!n).join(" | "),resolvePageLang:e=>e.lang||"en",resolvePageLayout:(e,t)=>{let n;if(e.path){const r=e.frontmatter.layout;be(r)?n=r:n=vl}else n=hl;return t[n]},resolveRouteLocale:(e,t)=>Bc(e,t),resolveSiteLocaleData:(e,t)=>({...e,...e.locales[t]})}),En=j({name:"ClientOnly",setup(e,t){const n=z(!1);return re(()=>{n.value=!0}),()=>{var r,o;return n.value?(o=(r=t.slots).default)==null?void 0:o.call(r):null}}}),ja=j({name:"Content",props:{pageKey:{type:String,required:!1,default:""}},setup(e){const t=J(),n=I(()=>Ta[e.pageKey||t.value.key]);return()=>n.value?d(n.value):d("div","404 Not Found")}}),ke=(e={})=>e,Ke=e=>Vt(e)?e:`/${ka(e)}`;const gl={},Z=({name:e="",color:t="currentColor"},{slots:n})=>{var r;return d("svg",{xmlns:"http://www.w3.org/2000/svg",class:["icon",`${e}-icon`],viewBox:"0 0 1024 1024",fill:t,"aria-label":`${e} icon`},(r=n.default)==null?void 0:r.call(n))};Z.displayName="IconBase";const $a=(e,{slots:t})=>{var n;return((n=t.default)==null?void 0:n.call(t))||null},Va=()=>d(Z,{name:"github"},()=>d("path",{d:"M511.957 21.333C241.024 21.333 21.333 240.981 21.333 512c0 216.832 140.544 400.725 335.574 465.664 24.49 4.395 32.256-10.07 32.256-23.083 0-11.69.256-44.245 0-85.205-136.448 29.61-164.736-64.64-164.736-64.64-22.315-56.704-54.4-71.765-54.4-71.765-44.587-30.464 3.285-29.824 3.285-29.824 49.195 3.413 75.179 50.517 75.179 50.517 43.776 75.008 114.816 53.333 142.762 40.79 4.523-31.66 17.152-53.377 31.19-65.537-108.971-12.458-223.488-54.485-223.488-242.602 0-53.547 19.114-97.323 50.517-131.67-5.035-12.33-21.93-62.293 4.779-129.834 0 0 41.258-13.184 134.912 50.346a469.803 469.803 0 0 1 122.88-16.554c41.642.213 83.626 5.632 122.88 16.554 93.653-63.488 134.784-50.346 134.784-50.346 26.752 67.541 9.898 117.504 4.864 129.834 31.402 34.347 50.474 78.123 50.474 131.67 0 188.586-114.73 230.016-224.042 242.09 17.578 15.232 33.578 44.672 33.578 90.454v135.85c0 13.142 7.936 27.606 32.854 22.87C862.25 912.597 1002.667 728.747 1002.667 512c0-271.019-219.648-490.667-490.71-490.667z"}));Va.displayName="GitHubIcon";const za=()=>d(Z,{name:"gitlab"},()=>d("path",{d:"M229.333 78.688C223.52 62 199.895 62 193.895 78.688L87.958 406.438h247.5c-.188 0-106.125-327.75-106.125-327.75zM33.77 571.438c-4.875 15 .563 31.687 13.313 41.25l464.812 345L87.77 406.438zm301.5-165 176.813 551.25 176.812-551.25zm655.125 165-54-165-424.312 551.25 464.812-345c12.938-9.563 18.188-26.25 13.5-41.25zM830.27 78.688c-5.812-16.688-29.437-16.688-35.437 0l-106.125 327.75h247.5z"}));za.displayName="GitlabIcon";const Ma=()=>d(Z,{name:"gitee"},()=>d("path",{d:"M512 992C246.92 992 32 777.08 32 512S246.92 32 512 32s480 214.92 480 480-214.92 480-480 480zm242.97-533.34H482.39a23.7 23.7 0 0 0-23.7 23.7l-.03 59.28c0 13.08 10.59 23.7 23.7 23.7h165.96a23.7 23.7 0 0 1 23.7 23.7v11.85a71.1 71.1 0 0 1-71.1 71.1H375.71a23.7 23.7 0 0 1-23.7-23.7V423.11a71.1 71.1 0 0 1 71.1-71.1h331.8a23.7 23.7 0 0 0 23.7-23.7l.06-59.25a23.73 23.73 0 0 0-23.7-23.73H423.11a177.78 177.78 0 0 0-177.78 177.75v331.83c0 13.08 10.62 23.7 23.7 23.7h349.62a159.99 159.99 0 0 0 159.99-159.99V482.33a23.7 23.7 0 0 0-23.7-23.7z"}));Ma.displayName="GiteeIcon";const Na=()=>d(Z,{name:"bitbucket"},()=>d("path",{d:"M575.256 490.862c6.29 47.981-52.005 85.723-92.563 61.147-45.714-20.004-45.714-92.562-1.133-113.152 38.29-23.442 93.696 7.424 93.696 52.005zm63.451-11.996c-10.276-81.152-102.29-134.839-177.152-101.156-47.433 21.138-79.433 71.424-77.129 124.562 2.853 69.705 69.157 126.866 138.862 120.576S647.3 548.571 638.708 478.83zm136.558-309.723c-25.161-33.134-67.986-38.839-105.728-45.13-106.862-17.151-216.576-17.7-323.438 1.134-35.438 5.706-75.447 11.996-97.719 43.996 36.572 34.304 88.576 39.424 135.424 45.129 84.553 10.862 171.447 11.447 256 .585 47.433-5.705 99.987-10.276 135.424-45.714zm32.585 591.433c-16.018 55.99-6.839 131.438-66.304 163.986-102.29 56.576-226.304 62.867-338.87 42.862-59.43-10.862-129.135-29.696-161.72-85.723-14.3-54.858-23.442-110.848-32.585-166.84l3.438-9.142 10.276-5.157c170.277 112.567 408.576 112.567 579.438 0 26.844 8.01 6.84 40.558 6.29 60.014zm103.424-549.157c-19.42 125.148-41.728 249.71-63.415 374.272-6.29 36.572-41.728 57.162-71.424 72.558-106.862 53.724-231.424 62.866-348.562 50.286-79.433-8.558-160.585-29.696-225.134-79.433-30.28-23.443-30.28-63.415-35.986-97.134-20.005-117.138-42.862-234.277-57.161-352.585 6.839-51.42 64.585-73.728 107.447-89.71 57.16-21.138 118.272-30.866 178.87-36.571 129.134-12.58 261.157-8.01 386.304 28.562 44.581 13.13 92.563 31.415 122.844 69.705 13.714 17.7 9.143 40.01 6.29 60.014z"}));Na.displayName="BitbucketIcon";const Ha=()=>d(Z,{name:"source"},()=>d("path",{d:"M601.92 475.2c0 76.428-8.91 83.754-28.512 99.594-14.652 11.88-43.956 14.058-78.012 16.434-18.81 1.386-40.392 2.97-62.172 6.534-18.612 2.97-36.432 9.306-53.064 17.424V299.772c37.818-21.978 63.36-62.766 63.36-109.692 0-69.894-56.826-126.72-126.72-126.72S190.08 120.186 190.08 190.08c0 46.926 25.542 87.714 63.36 109.692v414.216c-37.818 21.978-63.36 62.766-63.36 109.692 0 69.894 56.826 126.72 126.72 126.72s126.72-56.826 126.72-126.72c0-31.086-11.286-59.598-29.7-81.576 13.266-9.504 27.522-17.226 39.996-19.206 16.038-2.574 32.868-3.762 50.688-5.148 48.312-3.366 103.158-7.326 148.896-44.55 61.182-49.698 74.25-103.158 75.24-187.902V475.2h-126.72zM316.8 126.72c34.848 0 63.36 28.512 63.36 63.36s-28.512 63.36-63.36 63.36-63.36-28.512-63.36-63.36 28.512-63.36 63.36-63.36zm0 760.32c-34.848 0-63.36-28.512-63.36-63.36s28.512-63.36 63.36-63.36 63.36 28.512 63.36 63.36-28.512 63.36-63.36 63.36zM823.68 158.4h-95.04V63.36h-126.72v95.04h-95.04v126.72h95.04v95.04h126.72v-95.04h95.04z"}));Ha.displayName="SourceIcon";const Ba=Array.isArray,_l=e=>typeof e=="function",ft=e=>typeof e=="string";var Fa=e=>/^(https?:)?\/\//.test(e),qa=e=>Object.prototype.toString.call(e)==="[object Object]",Nr=(e,t)=>{const n=Object.keys(e).sort((r,o)=>{const a=o.split("/").length-r.split("/").length;return a!==0?a:o.length-r.length});for(const r of n)if(t.startsWith(r))return r;return"/"};const we=(e,t)=>{const n=t?t._instance:vr();return qa(n==null?void 0:n.appContext.components)&&(e in n.appContext.components||Vr(e)in n.appContext.components||Fc(Vr(e))in n.appContext.components)},ht=e=>{const t=Ee(),n=z("/"),r=Er(),o=I(()=>e[n.value]);return X(()=>r.value,()=>{n.value=Nr(r.value.locales,t.path)}),X(()=>t.path,()=>{n.value=Nr(r.value.locales,t.path)},{immediate:!0}),o},Hr=e=>/\b(?:Android|iPhone)/i.test(e),Ua=(e,t)=>{let n=1;for(let r=0;r>6;return n+=n<<3,n^=n>>11,n%t};var On=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qn={},bl={get exports(){return qn},set exports(e){qn=e}};(function(e,t){(function(n,r){e.exports=r()})(On,function(){var n=1e3,r=6e4,o=36e5,a="millisecond",i="second",c="minute",l="hour",s="day",u="week",p="month",f="quarter",m="year",b="date",v="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var x=["th","st","nd","rd"],L=$%100;return"["+$+(x[(L-20)%10]||x[L]||x[0])+"]"}},w=function($,x,L){var M=String($);return!M||M.length>=x?$:""+Array(x+1-M.length).join(L)+$},O={s:w,z:function($){var x=-$.utcOffset(),L=Math.abs(x),M=Math.floor(L/60),A=L%60;return(x<=0?"+":"-")+w(M,2,"0")+":"+w(A,2,"0")},m:function $(x,L){if(x.date()1)return $(H[0])}else{var F=x.name;C[F]=x,A=F}return!M&&A&&(k=A),A||!M&&k},D=function($,x){if(T($))return $.clone();var L=typeof x=="object"?x:{};return L.date=$,L.args=arguments,new Y(L)},R=O;R.l=P,R.i=T,R.w=function($,x){return D($,{locale:x.$L,utc:x.$u,x:x.$x,$offset:x.$offset})};var Y=function(){function $(L){this.$L=P(L.locale,null,!0),this.parse(L)}var x=$.prototype;return x.parse=function(L){this.$d=function(M){var A=M.date,N=M.utc;if(A===null)return new Date(NaN);if(R.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var H=A.match(_);if(H){var F=H[2]-1||0,Q=(H[7]||"0").substring(0,3);return N?new Date(Date.UTC(H[1],F,H[3]||1,H[4]||0,H[5]||0,H[6]||0,Q)):new Date(H[1],F,H[3]||1,H[4]||0,H[5]||0,H[6]||0,Q)}}return new Date(A)}(L),this.$x=L.x||{},this.init()},x.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},x.$utils=function(){return R},x.isValid=function(){return this.$d.toString()!==v},x.isSame=function(L,M){var A=D(L);return this.startOf(M)<=A&&A<=this.endOf(M)},x.isAfter=function(L,M){return D(L)=0?1:y.date()),w=_.year||y.year(),O=_.month>=0?_.month:_.year||_.day?0:y.month(),k=_.hour||0,C=_.minute||0,T=_.second||0,P=_.millisecond||0;return v?new Date(Date.UTC(w,O,E,k,C,T,P)):new Date(w,O,E,k,C,T,P)}return b},c=a.parse;a.parse=function(f){f.date=i.bind(this)(f),c.bind(this)(f)};var l=a.set,s=a.add,u=a.subtract,p=function(f,m,b,v){v===void 0&&(v=1);var _=Object.keys(m),y=this;return _.forEach(function(E){y=f.bind(y)(m[E]*v,E)}),y};a.set=function(f,m){return m=m===void 0?f:m,f.constructor.name==="Object"?p.bind(this)(function(b,v){return l.bind(this)(v,b)},m,f):l.bind(this)(f,m)},a.add=function(f,m){return f.constructor.name==="Object"?p.bind(this)(s,f,m):s.bind(this)(f,m)},a.subtract=function(f,m){return f.constructor.name==="Object"?p.bind(this)(s,f,m,-1):u.bind(this)(f,m)}}})})(yl);var El=Un,Wn={},Ol={get exports(){return Wn},set exports(e){Wn=e}};(function(e,t){(function(n,r){e.exports=r()})(On,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(o,a,i){var c,l=function(f,m,b){b===void 0&&(b={});var v=new Date(f),_=function(y,E){E===void 0&&(E={});var w=E.timeZoneName||"short",O=y+"|"+w,k=r[O];return k||(k=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:y,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:w}),r[O]=k),k}(m,b);return _.formatToParts(v)},s=function(f,m){for(var b=l(f,m),v=[],_=0;_=0&&(v[O]=parseInt(w,10))}var k=v[3],C=k===24?0:k,T=v[0]+"-"+v[1]+"-"+v[2]+" "+C+":"+v[4]+":"+v[5]+":000",P=+f;return(i.utc(T).valueOf()-(P-=P%1e3))/6e4},u=a.prototype;u.tz=function(f,m){f===void 0&&(f=c);var b=this.utcOffset(),v=this.toDate(),_=v.toLocaleString("en-US",{timeZone:f}),y=Math.round((v-new Date(_))/1e3/60),E=i(_).$set("millisecond",this.$ms).utcOffset(15*-Math.round(v.getTimezoneOffset()/15)-y,!0);if(m){var w=E.utcOffset();E=E.add(b-w,"minute")}return E.$x.$timezone=f,E},u.offsetName=function(f){var m=this.$x.$timezone||i.tz.guess(),b=l(this.valueOf(),m,{timeZoneName:f}).find(function(v){return v.type.toLowerCase()==="timezonename"});return b&&b.value};var p=u.startOf;u.startOf=function(f,m){if(!this.$x||!this.$x.$timezone)return p.call(this,f,m);var b=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return p.call(b,f,m).tz(this.$x.$timezone,!0)},i.tz=function(f,m,b){var v=b&&m,_=b||m||c,y=s(+i(),_);if(typeof f!="string")return i(f).tz(_);var E=function(C,T,P){var D=C-60*T*1e3,R=s(D,P);if(T===R)return[D,T];var Y=s(D-=60*(R-T)*1e3,P);return R===Y?[D,R]:[C-60*Math.min(R,Y)*1e3,Math.max(R,Y)]}(i.utc(f,v).valueOf(),y,_),w=E[0],O=E[1],k=i(w).utcOffset(O);return k.$x.$timezone=_,k},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(f){c=f}}})})(Ol);var wl=Wn,Gn={},Sl={get exports(){return Gn},set exports(e){Gn=e}};(function(e,t){(function(n,r){e.exports=r()})(On,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(a,i,c){var l=i.prototype;c.utc=function(v){var _={date:v,utc:!0,args:arguments};return new i(_)},l.utc=function(v){var _=c(this.toDate(),{locale:this.$L,utc:!0});return v?_.add(this.utcOffset(),n):_},l.local=function(){return c(this.toDate(),{locale:this.$L,utc:!1})};var s=l.parse;l.parse=function(v){v.utc&&(this.$u=!0),this.$utils().u(v.$offset)||(this.$offset=v.$offset),s.call(this,v)};var u=l.init;l.init=function(){if(this.$u){var v=this.$d;this.$y=v.getUTCFullYear(),this.$M=v.getUTCMonth(),this.$D=v.getUTCDate(),this.$W=v.getUTCDay(),this.$H=v.getUTCHours(),this.$m=v.getUTCMinutes(),this.$s=v.getUTCSeconds(),this.$ms=v.getUTCMilliseconds()}else u.call(this)};var p=l.utcOffset;l.utcOffset=function(v,_){var y=this.$utils().u;if(y(v))return this.$u?0:y(this.$offset)?p.call(this):this.$offset;if(typeof v=="string"&&(v=function(k){k===void 0&&(k="");var C=k.match(r);if(!C)return null;var T=(""+C[0]).match(o)||["-",0,0],P=T[0],D=60*+T[1]+ +T[2];return D===0?0:P==="+"?D:-D}(v),v===null))return this;var E=Math.abs(v)<=16?60*v:v,w=this;if(_)return w.$offset=E,w.$u=v===0,w;if(v!==0){var O=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(w=this.local().add(E+O,n)).$offset=E,w.$x.$localOffset=O}else w=this.utc();return w};var f=l.format;l.format=function(v){var _=v||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,_)},l.valueOf=function(){var v=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*v},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var m=l.toDate;l.toDate=function(v){return v==="s"&&this.$offset?c(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():m.call(this)};var b=l.diff;l.diff=function(v,_,y){if(v&&this.$u===v.$u)return b.call(this,v,_,y);var E=this.local(),w=c(v).local();return b.call(E,w,_,y)}}})})(Sl);var kl=Gn;Ge.extend(El),Ge.extend(kl),Ge.extend(wl);const Br=(e,t)=>{if(e){if(Ge(e instanceof Date?e:e.trim()).isValid()){const r=t?Ge(e).tz(t):Ge(e),o=r.year(),a=r.month()+1,i=r.date(),c=r.hour(),l=r.minute(),s=r.second(),u=r.millisecond(),p=c===0&&l===0&&s===0&&u===0;return{value:r.toDate(),info:{year:o,month:a,day:i,...p?{}:{hour:c,minute:l,second:s}},type:p?"date":"full"}}const n=/(?:(\d{2,4})[/-](\d{1,2})[/-](\d{1,2}))?\s*(?:(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?/u.exec(e.trim());if(n){const[,r,o,a,i,c,l]=n,s=_=>typeof _>"u"?void 0:Number(_),u=_=>_&&_<100?_+2e3:_,p=_=>i&&c&&!l?0:_,f={year:u(s(r)),month:s(o),day:s(a),hour:s(i),minute:s(c),second:p(s(l))},m=r===void 0&&o===void 0&&a===void 0,b=i===void 0&&c===void 0&&l===void 0,v=Ge({...f,month:f.month-1}).toDate();return{value:m?void 0:v,info:b?{year:f.year,month:f.month,day:f.day}:m?{hour:f.hour,minute:f.minute,second:f.second}:f,type:m?"time":b?"date":"full"}}}return null},pt=(e,t)=>ft(e)&&e.startsWith(t),Xe=(e,t)=>ft(e)&&e.endsWith(t),Pl=Object.entries,Qe=Object.keys,Fr=(e,t=!1)=>e?Ba(e)?e.map(n=>ft(n)?{name:n}:n):ft(e)?[{name:e}]:qa(e)&&e.name?[e]:(console.error(`Expect "author" to be \`AuthorInfo[] | AuthorInfo | string[] | string ${t?"":"| false"} | undefined\`, but got`,e),[]):[],Wa=(e,t)=>{if(e){if(Ba(e))return e;if(ft(e))return[e];console.error(`Expect ${t||"value"} to be \`string[] | string | undefined\`, but got`,e)}return[]},Il=e=>Wa(e,"category"),Tl=e=>Wa(e,"tag"),Or=e=>pt(e,"/"),Ga=/#.*$/u,Dl=e=>{const t=Ga.exec(e);return t?t[0]:""},qr=e=>decodeURI(e).replace(Ga,"").replace(/(index)?\.(md|html)$/,""),wr=(e,t)=>{if(t===void 0)return!1;const n=qr(e.path),r=qr(t),o=Dl(t);return o?o===e.hash&&(!r||n===r):n===r},Ll=e=>Fa(e)?e:`https://github.com/${e}`,Ka=e=>!Fa(e)||/github\.com/.test(e)?"GitHub":/bitbucket\.org/.test(e)?"Bitbucket":/gitlab\.com/.test(e)?"GitLab":/gitee\.com/.test(e)?"Gitee":null,Sr=(e,...t)=>{const n=e.resolve(...t),r=n.matched[n.matched.length-1];if(!(r!=null&&r.redirect))return n;const{redirect:o}=r,a=_l(o)?o(n):o,i=ft(a)?{path:a}:a;return Sr(e,{hash:n.hash,query:n.query,params:n.params,...i})};var Ur;const Mt=typeof window<"u",Al=e=>typeof e=="function",xl=e=>typeof e=="string",ln=()=>{};Mt&&((Ur=window==null?void 0:window.navigator)!=null&&Ur.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function je(e){return typeof e=="function"?e():qc(e)}function Ya(e,t){function n(...r){return new Promise((o,a)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(o).catch(a)})}return n}const Ja=e=>e();function Cl(e,t=!0,n=!0,r=!1){let o=0,a,i=!0,c=ln,l;const s=()=>{a&&(clearTimeout(a),a=void 0,c(),c=ln)};return p=>{const f=je(e),m=Date.now()-o,b=()=>l=p();return s(),f<=0?(o=Date.now(),b()):(m>f&&(n||!i)?(o=Date.now(),b()):t&&(l=new Promise((v,_)=>{c=r?_:v,a=setTimeout(()=>{o=Date.now(),i=!0,v(b()),s()},Math.max(0,f-m))})),!n&&!a&&(a=setTimeout(()=>i=!0,f)),i=!1,l)}}function Rl(e=Ja){const t=z(!0);function n(){t.value=!1}function r(){t.value=!0}const o=(...a)=>{t.value&&e(...a)};return{isActive:mr(t),pause:n,resume:r,eventFilter:o}}function jl(e){return e}function Nt(e){return Uc()?(Wc(e),!0):!1}function $l(e,t=200,n=!1,r=!0,o=!1){return Ya(Cl(t,n,r,o),e)}function Vl(e){return typeof e=="function"?I(e):z(e)}function Qa(e,t=!0){vr()?re(e):t?e():zt(e)}function zl(e){vr()&&hr(e)}function Ml(e,t,n={}){const{immediate:r=!0}=n,o=z(!1);let a=null;function i(){a&&(clearTimeout(a),a=null)}function c(){o.value=!1,i()}function l(...s){i(),o.value=!0,a=setTimeout(()=>{o.value=!1,a=null,e(...s)},je(t))}return r&&(o.value=!0,Mt&&l()),Nt(c),{isPending:mr(o),start:l,stop:c}}var Wr=Object.getOwnPropertySymbols,Nl=Object.prototype.hasOwnProperty,Hl=Object.prototype.propertyIsEnumerable,Bl=(e,t)=>{var n={};for(var r in e)Nl.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wr)for(var r of Wr(e))t.indexOf(r)<0&&Hl.call(e,r)&&(n[r]=e[r]);return n};function Fl(e,t,n={}){const r=n,{eventFilter:o=Ja}=r,a=Bl(r,["eventFilter"]);return X(e,Ya(o,t),a)}var ql=Object.defineProperty,Ul=Object.defineProperties,Wl=Object.getOwnPropertyDescriptors,un=Object.getOwnPropertySymbols,Za=Object.prototype.hasOwnProperty,Xa=Object.prototype.propertyIsEnumerable,Gr=(e,t,n)=>t in e?ql(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gl=(e,t)=>{for(var n in t||(t={}))Za.call(t,n)&&Gr(e,n,t[n]);if(un)for(var n of un(t))Xa.call(t,n)&&Gr(e,n,t[n]);return e},Kl=(e,t)=>Ul(e,Wl(t)),Yl=(e,t)=>{var n={};for(var r in e)Za.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&un)for(var r of un(e))t.indexOf(r)<0&&Xa.call(e,r)&&(n[r]=e[r]);return n};function Jl(e,t,n={}){const r=n,{eventFilter:o}=r,a=Yl(r,["eventFilter"]),{eventFilter:i,pause:c,resume:l,isActive:s}=Rl(o);return{stop:Fl(e,t,Kl(Gl({},a),{eventFilter:i})),pause:c,resume:l,isActive:s}}function kr(e){var t;const n=je(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Ye=Mt?window:void 0,ei=Mt?window.document:void 0,Ql=Mt?window.navigator:void 0;function Le(...e){let t,n,r,o;if(xl(e[0])||Array.isArray(e[0])?([n,r,o]=e,t=Ye):[t,n,r,o]=e,!t)return ln;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const a=[],i=()=>{a.forEach(u=>u()),a.length=0},c=(u,p,f,m)=>(u.addEventListener(p,f,m),()=>u.removeEventListener(p,f,m)),l=X(()=>[kr(t),je(o)],([u,p])=>{i(),u&&a.push(...n.flatMap(f=>r.map(m=>c(u,f,m,p))))},{immediate:!0,flush:"post"}),s=()=>{l(),i()};return Nt(s),s}function wn(e,t=!1){const n=z(),r=()=>n.value=Boolean(e());return r(),Qa(r,t),n}function Zl(e,t={}){const{window:n=Ye}=t,r=wn(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let o;const a=z(!1),i=()=>{o&&("removeEventListener"in o?o.removeEventListener("change",c):o.removeListener(c))},c=()=>{r.value&&(i(),o=n.matchMedia(Vl(e).value),a.value=o.matches,"addEventListener"in o?o.addEventListener("change",c):o.addListener(c))};return Kc(c),Nt(()=>i()),a}function Xl(e={}){const{navigator:t=Ql,read:n=!1,source:r,copiedDuring:o=1500,legacy:a=!1}=e,i=["copy","cut"],c=wn(()=>t&&"clipboard"in t),l=I(()=>c.value||a),s=z(""),u=z(!1),p=Ml(()=>u.value=!1,o);function f(){c.value?t.clipboard.readText().then(_=>{s.value=_}):s.value=v()}if(l.value&&n)for(const _ of i)Le(_,f);async function m(_=je(r)){l.value&&_!=null&&(c.value?await t.clipboard.writeText(_):b(_),s.value=_,u.value=!0,p.start())}function b(_){const y=document.createElement("textarea");y.value=_??"",y.style.position="absolute",y.style.opacity="0",document.body.appendChild(y),y.select(),document.execCommand("copy"),y.remove()}function v(){var _,y,E;return(E=(y=(_=document==null?void 0:document.getSelection)==null?void 0:_.call(document))==null?void 0:y.toString())!=null?E:""}return{isSupported:l,text:s,copied:u,copy:m}}const Kn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Yn="__vueuse_ssr_handlers__";Kn[Yn]=Kn[Yn]||{};const eu=Kn[Yn];function tu(e,t){return eu[e]||t}function nu(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}var ru=Object.defineProperty,Kr=Object.getOwnPropertySymbols,ou=Object.prototype.hasOwnProperty,au=Object.prototype.propertyIsEnumerable,Yr=(e,t,n)=>t in e?ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jr=(e,t)=>{for(var n in t||(t={}))ou.call(t,n)&&Yr(e,n,t[n]);if(Kr)for(var n of Kr(t))au.call(t,n)&&Yr(e,n,t[n]);return e};const iu={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Qr="vueuse-storage";function Ht(e,t,n,r={}){var o;const{flush:a="pre",deep:i=!0,listenToStorageChanges:c=!0,writeDefaults:l=!0,mergeDefaults:s=!1,shallow:u,window:p=Ye,eventFilter:f,onError:m=P=>{console.error(P)}}=r,b=(u?Gc:z)(t);if(!n)try{n=tu("getDefaultStorage",()=>{var P;return(P=Ye)==null?void 0:P.localStorage})()}catch(P){m(P)}if(!n)return b;const v=je(t),_=nu(v),y=(o=r.serializer)!=null?o:iu[_],{pause:E,resume:w}=Jl(b,()=>O(b.value),{flush:a,deep:i,eventFilter:f});return p&&c&&(Le(p,"storage",T),Le(p,Qr,C)),T(),b;function O(P){try{if(P==null)n.removeItem(e);else{const D=y.write(P),R=n.getItem(e);R!==D&&(n.setItem(e,D),p&&p.dispatchEvent(new CustomEvent(Qr,{detail:{key:e,oldValue:R,newValue:D,storageArea:n}})))}}catch(D){m(D)}}function k(P){const D=P?P.newValue:n.getItem(e);if(D==null)return l&&v!==null&&n.setItem(e,y.write(v)),v;if(!P&&s){const R=y.read(D);return Al(s)?s(R,v):_==="object"&&!Array.isArray(R)?Jr(Jr({},v),R):R}else return typeof D!="string"?D:y.read(D)}function C(P){T(P.detail)}function T(P){if(!(P&&P.storageArea!==n)){if(P&&P.key==null){b.value=v;return}if(!(P&&P.key!==e)){E();try{b.value=k(P)}catch(D){m(D)}finally{P?zt(w):w()}}}}}function cu(e){return Zl("(prefers-color-scheme: dark)",e)}const Zr=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]];function Pr(e,t={}){const{document:n=ei,autoExit:r=!1}=t,o=e||(n==null?void 0:n.querySelector("html")),a=z(!1);let i=Zr[0];const c=wn(()=>{if(n){for(const v of Zr)if(v[1]in n)return i=v,!0}else return!1;return!1}),[l,s,u,,p]=i;async function f(){c.value&&(n!=null&&n[u]&&await n[s](),a.value=!1)}async function m(){if(!c.value)return;await f();const v=kr(o);v&&(await v[l](),a.value=!0)}async function b(){a.value?await f():await m()}return n&&Le(n,p,()=>{a.value=!!(n!=null&&n[u])},!1),r&&Nt(f),{isSupported:c,isFullscreen:a,enter:m,exit:f,toggle:b}}var Xr=Object.getOwnPropertySymbols,lu=Object.prototype.hasOwnProperty,uu=Object.prototype.propertyIsEnumerable,su=(e,t)=>{var n={};for(var r in e)lu.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xr)for(var r of Xr(e))t.indexOf(r)<0&&uu.call(e,r)&&(n[r]=e[r]);return n};function du(e,t,n={}){const r=n,{window:o=Ye}=r,a=su(r,["window"]);let i;const c=wn(()=>o&&"MutationObserver"in o),l=()=>{i&&(i.disconnect(),i=void 0)},s=X(()=>kr(e),p=>{l(),c.value&&o&&p&&(i=new MutationObserver(t),i.observe(p,a))},{immediate:!0}),u=()=>{l(),s()};return Nt(u),{isSupported:c,stop:u}}var eo;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(eo||(eo={}));function fu(e,t=ln,n={}){const{immediate:r=!0,manual:o=!1,type:a="text/javascript",async:i=!0,crossOrigin:c,referrerPolicy:l,noModule:s,defer:u,document:p=ei,attrs:f={}}=n,m=z(null);let b=null;const v=E=>new Promise((w,O)=>{const k=P=>(m.value=P,w(P),P);if(!p){w(!1);return}let C=!1,T=p.querySelector(`script[src="${je(e)}"]`);T?T.hasAttribute("data-loaded")&&k(T):(T=p.createElement("script"),T.type=a,T.async=i,T.src=je(e),u&&(T.defer=u),c&&(T.crossOrigin=c),s&&(T.noModule=s),l&&(T.referrerPolicy=l),Object.entries(f).forEach(([P,D])=>T==null?void 0:T.setAttribute(P,D)),C=!0),T.addEventListener("error",P=>O(P)),T.addEventListener("abort",P=>O(P)),T.addEventListener("load",()=>{T.setAttribute("data-loaded","true"),t(T),k(T)}),C&&(T=p.head.appendChild(T)),E||k(T)}),_=(E=!0)=>(b||(b=v(E)),b),y=()=>{if(!p)return;b=null,m.value&&(m.value=null);const E=p.querySelector(`script[src="${je(e)}"]`);E&&p.head.removeChild(E)};return r&&!o&&Qa(_),o||zl(y),{scriptTag:m,load:_,unload:y}}function ti(e,t,n={}){const{window:r=Ye}=n;return Ht(e,t,r==null?void 0:r.sessionStorage,n)}var pu=Object.defineProperty,to=Object.getOwnPropertySymbols,mu=Object.prototype.hasOwnProperty,vu=Object.prototype.propertyIsEnumerable,no=(e,t,n)=>t in e?pu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hu=(e,t)=>{for(var n in t||(t={}))mu.call(t,n)&&no(e,n,t[n]);if(to)for(var n of to(t))vu.call(t,n)&&no(e,n,t[n]);return e};const gu={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};hu({linear:jl},gu);function _u({window:e=Ye}={}){if(!e)return{x:z(0),y:z(0)};const t=z(e.scrollX),n=z(e.scrollY);return Le(e,"scroll",()=>{t.value=e.scrollX,n.value=e.scrollY},{capture:!1,passive:!0}),{x:t,y:n}}const ni=({type:e="info",text:t="",vertical:n="top",color:r},{slots:o})=>{var a;return d("span",{class:["badge",e,{diy:r}],style:{verticalAlign:n,...r?{backgroundColor:r}:{}}},t||((a=o.default)==null?void 0:a.call(o)))};ni.displayName="Badge";var bu=j({name:"FontIcon",props:{icon:{type:String,default:""},color:{type:String,default:""},size:{type:[String,Number],default:""}},setup(e){const t=I(()=>{const r=["font-icon icon"];return`${e.icon}`,r}),n=I(()=>{const r={};return e.color&&(r.color=e.color),e.size&&(r["font-size"]=Number.isNaN(Number(e.size))?e.size:`${e.size}px`),Qe(r).length?r:null});return()=>e.icon?d("iconify-icon",{key:e.icon,class:t.value,style:n.value,inline:"",icon:`${e.icon}`}):null}});const ri=()=>d(Z,{name:"back-to-top"},()=>[d("path",{d:"M512 843.2c-36.2 0-66.4-13.6-85.8-21.8-10.8-4.6-22.6 3.6-21.8 15.2l7 102c.4 6.2 7.6 9.4 12.6 5.6l29-22c3.6-2.8 9-1.8 11.4 2l41 64.2c3 4.8 10.2 4.8 13.2 0l41-64.2c2.4-3.8 7.8-4.8 11.4-2l29 22c5 3.8 12.2.6 12.6-5.6l7-102c.8-11.6-11-20-21.8-15.2-19.6 8.2-49.6 21.8-85.8 21.8z"}),d("path",{d:"m795.4 586.2-96-98.2C699.4 172 513 32 513 32S324.8 172 324.8 488l-96 98.2c-3.6 3.6-5.2 9-4.4 14.2L261.2 824c1.8 11.4 14.2 17 23.6 10.8L419 744s41.4 40 94.2 40c52.8 0 92.2-40 92.2-40l134.2 90.8c9.2 6.2 21.6.6 23.6-10.8l37-223.8c.4-5.2-1.2-10.4-4.8-14zM513 384c-34 0-61.4-28.6-61.4-64s27.6-64 61.4-64c34 0 61.4 28.6 61.4 64S547 384 513 384z"})]);ri.displayName="BackToTopIcon";var yu=j({name:"BackToTop",props:{threshold:{type:Number,default:300}},setup(e){const t=oe(),n=ht({"/zh/":{backToTop:"返回顶部"},"/":{backToTop:"Back to top"}}),{y:r}=_u(),o=I(()=>t.value.backToTop!==!1&&r.value>e.threshold);return()=>d(dt,{name:"fade"},()=>o.value?d("button",{class:"back-to-top","aria-label":n.value.backToTop,"data-balloon-pos":"left",onClick:()=>{window.scrollTo({top:0,behavior:"smooth"})}},d(ri)):null)}});const Eu=ke({enhance:({app:e})=>{we("Badge")||e.component("Badge",ni),we("FontIcon")||e.component("FontIcon",bu)},setup:()=>{fu("//cdn.jsdelivr.net/npm/iconify-icon@1")},rootComponents:[()=>d(yu,{threshold:300})]});function oi(e,t,n){var r,o,a;t===void 0&&(t=50),n===void 0&&(n={});var i=(r=n.isImmediate)!=null&&r,c=(o=n.callback)!=null&&o,l=n.maxWait,s=Date.now(),u=[];function p(){if(l!==void 0){var m=Date.now()-s;if(m+t>=l)return l-m}return t}var f=function(){var m=[].slice.call(arguments),b=this;return new Promise(function(v,_){var y=i&&a===void 0;if(a!==void 0&&clearTimeout(a),a=setTimeout(function(){if(a=void 0,s=Date.now(),!i){var w=e.apply(b,m);c&&c(w),u.forEach(function(O){return(0,O.resolve)(w)}),u=[]}},p()),y){var E=e.apply(b,m);return c&&c(E),v(E)}u.push({resolve:v,reject:_})})};return f.cancel=function(m){a!==void 0&&clearTimeout(a),u.forEach(function(b){return(0,b.reject)(m)}),u=[]},f}const Ou=({headerLinkSelector:e,headerAnchorSelector:t,delay:n,offset:r=5})=>{const o=Se(),i=oi(()=>{var v,_;const c=Math.max(window.scrollY,document.documentElement.scrollTop,document.body.scrollTop);if(Math.abs(c-0)f.some(E=>E.hash===y.hash));for(let y=0;y=(((v=E.parentElement)==null?void 0:v.offsetTop)??0)-r,k=!w||c<(((_=w.parentElement)==null?void 0:_.offsetTop)??0)-r;if(!(O&&k))continue;const T=decodeURIComponent(o.currentRoute.value.hash),P=decodeURIComponent(E.hash);if(T===P)return;if(p){for(let D=y+1;D{window.addEventListener("scroll",i)}),Yc(()=>{window.removeEventListener("scroll",i)})},ro=async(e,t)=>{const{scrollBehavior:n}=e.options;e.options.scrollBehavior=void 0,await e.replace({query:e.currentRoute.value.query,hash:t,force:!0}).finally(()=>e.options.scrollBehavior=n)},wu=".sidebar-link, .toc-link",Su=".header-anchor",ku=200,Pu=5,Iu=ke({setup(){Ou({headerLinkSelector:wu,headerAnchorSelector:Su,delay:ku,offset:Pu})}});var Tu=j({name:"AutoCatalog",props:{base:{type:String,default:""},level:{type:Number,default:3},index:Boolean,titleGetter:{type:Function,default:e=>e.t||""},iconGetter:{type:Function,default:e=>e.i},orderGetter:{type:Function,default:e=>e.O||0},shouldIndex:{type:Function,default:e=>{const t=e.I;return t===void 0||t}}},setup(e,{slots:t}){const n=ht({"/zh/":{title:"目录"},"/":{title:"Catalog"}}),r=J(),o=Se(),a=Er(),i=()=>{const l=e.base||r.value.path.replace(/\/[^/]+$/,"/"),s=o.getRoutes(),u=[];return s.filter(({meta:p,path:f})=>{if(!pt(f,l)||f===l)return!1;if(l==="/"){const m=Qe(a.value.locales).filter(b=>b!=="/");if(f==="/404.html"||m.some(b=>pt(f,b)))return!1}return(Xe(f,".html")&&!Xe(f,"/index.html")||Xe(f,"/"))&&e.shouldIndex(p)}).map(({path:p,meta:f})=>{const m=p.substring(l.length).split("/").length;return{title:e.titleGetter(f),icon:e.iconGetter(f),base:p.replace(/\/[^/]+\/?$/,"/"),order:e.orderGetter(f)||null,level:Xe(p,"/")?m-1:m,path:p}}).filter(({title:p,level:f})=>typeof p=="string"&&p&&f<=e.level).sort(({title:p,level:f,path:m,order:b},{title:v,level:_,path:y,order:E})=>f-_||(Xe(m,"/index.html")?-1:Xe(y,"/index.html")?1:b===null?E===null?p.localeCompare(v):E:E===null?b:b>0?E>0?b-E:-1:E<0?b-E:1)).forEach(p=>{var f;const{base:m,level:b}=p;switch(b){case 1:u.push(p);break;case 2:{const v=u.find(_=>_.path===m);v&&(v.children??(v.children=[])).push(p);break}default:{const v=u.find(_=>_.path===m.replace(/\/[^/]+\/$/,"/"));if(v){const _=(f=v.children)==null?void 0:f.find(y=>y.path===m);_&&(_.children??(_.children=[])).push(p)}}}}),u},c=I(()=>i());return()=>d("div",{class:"auto-catalog-wrapper"},[d("h2",{class:"main-title"},n.value.title),...c.value.map(({children:l=[],icon:s,path:u,title:p},f)=>[d("h3",{id:p,class:["child-title",{"has-children":l.length}]},[d("a",{href:`#${p}`,class:"header-anchor"},"#"),d(Re,{class:"catalog-title",to:u},()=>[e.index?`${f+1}.`:null,s&&t.icon?t.icon({icon:s}):null,p||"Unknown"])]),l.length?d("ul",{class:"child-catalog-wrapper"},l.map(({children:m=[],icon:b,path:v,title:_},y)=>d("li",{class:"child-catalog-item"},[d("div",{class:["sub-title",{"has-children":m.length}]},[d("a",{href:`#${_}`,class:"header-anchor"},"#"),d(Re,{class:"catalog-title",to:v},()=>[e.index?`${f+1}.${y+1}`:null,b&&t.icon?t.icon({icon:b}):null,_||"Unknown"])]),m.length?d("div",{class:"sub-catalog-wrapper"},m.map(({icon:E,path:w,title:O},k)=>d(Re,{class:"sub-catalog-item",to:w},()=>[e.index?`${f+1}.${y+1}.${k+1}`:null,E&&t.icon?t.icon({icon:E}):null,O||"Unknown"]))):null]))):null])])}}),Du=ke({enhance:({app:e})=>{we("AutoCatalog",e)||e.component("AutoCatalog",t=>d(Tu,t,{icon:({icon:n})=>d(ye("HopeIcon"),{icon:n})}))}});const Lu=d("svg",{class:"external-link-icon",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"},[d("path",{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}),d("polygon",{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"})]),ai=j({name:"ExternalLinkIcon",props:{locales:{type:Object,required:!1,default:()=>({})}},setup(e){const t=Je(),n=I(()=>e.locales[t.value]??{openInNewWindow:"open in new window"});return()=>d("span",[Lu,d("span",{class:"external-link-icon-sr-only"},n.value.openInNewWindow)])}}),Au={},xu=ke({enhance({app:e}){e.component("ExternalLinkIcon",d(ai,{locales:Au}))}});/** + * NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT + */const U={settings:{minimum:.08,easing:"ease",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,barSelector:'[role="bar"]',parent:"body",template:'
'},status:null,set:e=>{const t=U.isStarted();e=xn(e,U.settings.minimum,1),U.status=e===1?null:e;const n=U.render(!t),r=n.querySelector(U.settings.barSelector),o=U.settings.speed,a=U.settings.easing;return n.offsetWidth,Cu(i=>{qt(r,{transform:"translate3d("+oo(e)+"%,0,0)",transition:"all "+o+"ms "+a}),e===1?(qt(n,{transition:"none",opacity:"1"}),n.offsetWidth,setTimeout(function(){qt(n,{transition:"all "+o+"ms linear",opacity:"0"}),setTimeout(function(){U.remove(),i()},o)},o)):setTimeout(()=>i(),o)}),U},isStarted:()=>typeof U.status=="number",start:()=>{U.status||U.set(0);const e=()=>{setTimeout(()=>{U.status&&(U.trickle(),e())},U.settings.trickleSpeed)};return U.settings.trickle&&e(),U},done:e=>!e&&!U.status?U:U.inc(.3+.5*Math.random()).set(1),inc:e=>{let t=U.status;return t?(typeof e!="number"&&(e=(1-t)*xn(Math.random()*t,.1,.95)),t=xn(t+e,0,.994),U.set(t)):U.start()},trickle:()=>U.inc(Math.random()*U.settings.trickleRate),render:e=>{if(U.isRendered())return document.getElementById("nprogress");ao(document.documentElement,"nprogress-busy");const t=document.createElement("div");t.id="nprogress",t.innerHTML=U.settings.template;const n=t.querySelector(U.settings.barSelector),r=e?"-100":oo(U.status||0),o=document.querySelector(U.settings.parent);return qt(n,{transition:"all 0 linear",transform:"translate3d("+r+"%,0,0)"}),o!==document.body&&ao(o,"nprogress-custom-parent"),o==null||o.appendChild(t),t},remove:()=>{io(document.documentElement,"nprogress-busy"),io(document.querySelector(U.settings.parent),"nprogress-custom-parent");const e=document.getElementById("nprogress");e&&Ru(e)},isRendered:()=>!!document.getElementById("nprogress")},xn=(e,t,n)=>en?n:e,oo=e=>(-1+e)*100,Cu=function(){const e=[];function t(){const n=e.shift();n&&n(t)}return function(n){e.push(n),e.length===1&&t()}}(),qt=function(){const e=["Webkit","O","Moz","ms"],t={};function n(i){return i.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(c,l){return l.toUpperCase()})}function r(i){const c=document.body.style;if(i in c)return i;let l=e.length;const s=i.charAt(0).toUpperCase()+i.slice(1);let u;for(;l--;)if(u=e[l]+s,u in c)return u;return i}function o(i){return i=n(i),t[i]||(t[i]=r(i))}function a(i,c,l){c=o(c),i.style[c]=l}return function(i,c){for(const l in c){const s=c[l];s!==void 0&&Object.prototype.hasOwnProperty.call(c,l)&&a(i,l,s)}}}(),ii=(e,t)=>(typeof e=="string"?e:Ir(e)).indexOf(" "+t+" ")>=0,ao=(e,t)=>{const n=Ir(e),r=n+t;ii(n,t)||(e.className=r.substring(1))},io=(e,t)=>{const n=Ir(e);if(!ii(e,t))return;const r=n.replace(" "+t+" "," ");e.className=r.substring(1,r.length-1)},Ir=e=>(" "+(e.className||"")+" ").replace(/\s+/gi," "),Ru=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)};const ju=()=>{re(()=>{const e=Se(),t=new Set;t.add(e.currentRoute.value.path),e.beforeEach(n=>{t.has(n.path)||U.start()}),e.afterEach(n=>{t.add(n.path),U.done()})})},$u=ke({setup(){ju()}}),Vu=JSON.parse(`{"encrypt":{"config":{"/demo/encrypt.html":["$2a$10$.Ki1u6pPQBf2VsAnl3mxC.nnSG3.CxYoKTJxoAnuG4zciSu5OhUNi"],"/zh/demo/encrypt.html":["$2a$10$VMZL0RZE/cLdRVe3W6RIJuJlgNz.1MNCUlHv.oGJwKtl/qMjHir8C"]}},"locales":{"/zh/":{"lang":"zh-CN","navbarLocales":{"langName":"简体中文","selectLangAriaLabel":"选择语言"},"metaLocales":{"author":"作者","date":"写作日期","origin":"原创","views":"访问量","category":"分类","tag":"标签","readingTime":"阅读时间","words":"字数","toc":"此页内容","prev":"上一页","next":"下一页","lastUpdated":"上次编辑于","contributors":"贡献者","editLink":"在 GitHub 上编辑此页"},"outlookLocales":{"themeColor":"主题色","darkmode":"外观","fullscreen":"全屏"},"encryptLocales":{"iconLabel":"文章已加密","placeholder":"输入密码","remember":"记住密码","errorHint":"请输入正确的密码"},"routeLocales":{"skipToContent":"跳至主要內容","notFoundTitle":"页面不存在","notFoundMsg":["这里什么也没有","我们是怎么来到这儿的?","这 是 四 零 四 !","看起来你访问了一个失效的链接"],"back":"返回上一页","home":"带我回家","openInNewWindow":"Open in new window"},"logo":"/images/hero.png","repo":"vuepress/vuepress-next","docsDir":"docs","navbar":[{"text":"指南","icon":"fa6-solid:lightbulb","link":"/zh/guide/"},{"text":"参考","icon":"fa6-solid:book","prefix":"/zh/reference/","children":[{"text":"VuePress","children":["cli","config","frontmatter","components","plugin-api","theme-api","client-api","node-api"]},{"text":"打包工具","children":["bundler/vite","bundler/webpack"]},{"text":"默认主题","children":["default-theme/config","default-theme/frontmatter","default-theme/components","default-theme/markdown","default-theme/styles","default-theme/extending"]}]},{"text":"插件","icon":"fa6-solid:plug","prefix":"/zh/reference/plugin/","children":[{"text":"常用功能","children":["plugin/back-to-top","plugin/container","plugin/external-link-icon","plugin/google-analytics","plugin/medium-zoom","plugin/nprogress","plugin/register-components"]},{"text":"内容搜索","children":["plugin/docsearch","plugin/search"]},{"text":"PWA","children":["plugin/pwa","plugin/pwa-popup"]},{"text":"语法高亮","children":["plugin/prismjs","plugin/shiki"]},{"text":"主题开发","children":["plugin/active-header-links","plugin/git","plugin/palette","plugin/theme-data","plugin/toc"]}]},{"text":"了解更多","icon":"fa6-solid:feather","children":[{"text":"深入","prefix":"/zh/advanced/","children":["architecture","plugin","theme",{"text":"Cookbook","link":"cookbook/"}]},{"text":"其他资源","children":["/zh/contributing",{"text":"Awesome VuePress","link":"https://github.com/vuepress/awesome-vuepress"},{"text":"VuePress 市场","link":"https://marketplace.vuejs.press/zh/"}]}]},{"text":"v2.0.0-beta.60","icon":"fa6-solid:tag","children":[{"text":"更新日志","icon":"fa6-solid:clock","link":"https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG"},{"text":"v1.x","icon":"fa6-brands:vuejs","link":"https://v1.vuepress.vuejs.org/zh/"},{"text":"v0.x","icon":"fa6-brands:vuejs","link":"https://v0.vuepress.vuejs.org/zh/"}]}],"sidebar":{"/zh/guide/":["","getting-started","configuration","page","markdown","assets","i18n","deployment","theme","plugin","bundler","migration"],"/zh/advanced/":[{"text":"深入","icon":"fa6-solid:gem","children":["architecture","plugin","theme"]},{"text":"Cookbook","icon":"fa6-solid:signs-post","prefix":"cookbook/","children":["","usage-of-client-config","adding-extra-pages","making-a-theme-extendable","passing-data-to-client-code","markdown-and-vue-sfc"]}],"/zh/reference/":[{"text":"VuePress 参考","icon":"fa6-brands:vuejs","collapsible":true,"children":["/zh/reference/cli","/zh/reference/config","/zh/reference/frontmatter","/zh/reference/components","/zh/reference/plugin-api","/zh/reference/theme-api","/zh/reference/client-api","/zh/reference/node-api"]},{"text":"打包工具参考","icon":"fa6-solid:boxes-packing","prefix":"bundler/","collapsible":true,"children":["vite","webpack"]},{"text":"默认主题参考","icon":"fa6-solid:palette","prefix":"default-theme/","collapsible":true,"children":["config","frontmatter","components","markdown","styles","extending"]},{"text":"官方插件参考","icon":"fa6-solid:plug","collapsible":true,"prefix":"plugin/","children":[{"text":"常用功能","children":["back-to-top","container","external-link-icon","google-analytics","medium-zoom","nprogress","register-components"]},{"text":"内容搜索","children":["docsearch","search"]},{"text":"PWA","children":["pwa","pwa-popup"]},{"text":"语法高亮","children":["prismjs","shiki"]},{"text":"主题开发","children":["active-header-links","git","palette","theme-data","toc"]}]},{"text":"VuePress 市场","icon":"fa6-solid:cart-shopping","link":"https://marketplace.vuejs.press/zh/"}]},"footer":"主题使用 VuePress Theme Hope","copyright":"MIT 协议 | 版权所有 © 2018-至今 尤雨溪","displayFooter":true},"/":{"lang":"en-US","navbarLocales":{"langName":"English","selectLangAriaLabel":"Select language"},"metaLocales":{"author":"Author","date":"Writing Date","origin":"Original","views":"Page views","category":"Category","tag":"Tag","readingTime":"Reading Time","words":"Words","toc":"On This Page","prev":"Prev","next":"Next","lastUpdated":"Last update","contributors":"Contributors","editLink":"Edit this page on GitHub"},"outlookLocales":{"themeColor":"Theme Color","darkmode":"Theme Mode","fullscreen":"Full Screen"},"encryptLocales":{"iconLabel":"Page Encrypted","placeholder":"Enter password","remember":"Remember password","errorHint":"Please enter the correct password!"},"routeLocales":{"skipToContent":"Skip to main content","notFoundTitle":"Page not found","notFoundMsg":["There’s nothing here.","How did we get here?","That’s a Four-Oh-Four.","Looks like we've got some broken links."],"back":"Go back","home":"Take me home","openInNewWindow":"Open in new window"},"logo":"/images/hero.png","repo":"vuepress/vuepress-next","docsDir":"docs","navbar":[{"text":"Guide","icon":"fa6-solid:lightbulb","link":"/guide/"},{"text":"Reference","icon":"fa6-solid:book","prefix":"/reference/","children":[{"text":"VuePress","children":[{"text":"CLI","link":"cli.html"},"config","frontmatter","components","plugin-api","theme-api","client-api","node-api"]},{"text":"Bundlers","children":["bundler/vite","bundler/webpack"]},{"text":"Default Theme","children":["default-theme/config","default-theme/frontmatter","default-theme/components","default-theme/markdown","default-theme/styles","default-theme/extending"]}]},{"text":"Plugins","icon":"fa6-solid:plug","prefix":"/reference/plugin/","children":[{"text":"Common Features","children":["back-to-top","container","external-link-icon","google-analytics","medium-zoom","nprogress","register-components"]},{"text":"Content Search","children":["docsearch","search"]},{"text":"PWA","children":["pwa","pwa-popup"]},{"text":"Syntax Highlighting","children":["prismjs","shiki"]},{"text":"Theme Development","children":["active-header-links","git","palette","theme-data","toc"]}]},{"text":"Learn More","icon":"fa6-solid:feather","children":[{"text":"Advanced","prefix":"/advanced/","children":["architecture","plugin","theme",{"text":"Cookbook","link":"cookbook/"}]},{"text":"Resources","children":["/contributing",{"text":"Awesome VuePress","link":"https://github.com/vuepress/awesome-vuepress"},{"text":"VuePress MarketPlace","link":"https://marketplace.vuejs.press"}]}]},{"text":"v2.0.0-beta.60","icon":"fa6-solid:tag","children":[{"text":"Changelog","icon":"fa6-solid:clock","link":"https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG"},{"text":"v1.x","icon":"fa6-brands:vuejs","link":"https://v1.vuepress.vuejs.org"},{"text":"v0.x","icon":"fa6-brands:vuejs","link":"https://v0.vuepress.vuejs.org"}]}],"sidebar":{"/guide/":["","getting-started","configuration","page","markdown","assets","i18n","deployment","theme","plugin","bundler","migration"],"/advanced/":[{"text":"Advanced","icon":"fa6-solid:gem","children":["architecture","plugin","theme"]},{"text":"Cookbook","icon":"fa6-solid:signs-post","prefix":"cookbook/","children":["","usage-of-client-config","adding-extra-pages","making-a-theme-extendable","passing-data-to-client-code","markdown-and-vue-sfc"]}],"/reference/":[{"text":"VuePress Reference","icon":"fa6-brands:vuejs","collapsible":true,"children":["cli","config","frontmatter","components","plugin-api","theme-api","client-api","node-api"]},{"text":"Bundlers Reference","icon":"fa6-solid:boxes-packing","prefix":"bundler/","collapsible":true,"children":["vite","webpack"]},{"text":"Default Theme Reference","icon":"fa6-solid:palette","prefix":"default-theme/","collapsible":true,"children":["config","frontmatter","components","markdown","styles","extending"]},{"text":"Official Plugins Reference","icon":"fa6-solid:plug","prefix":"plugin/","collapsible":true,"children":[{"text":"Common Features","children":["back-to-top","container","external-link-icon","google-analytics","medium-zoom","nprogress","register-components"]},{"text":"Content Search","children":["docsearch","search"]},{"text":"PWA","children":["pwa","pwa-popup"]},{"text":"Syntax Highlighting","children":["prismjs","shiki"]},{"text":"Theme Development","children":["active-header-links","git","palette","theme-data","toc"]}]},{"text":"VuePress MarketPlace","icon":"fa6-solid:cart-shopping","link":"https://marketplace.vuejs.press"}]},"footer":"Theme by VuePress Theme Hope","copyright":"MIT Licensed | Copyright © 2018-present Evan You","displayFooter":true}}}`),zu=z(Vu),ci=()=>zu,li=Symbol(""),Mu=()=>{const e=Ve(li);if(!e)throw new Error("useThemeLocaleData() is called without provider.");return e},Nu=(e,t)=>{var n;return{...e,...(n=e.locales)==null?void 0:n[t]}},Hu=ke({enhance({app:e}){const t=ci(),n=e._context.provides[yr],r=I(()=>Nu(t.value,n.value));e.provide(li,r),Object.defineProperties(e.config.globalProperties,{$theme:{get(){return t.value}},$themeLocale:{get(){return r.value}}})}});const Bu=800,Fu=2e3,qu={"/zh/":{copy:"复制代码",copied:"已复制",hint:"复制成功"},"/":{copy:"Copy code",copied:"Copied",hint:"Copied successfully"}},Uu=!1,Wu=['.theme-hope-content div[class*="language-"] pre'],co=!1,Cn=new Map,Gu=()=>{const{copy:e}=Xl({legacy:!0}),t=ht(qu),n=J(),r=i=>{if(!i.hasAttribute("copy-code-registered")){const c=document.createElement("button");c.classList.add("copy-code-button"),c.innerHTML='
',c.setAttribute("aria-label",t.value.copy),c.setAttribute("data-copied",t.value.copied),i.parentElement&&i.parentElement.insertBefore(c,i),i.setAttribute("copy-code-registered","")}},o=()=>zt().then(()=>new Promise(i=>{setTimeout(()=>{Wu.forEach(c=>{document.querySelectorAll(c).forEach(r)}),i()},Bu)})),a=(i,c,l)=>{let{innerText:s=""}=c;/language-(shellscript|shell|bash|sh|zsh)/.test(i.classList.toString())&&(s=s.replace(/^ *(\$|>) /gm,"")),e(s).then(()=>{l.classList.add("copied"),clearTimeout(Cn.get(l));const u=setTimeout(()=>{l.classList.remove("copied"),l.blur(),Cn.delete(l)},Fu);Cn.set(l,u)})};re(()=>{const{userAgent:i}=navigator;(!Hr(i)||co)&&o(),Le("click",c=>{const l=c.target;if(l.matches('div[class*="language-"] > button.copy')){const s=l.parentElement,u=l.nextElementSibling;u&&a(s,u,l)}else if(l.matches('div[class*="language-"] div.copy-icon')){const s=l.parentElement,u=s.parentElement,p=s.nextElementSibling;p&&a(u,p,s)}}),X(()=>n.value.path,()=>{(!Hr(i)||co)&&o()})})};var Ku=ke({setup:()=>{Gu()}});const Ut=Ht("VUEPRESS_CODE_TAB_STORE",{});var Yu=j({name:"CodeTabs",props:{active:{type:Number,default:0},data:{type:Array,required:!0},id:{type:String,required:!0},tabId:{type:String,default:""}},setup(e,{slots:t}){const n=z(e.active),r=z([]),o=()=>{if(e.tabId){const{title:s,id:u=s}=e.data[n.value];Ut.value[e.tabId]=u}},a=(s=n.value)=>{n.value=s{n.value=s>0?s-1:r.value.length-1,r.value[n.value].focus()},c=(s,u)=>{if(s.key===" "||s.key==="Enter"?(s.preventDefault(),n.value=u):s.key==="ArrowRight"?(s.preventDefault(),a()):s.key==="ArrowLeft"&&(s.preventDefault(),i()),e.tabId){const{title:p,id:f=p}=e.data[n.value];Ut.value[e.tabId]=f}},l=()=>{if(e.tabId){const s=e.data.findIndex(({title:u,id:p=u})=>Ut.value[e.tabId]===p);if(s!==-1)return s}return e.active};return re(()=>{n.value=l(),X(()=>Ut.value[e.tabId],(s,u)=>{if(e.tabId&&s!==u){const p=e.data.findIndex(({title:f,id:m=f})=>m===s);p!==-1&&(n.value=p)}})}),()=>e.data.length?d("div",{class:"code-tabs"},[d("div",{class:"code-tabs-nav",role:"tablist"},e.data.map(({title:s},u)=>{const p=u===n.value;return d("button",{ref:f=>{f&&(r.value[u]=f)},class:["code-tabs-nav-tab",{active:p}],role:"tab","aria-controls":`codetab-${e.id}-${u}`,"aria-selected":p,onClick:()=>{n.value=u,o()},onKeydown:f=>c(f,u)},s)})),e.data.map(({title:s,id:u=s},p)=>{var f;const m=p===n.value;return d("div",{class:["code-tab",{active:m}],id:`codetab-${e.id}-${p}`,role:"tabpanel","aria-expanded":m},(f=t[`tab${p}`])==null?void 0:f.call(t,{title:s,value:u,isActive:m}))})]):null}});const ui=({active:e=!1},{slots:t})=>{var n;return d("div",{class:["code-group-item",{active:e}],"aria-selected":e},(n=t.default)==null?void 0:n.call(t))};ui.displayName="CodeGroupItem";const Ju=j({name:"CodeGroup",setup(e,{slots:t}){const n=z(-1),r=z([]),o=(c=n.value)=>{n.value=c{n.value=c>0?c-1:r.value.length-1,r.value[n.value].focus()},i=(c,l)=>{c.key===" "||c.key==="Enter"?(c.preventDefault(),n.value=l):c.key==="ArrowRight"?(c.preventDefault(),o(l)):c.key==="ArrowLeft"&&(c.preventDefault(),a(l))};return()=>{var c;const l=(((c=t.default)==null?void 0:c.call(t))||[]).filter(s=>s.type.name==="CodeGroupItem").map(s=>(s.props===null&&(s.props={}),s));return l.length===0?null:(n.value<0||n.value>l.length-1?(n.value=l.findIndex(s=>"active"in s.props),n.value===-1&&(n.value=0)):l.forEach((s,u)=>{s.props.active=u===n.value}),d("div",{class:"code-group"},[d("div",{class:"code-group-nav"},l.map((s,u)=>{const p=u===n.value;return d("button",{ref:f=>{f&&(r.value[u]=f)},class:["code-group-nav-tab",{active:p}],"aria-pressed":p,"aria-expanded":p,onClick:()=>{n.value=u},onKeydown:f=>i(f,u)},s.props.title)})),l]))}}});const Qu=ke({enhance:({app:e})=>{e.component("CodeTabs",Yu),we("CodeGroup",e)||e.component("CodeGroup",Ju),we("CodeGroupItem",e)||e.component("CodeGroupItem",ui)}});const Zu=".theme-hope-content :not(a) > img:not(no-view)",Xu={"/zh/":{closeTitle:"关闭",downloadTitle:"下载图片",fullscreenTitle:"切换全屏",zoomTitle:"缩放",arrowPrevTitle:"上一个 (左箭头)",arrowNextTitle:"下一个 (右箭头)"},"/":{closeTitle:"Close",downloadTitle:"Download Image",fullscreenTitle:"Switch to full screen",zoomTitle:"Zoom in/out",arrowPrevTitle:"Prev (Arrow Left)",arrowNextTitle:"Next (Arrow Right)"}},es=800,ts={},lo=e=>({src:e.src,width:e.naturalWidth,height:e.naturalHeight,alt:e.alt}),ns=e=>{const t=be(e)?Array.from(document.querySelectorAll(e)):e.map(n=>Array.from(document.querySelectorAll(n))).flat();return Promise.all(t.map(n=>new Promise((r,o)=>{n.complete?r(lo(n)):(n.onload=()=>r(lo(n)),n.onerror=a=>o(a))}))).then(n=>({elements:t,infos:n}))},rs=()=>{const{isSupported:e,toggle:t}=Pr(),n=ht(Xu),r=J(),o=()=>Promise.all([h(()=>import("./photoswipe.esm-04fddac6.js"),[]),zt().then(()=>new Promise(a=>setTimeout(a,es)).then(()=>ns(Zu)))]).then(([a,i])=>{i.elements.forEach((c,l)=>{const s=()=>{const u=new a.default({dataSource:i.infos,...n.value,...ts,index:l});u.on("uiRegister",()=>{e&&u.ui.registerElement({name:"fullscreen",order:7,isButton:!0,html:'',onClick:()=>{t()}}),u.ui.registerElement({name:"download",order:8,isButton:!0,tagName:"a",html:{isCustomSVG:!0,inner:'',outlineID:"pswp__icn-download"},onInit:(p,f)=>{p.setAttribute("download",""),p.setAttribute("target","_blank"),p.setAttribute("rel","noopener"),f.on("change",()=>{p.href=f.currSlide.data.src})}})}),u.init()};c.style.cursor="zoom-in",c.addEventListener("click",s),c.addEventListener("keypress",({key:u})=>{u==="Enter"&&s()})})});re(()=>{o(),X(()=>r.value.path,()=>o())})};var os=ke({setup:()=>{rs()}});const me=e=>{const{icon:t=""}=e;return Vt(t)?d("img",{class:"icon",src:t,"no-view":""}):Or(t)?d("img",{class:"icon",src:Ke(t),"no-view":""}):d(ye("FontIcon"),e)};me.displayName="HopeIcon";function as(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1),Ie=[],mt=!1,Dr=-1,Pt=void 0,It=void 0,si=function(t){return Ie.some(function(n){return!!(n.options.allowTouchMove&&n.options.allowTouchMove(t))})},xt=function(t){var n=t||window.event;return si(n.target)||n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)},is=function(t){if(It===void 0){var n=!!t&&t.reserveScrollBarGap===!0,r=window.innerWidth-document.documentElement.clientWidth;n&&r>0&&(It=document.body.style.paddingRight,document.body.style.paddingRight=r+"px")}Pt===void 0&&(Pt=document.body.style.overflow,document.body.style.overflow="hidden")},di=function(){It!==void 0&&(document.body.style.paddingRight=It,It=void 0),Pt!==void 0&&(document.body.style.overflow=Pt,Pt=void 0)},cs=function(t){return t?t.scrollHeight-t.scrollTop<=t.clientHeight:!1},ls=function(t,n){var r=t.targetTouches[0].clientY-Dr;return si(t.target)?!1:n&&n.scrollTop===0&&r>0||cs(n)&&r<0?xt(t):(t.stopPropagation(),!0)},fi=function(t,n){if(!t){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Ie.some(function(o){return o.targetElement===t})){var r={targetElement:t,options:n||{}};Ie=[].concat(as(Ie),[r]),Tr?(t.ontouchstart=function(o){o.targetTouches.length===1&&(Dr=o.targetTouches[0].clientY)},t.ontouchmove=function(o){o.targetTouches.length===1&&ls(o,t)},mt||(document.addEventListener("touchmove",xt,Sn?{passive:!1}:void 0),mt=!0)):is(n)}},Wt=function(){Tr?(Ie.forEach(function(t){t.targetElement.ontouchstart=null,t.targetElement.ontouchmove=null}),mt&&(document.removeEventListener("touchmove",xt,Sn?{passive:!1}:void 0),mt=!1),Dr=-1):di(),Ie=[]},us=function(t){if(!t){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Ie=Ie.filter(function(n){return n.targetElement!==t}),Tr?(t.ontouchstart=null,t.ontouchmove=null,mt&&Ie.length===0&&(document.removeEventListener("touchmove",xt,Sn?{passive:!1}:void 0),mt=!1)):Ie.length||di()};const ut=(e,t=!1)=>{const n=Se(),{fullPath:r,meta:o,name:a}=Sr(n,encodeURI(e));return{text:!t&&o.s?o.s:o.t||e,link:a==="404"?e:r,...o.i?{icon:o.i}:{}}},ze=()=>ci(),K=()=>Mu(),kn=()=>I(()=>Boolean(ze().value.pure)),Pn=()=>{const e=ze(),t=z(!1),n=z(!1),r=()=>{t.value=window.innerWidth<=(e.value.mobileBreakPoint||719),n.value=window.innerWidth>=(e.value.wideBreakPoint||1440)};return re(()=>{r(),Le("resize",r,!1),Le("orientationchange",r,!1)}),{isMobile:t,isWide:n}},ss=()=>{const e=Se(),t=Ee();return n=>{if(n)if(Or(n))t.path!==n&&e.push(n);else if(Vt(n)||Pa(n))window&&window.open(n);else{const r=t.path.slice(0,t.path.lastIndexOf("/"));e.push(`${r}/${encodeURI(n)}`)}}},pi=()=>{const e=K(),t=oe();return I(()=>{const{author:n}=t.value;return n?Fr(n):n===!1?[]:Fr(e.value.author,!1)})},ds=()=>{const e=oe();return I(()=>Il(e.value.category).map(t=>({name:t,path:""})))},fs=()=>{const e=oe();return I(()=>Tl(e.value.tag).map(t=>({name:t,path:""})))},ps=()=>{const e=oe(),t=J();return I(()=>{const{date:n}=e.value;if(n)return Br(n);const{createdTime:r}=t.value.git||{};return r?Br(new Date(r)):null})},ms=()=>{const e=K(),t=J(),n=oe(),r=pi(),o=ds(),a=fs(),i=ps(),c=I(()=>({author:r.value,category:o.value,date:i.value,localizedDate:t.value.localizedDate,tag:a.value,isOriginal:n.value.isOriginal||!1,readingTime:t.value.readingTime||null,pageview:"pageview"in n.value?n.value.pageview:!0})),l=I(()=>"pageInfo"in n.value?n.value.pageInfo:"pageInfo"in e.value?e.value.pageInfo:null);return{info:c,items:l}};let Rn=null,yt=null;const vs={wait:()=>Rn,pending:()=>{Rn=new Promise(e=>yt=e)},resolve:()=>{yt==null||yt(),Rn=null,yt=null}},mi=()=>vs;const hs=j({name:"PageFooter",setup(){const e=oe(),t=K(),n=pi(),r=I(()=>{const{copyright:i,footer:c}=e.value;return c!==!1&&Boolean(i||c||t.value.displayFooter)}),o=I(()=>{const{footer:i}=e.value;return i===!1?!1:be(i)?i:t.value.footer||""}),a=I(()=>"copyright"in e.value?e.value.copyright:"copyright"in t.value?t.value.copyright:n.value.length?`Copyright © ${new Date().getFullYear()} ${n.value[0].name}`:!1);return()=>r.value?d("footer",{class:"footer-wrapper"},[o.value?d("div",{class:"footer",innerHTML:o.value}):null,a.value?d("div",{class:"copyright",innerHTML:a.value}):null]):null}}),pe=j({name:"AutoLink",inheritAttrs:!1,props:{config:{type:Object,required:!0},exact:Boolean,noExternalLinkIcon:Boolean},emits:{focusout:()=>!0},setup(e,{attrs:t,emit:n,slots:r}){const o=Ee(),a=Er(),i=gr(e,"config"),c=I(()=>Vt(i.value.link)),l=I(()=>Pa(i.value.link)||Jc(i.value.link)),s=I(()=>l.value?void 0:i.value.target||(c.value?"_blank":void 0)),u=I(()=>s.value==="_blank"),p=I(()=>!c.value&&!l.value&&!u.value),f=I(()=>l.value?void 0:i.value.rel||(u.value?"noopener noreferrer":void 0)),m=I(()=>i.value.ariaLabel||i.value.text),b=I(()=>{if(e.exact)return!1;const _=Qe(a.value.locales);return _.length?_.every(y=>y!==i.value.link):i.value.link!=="/"}),v=I(()=>p.value?i.value.activeMatch?new RegExp(i.value.activeMatch).test(o.path):b.value?pt(o.path,i.value.link):o.path===i.value.link:!1);return()=>{var w,O,k;const{text:_,icon:y,link:E}=i.value;return p.value?d(Re,{to:E,"aria-label":m.value,...t,class:["nav-link",{active:v.value},t.class],onFocusout:()=>n("focusout")},()=>{var C,T,P;return((C=r.default)==null?void 0:C.call(r))||[((T=r.before)==null?void 0:T.call(r))||d(me,{icon:y}),_,(P=r.after)==null?void 0:P.call(r)]}):d("a",{href:E,rel:f.value,target:s.value,"aria-label":m.value,...t,class:["nav-link",t.class],onFocusout:()=>n("focusout")},((w=r.default)==null?void 0:w.call(r))||[((O=r.before)==null?void 0:O.call(r))||d(me,{icon:y}),_,e.noExternalLinkIcon?null:d(ai),(k=r.after)==null?void 0:k.call(r)])}}});const vi=j({name:"NavbarDropdownLink",props:{config:{type:Object,required:!0}},setup(e,{slots:t}){const n=J(),r=gr(e,"config"),o=I(()=>r.value.ariaLabel||r.value.text),a=z(!1);X(()=>n.value.path,()=>{a.value=!1});const i=c=>{c.detail===0&&(a.value=!a.value)};return()=>{var c;return d("div",{class:["dropdown-wrapper",{open:a.value}]},[d("button",{class:"dropdown-title",type:"button","aria-label":o.value,onClick:i},[((c=t.title)==null?void 0:c.call(t))||d("span",{class:"title"},[d(me,{icon:r.value.icon}),e.config.text]),d("span",{class:"arrow"}),d("ul",{class:"nav-dropdown"},r.value.children.map((l,s)=>{const u=s===r.value.children.length-1;return d("li",{class:"dropdown-item"},"children"in l?[d("h4",{class:"dropdown-subtitle"},l.link?d(pe,{config:l,onFocusout:()=>{l.children.length===0&&u&&(a.value=!1)}}):d("span",l.text)),d("ul",{class:"dropdown-subitem-wrapper"},l.children.map((p,f)=>d("li",{class:"dropdown-subitem"},d(pe,{config:p,onFocusout:()=>{f===l.children.length-1&&u&&(a.value=!1)}}))))]:d(pe,{config:l,onFocusout:()=>{u&&(a.value=!1)}}))}))])])}}}),hi=()=>d(Z,{name:"i18n"},()=>[d("path",{d:"M379.392 460.8 494.08 575.488l-42.496 102.4L307.2 532.48 138.24 701.44l-71.68-72.704L234.496 460.8l-45.056-45.056c-27.136-27.136-51.2-66.56-66.56-108.544h112.64c7.68 14.336 16.896 27.136 26.112 35.84l45.568 46.08 45.056-45.056C382.976 312.32 409.6 247.808 409.6 204.8H0V102.4h256V0h102.4v102.4h256v102.4H512c0 70.144-37.888 161.28-87.04 210.944L378.88 460.8zM576 870.4 512 1024H409.6l256-614.4H768l256 614.4H921.6l-64-153.6H576zM618.496 768h196.608L716.8 532.48 618.496 768z"})]);hi.displayName="I18nIcon";const gi=(e,t="")=>be(e)?ut(`${t}${e}`):"children"in e?{...e,...e.link&&!cn(e.link)?ut(`${t}${e.link}`):{},children:e.children.map(n=>gi(n,`${t}${e.prefix||""}`))}:{...e,link:cn(e.link)?e.link:ut(`${t}${e.link}`).link},_i=()=>I(()=>(K().value.navbar||[]).map(e=>gi(e))),gs=()=>{const e=Se(),t=Je(),n=yn(),r=ze(),o=K();return I(()=>{const a=Qe(n.value.locales);if(a.length<2)return null;const{path:i,fullPath:c}=e.currentRoute.value,{navbarLocales:l}=o.value;return{text:"",ariaLabel:l==null?void 0:l.selectLangAriaLabel,children:a.map(u=>{var _,y,E;const p=((_=n.value.locales)==null?void 0:_[u])??{},f=((y=r.value.locales)==null?void 0:y[u])??{},m=p.lang||"",b=((E=f.navbarLocales)==null?void 0:E.langName)??m;let v;if(m===n.value.lang)v=i;else{const w=i.replace(t.value,u);v=e.getRoutes().some(O=>O.path===w)?c.replace(i,w):f.home??u}return{text:b,link:v}})}})},_s=()=>{const e=K(),t=I(()=>e.value.repo||null),n=I(()=>t.value?Ll(t.value):null),r=I(()=>t.value?Ka(t.value):null),o=I(()=>n.value?e.value.repoLabel??(r.value===null?"Source":r.value):null);return I(()=>!n.value||!o.value||e.value.repoDisplay===!1?null:{type:r.value||"Source",label:o.value,link:n.value})},bs=j({name:"LanguageDropdown",setup(){const e=gs();return()=>e.value?d("div",{class:"nav-item"},d(vi,{class:"i18n-dropdown",config:e.value},{title:()=>{var t;return d(hi,{"aria-label":(t=e.value)==null?void 0:t.ariaLabel,style:{width:"1rem",height:"1rem",verticalAlign:"middle"}})}})):null}});const ys=j({name:"NavScreenDropdown",props:{config:{type:Object,required:!0}},setup(e){const t=J(),n=gr(e,"config"),r=I(()=>n.value.ariaLabel||n.value.text),o=z(!1);X(()=>t.value.path,()=>{o.value=!1});const a=(i,c)=>c[c.length-1]===i;return()=>[d("button",{class:["nav-screen-dropdown-title",{active:o.value}],type:"button","aria-label":r.value,onClick:()=>{o.value=!o.value}},[d("span",{class:"title"},[d(me,{icon:n.value.icon}),e.config.text]),d("span",{class:["arrow",o.value?"down":"end"]})]),d("ul",{class:["nav-screen-dropdown",{hide:!o.value}]},n.value.children.map(i=>d("li",{class:"dropdown-item"},"children"in i?[d("h4",{class:"dropdown-subtitle"},i.link?d(pe,{config:i,onFocusout:()=>{a(i,n.value.children)&&i.children.length===0&&(o.value=!1)}}):d("span",i.text)),d("ul",{class:"dropdown-subitem-wrapper"},i.children.map(c=>d("li",{class:"dropdown-subitem"},d(pe,{config:c,onFocusout:()=>{a(c,i.children)&&a(i,n.value.children)&&(o.value=!1)}}))))]:d(pe,{config:i,onFocusout:()=>{a(i,n.value.children)&&(o.value=!1)}}))))]}});const Es=j({name:"NavScreenLinks",setup(){const e=_i();return()=>e.value.length?d("nav",{class:"nav-screen-links"},e.value.map(t=>d("div",{class:"navbar-links-item"},"children"in t?d(ys,{config:t}):d(pe,{config:t})))):null}}),bi=()=>d(Z,{name:"dark"},()=>d("path",{d:"M524.8 938.667h-4.267a439.893 439.893 0 0 1-313.173-134.4 446.293 446.293 0 0 1-11.093-597.334A432.213 432.213 0 0 1 366.933 90.027a42.667 42.667 0 0 1 45.227 9.386 42.667 42.667 0 0 1 10.24 42.667 358.4 358.4 0 0 0 82.773 375.893 361.387 361.387 0 0 0 376.747 82.774 42.667 42.667 0 0 1 54.187 55.04 433.493 433.493 0 0 1-99.84 154.88 438.613 438.613 0 0 1-311.467 128z"}));bi.displayName="DarkIcon";const yi=()=>d(Z,{name:"light"},()=>d("path",{d:"M952 552h-80a40 40 0 0 1 0-80h80a40 40 0 0 1 0 80zM801.88 280.08a41 41 0 0 1-57.96-57.96l57.96-58a41.04 41.04 0 0 1 58 58l-58 57.96zM512 752a240 240 0 1 1 0-480 240 240 0 0 1 0 480zm0-560a40 40 0 0 1-40-40V72a40 40 0 0 1 80 0v80a40 40 0 0 1-40 40zm-289.88 88.08-58-57.96a41.04 41.04 0 0 1 58-58l57.96 58a41 41 0 0 1-57.96 57.96zM192 512a40 40 0 0 1-40 40H72a40 40 0 0 1 0-80h80a40 40 0 0 1 40 40zm30.12 231.92a41 41 0 0 1 57.96 57.96l-57.96 58a41.04 41.04 0 0 1-58-58l58-57.96zM512 832a40 40 0 0 1 40 40v80a40 40 0 0 1-80 0v-80a40 40 0 0 1 40-40zm289.88-88.08 58 57.96a41.04 41.04 0 0 1-58 58l-57.96-58a41 41 0 0 1 57.96-57.96z"}));yi.displayName="LightIcon";const Ei=()=>d(Z,{name:"auto"},()=>d("path",{d:"M512 992C246.92 992 32 777.08 32 512S246.92 32 512 32s480 214.92 480 480-214.92 480-480 480zm0-840c-198.78 0-360 161.22-360 360 0 198.84 161.22 360 360 360s360-161.16 360-360c0-198.78-161.22-360-360-360zm0 660V212c165.72 0 300 134.34 300 300 0 165.72-134.28 300-300 300z"}));Ei.displayName="AutoIcon";const Oi=()=>d(Z,{name:"enter-fullscreen"},()=>d("path",{d:"M762.773 90.24h-497.28c-96.106 0-174.4 78.293-174.4 174.4v497.28c0 96.107 78.294 174.4 174.4 174.4h497.28c96.107 0 175.04-78.293 174.4-174.4V264.64c0-96.213-78.186-174.4-174.4-174.4zm-387.2 761.173H215.04c-21.867 0-40.427-17.92-41.067-41.066V649.92c0-22.507 17.92-40.427 40.427-40.427 11.307 0 21.227 4.694 28.48 11.947 7.253 7.253 11.947 17.92 11.947 28.48v62.293l145.28-145.28c15.893-15.893 41.813-15.893 57.706 0 15.894 15.894 15.894 41.814 0 57.707l-145.28 145.28h62.294c22.506 0 40.426 17.92 40.426 40.427s-17.173 41.066-39.68 41.066zM650.24 165.76h160.427c21.866 0 40.426 17.92 41.066 41.067v160.426c0 22.507-17.92 40.427-40.426 40.427-11.307 0-21.227-4.693-28.48-11.947-7.254-7.253-11.947-17.92-11.947-28.48v-62.186L625.6 450.347c-15.893 15.893-41.813 15.893-57.707 0-15.893-15.894-15.893-41.814 0-57.707l145.28-145.28H650.88c-22.507 0-40.427-17.92-40.427-40.427s17.174-41.173 39.787-41.173z"}));Oi.displayName="EnterFullScreenIcon";const wi=()=>d(Z,{name:"cancel-fullscreen"},()=>d("path",{d:"M778.468 78.62H247.922c-102.514 0-186.027 83.513-186.027 186.027V795.08c0 102.514 83.513 186.027 186.027 186.027h530.432c102.514 0 186.71-83.513 186.026-186.027V264.647C964.494 162.02 880.981 78.62 778.468 78.62zM250.88 574.35h171.122c23.324 0 43.122 19.115 43.804 43.805v171.121c0 24.008-19.114 43.122-43.122 43.122-12.06 0-22.641-5.006-30.378-12.743s-12.743-19.115-12.743-30.379V722.83L224.597 877.91c-16.953 16.952-44.6 16.952-61.553 0-16.953-16.954-16.953-44.602 0-61.554L318.009 661.39h-66.446c-24.007 0-43.122-19.114-43.122-43.122 0-24.12 18.432-43.918 42.439-43.918zm521.899-98.873H601.657c-23.325 0-43.122-19.114-43.805-43.804V260.55c0-24.007 19.115-43.122 43.122-43.122 12.06 0 22.642 5.007 30.379 12.743s12.743 19.115 12.743 30.38v66.445l154.965-154.965c16.953-16.953 44.601-16.953 61.554 0 16.953 16.953 16.953 44.6 0 61.554L705.536 388.55h66.446c24.007 0 43.122 19.115 43.122 43.122.114 24.007-18.318 43.804-42.325 43.804z"}));wi.displayName="CancelFullScreenIcon";const Si=()=>d(Z,{name:"outlook"},()=>[d("path",{d:"M224 800c0 9.6 3.2 44.8 6.4 54.4 6.4 48-48 76.8-48 76.8s80 41.6 147.2 0 134.4-134.4 38.4-195.2c-22.4-12.8-41.6-19.2-57.6-19.2C259.2 716.8 227.2 761.6 224 800zM560 675.2l-32 51.2c-51.2 51.2-83.2 32-83.2 32 25.6 67.2 0 112-12.8 128 25.6 6.4 51.2 9.6 80 9.6 54.4 0 102.4-9.6 150.4-32l0 0c3.2 0 3.2-3.2 3.2-3.2 22.4-16 12.8-35.2 6.4-44.8-9.6-12.8-12.8-25.6-12.8-41.6 0-54.4 60.8-99.2 137.6-99.2 6.4 0 12.8 0 22.4 0 12.8 0 38.4 9.6 48-25.6 0-3.2 0-3.2 3.2-6.4 0-3.2 3.2-6.4 3.2-6.4 6.4-16 6.4-16 6.4-19.2 9.6-35.2 16-73.6 16-115.2 0-105.6-41.6-198.4-108.8-268.8C704 396.8 560 675.2 560 675.2zM224 419.2c0-28.8 22.4-51.2 51.2-51.2 28.8 0 51.2 22.4 51.2 51.2 0 28.8-22.4 51.2-51.2 51.2C246.4 470.4 224 448 224 419.2zM320 284.8c0-22.4 19.2-41.6 41.6-41.6 22.4 0 41.6 19.2 41.6 41.6 0 22.4-19.2 41.6-41.6 41.6C339.2 326.4 320 307.2 320 284.8zM457.6 208c0-12.8 12.8-25.6 25.6-25.6 12.8 0 25.6 12.8 25.6 25.6 0 12.8-12.8 25.6-25.6 25.6C470.4 233.6 457.6 220.8 457.6 208zM128 505.6C128 592 153.6 672 201.6 736c28.8-60.8 112-60.8 124.8-60.8-16-51.2 16-99.2 16-99.2l316.8-422.4c-48-19.2-99.2-32-150.4-32C297.6 118.4 128 291.2 128 505.6zM764.8 86.4c-22.4 19.2-390.4 518.4-390.4 518.4-22.4 28.8-12.8 76.8 22.4 99.2l9.6 6.4c35.2 22.4 80 12.8 99.2-25.6 0 0 6.4-12.8 9.6-19.2 54.4-105.6 275.2-524.8 288-553.6 6.4-19.2-3.2-32-19.2-32C777.6 76.8 771.2 80 764.8 86.4z"})]);Si.displayName="OutlookIcon";const ki=Symbol.for("darkMode"),Bt=()=>{const e=Ve(ki);if(!e)throw new Error("useDarkmode() is called without provider.");return e},Os=e=>{const t=ze(),n=cu(),r=Ht("vuepress-theme-hope-scheme","auto"),o=I(()=>t.value.darkmode||"switch"),a=I(()=>{const c=o.value;return c==="disable"?!1:c==="enable"?!0:c==="auto"?n.value:c==="toggle"?r.value==="dark":r.value==="dark"||r.value==="auto"&&n.value}),i=I(()=>{const c=o.value;return c==="switch"||c==="toggle"});e.provide(ki,{canToggle:i,config:o,isDarkmode:a,status:r}),Object.defineProperties(e.config.globalProperties,{$isDarkmode:{get:()=>a.value}})},ws=()=>{const{isDarkmode:e}=Bt(),t=(n=e.value)=>document.documentElement.setAttribute("data-theme",n?"dark":"light");re(()=>{X(e,t,{immediate:!0})})};const Pi=j({name:"AppearanceSwitch",setup(){const{config:e,status:t}=Bt(),n=()=>{e.value==="switch"?t.value={light:"dark",dark:"auto",auto:"light"}[t.value]:t.value=t.value==="light"?"dark":"light"};return()=>d("button",{id:"appearance-switch",onClick:()=>n()},[d(Ei,{style:{display:t.value==="auto"?"block":"none"}}),d(bi,{style:{display:t.value==="dark"?"block":"none"}}),d(yi,{style:{display:t.value==="light"?"block":"none"}})])}}),Ss=j({name:"AppearanceMode",setup(){const e=K(),{canToggle:t}=Bt(),n=I(()=>e.value.outlookLocales.darkmode);return()=>t.value?d("div",{class:"appearance-wrapper"},[d("label",{class:"appearance-title",for:"appearance-switch"},n.value),d(Pi)]):null}});const ks=j({name:"ThemeColorPicker",props:{themeColor:{type:Object,required:!0}},setup(e){const t=(n="")=>{const r=document.documentElement.classList,o=Qe(e.themeColor).map(a=>`theme-${a}`);if(!n){localStorage.removeItem("theme"),r.remove(...o);return}r.remove(...o.filter(a=>a!==`theme-${n}`)),r.add(`theme-${n}`),localStorage.setItem("theme",n)};return re(()=>{const n=localStorage.getItem("theme");n&&t(n)}),()=>d("ul",{id:"theme-color-picker"},[d("li",d("span",{class:"theme-color",onClick:()=>t()})),...Pl(e.themeColor).map(([n,r])=>d("li",d("span",{style:{background:r},onClick:()=>t(n)})))])}}),Ps=j({name:"ThemeColor",setup(){const e=ze(),t=K(),n=I(()=>t.value.outlookLocales.themeColor),r=I(()=>{const{themeColor:o}=e.value;return o===!1?null:o});return()=>r.value?d("div",{class:"theme-color-wrapper"},[d("label",{class:"theme-color-title",for:"theme-color-picker"},n.value),d(ks,{themeColor:r.value})]):null}});const Ii=j({name:"ToggleFullScreenButton",setup(){const e=K(),{isSupported:t,isFullscreen:n,toggle:r}=Pr(),o=I(()=>e.value.outlookLocales.fullscreen);return()=>t?d("div",{class:"full-screen-wrapper"},[d("label",{class:"full-screen-title",for:"full-screen-switch"},o.value),d("button",{class:"full-screen",id:"full-screen-switch",ariaPressed:n.value,onClick:()=>r()},n.value?d(wi):d(Oi))]):null}}),Ti=j({name:"OutlookSettings",setup(){const e=ze(),t=kn(),n=I(()=>!t.value&&Boolean(e.value.themeColor)),r=I(()=>!t.value&&e.value.fullscreen);return()=>d(En,()=>[n.value?d(Ps):null,d(Ss),r.value?d(Ii):null])}});const Is=j({name:"NavScreen",props:{show:Boolean},emits:{close:()=>!0},setup(e,{emit:t,slots:n}){const r=J(),{isMobile:o}=Pn(),a=z();return re(()=>{X(o,i=>{!i&&e.show&&(Wt(),t("close"))}),X(()=>r.value.path,()=>{Wt(),t("close")})}),hr(()=>{Wt()}),()=>d(dt,{name:"fade",onEnter:()=>fi(a.value,{reserveScrollBarGap:!0}),onAfterLeave:()=>Wt()},()=>{var i,c;return e.show?d("div",{id:"nav-screen",ref:a},d("div",{class:"container"},[(i=n.before)==null?void 0:i.call(n),d(Es),d("div",{class:"outlook-wrapper"},d(Ti)),(c=n.after)==null?void 0:c.call(n)])):null})}});const Ts=j({name:"NavbarBrand",setup(){const e=Je(),t=yn(),n=K(),r=I(()=>n.value.home||e.value),o=I(()=>t.value.title),a=I(()=>n.value.logo?Ke(n.value.logo):null),i=I(()=>n.value.logoDark?Ke(n.value.logoDark):null);return()=>d(Re,{to:r.value,class:"brand"},()=>[a.value?d("img",{class:["logo",{light:Boolean(i.value)}],src:a.value,alt:o.value}):null,i.value?d("img",{class:["logo dark"],src:i.value,alt:o.value}):null,o.value?d("span",{class:["site-name",{"hide-in-pad":a.value&&n.value.hideSiteNameOnMobile!==!1}]},o.value):null])}});const Ds=j({name:"NavbarLinks",setup(){const e=_i();return()=>e.value.length?d("nav",{class:"nav-links"},[...e.value.map(t=>d("div",{class:"nav-item hide-in-mobile"},"children"in t?d(vi,{config:t}):d(pe,{config:t})))]):null}});const Ls=j({name:"RepoLink",components:{BitbucketIcon:Na,GiteeIcon:Ma,GitHubIcon:Va,GitlabIcon:za,SourceIcon:Ha},setup(){const e=_s();return()=>e.value?d("div",{class:"nav-item"},d("a",{class:"repo-link",href:e.value.link,target:"_blank",rel:"noopener noreferrer","aria-label":e.value.label},d(ye(`${e.value.type}Icon`),{style:{width:"1.25rem",height:"1.25rem",verticalAlign:"middle"}}))):null}});const Di=({active:e=!1},{emit:t})=>d("button",{class:["toggle-navbar-button",{"is-active":e}],"aria-label":"Toggle Navbar","aria-expanded":e,"aria-controls":"nav-screen",onClick:()=>t("toggle")},d("span",{class:"button-container"},[d("span",{class:"button-top"}),d("span",{class:"button-middle"}),d("span",{class:"button-bottom"})]));Di.displayName="ToggleNavbarButton";const Lr=(e,{emit:t})=>d("button",{class:"toggle-sidebar-button",title:"Toggle Sidebar",onClick:()=>t("toggle")},d("span",{class:"icon"}));Lr.displayName="ToggleSidebarButton";Lr.emits=["toggle"];const As=j({name:"OutlookButton",setup(){const{isSupported:e}=Pr(),t=ze(),n=kn(),r=J(),{canToggle:o}=Bt(),a=z(!1),i=I(()=>!n.value&&Boolean(t.value.themeColor)),c=I(()=>!n.value&&t.value.fullscreen&&e);return X(()=>r.value.path,()=>{a.value=!1}),()=>o.value||c.value||i.value?d("div",{class:"nav-item hide-in-mobile"},o.value&&!c.value&&!i.value?d(Pi):c.value&&!o.value&&!i.value?d(Ii):d("button",{class:["outlook-button",{open:a.value}],tabindex:"-1",ariaHidden:!0},[d(Si),d("div",{class:"outlook-dropdown"},d(Ti))])):null}});const xs=j({name:"NavBar",emits:{toggleSidebar:()=>!0},setup(e,{emit:t,slots:n}){const r=K(),{isMobile:o}=Pn(),a=z(!1),i=I(()=>{const{navbarAutoHide:l="mobile"}=r.value;return l!=="none"&&(l==="always"||o.value)}),c=I(()=>r.value.navbarLayout||{start:["Brand"],center:["Links"],end:["Language","Repo","Outlook","Search"]});return()=>{var s,u,p,f,m,b;const l={Brand:d(Ts),Language:d(bs),Links:d(Ds),Repo:d(Ls),Outlook:d(As),Search:we("Docsearch")?d(ye("Docsearch")):we("SearchBox")?d(ye("SearchBox")):we("SearchBox")?d(ye("SearchBox")):null};return[d("header",{class:["navbar",{"auto-hide":i.value,"hide-icon":r.value.navbarIcon===!1}],id:"navbar"},[d("div",{class:"navbar-start"},[d(Lr,{onToggle:()=>{a.value&&(a.value=!1),t("toggleSidebar")}}),(s=n.startBefore)==null?void 0:s.call(n),...(c.value.start||[]).map(v=>l[v]),(u=n.startAfter)==null?void 0:u.call(n)]),d("div",{class:"navbar-center"},[(p=n.centerBefore)==null?void 0:p.call(n),...(c.value.center||[]).map(v=>l[v]),(f=n.centerAfter)==null?void 0:f.call(n)]),d("div",{class:"navbar-end"},[(m=n.endBegin)==null?void 0:m.call(n),...(c.value.end||[]).map(v=>l[v]),(b=n.endAfter)==null?void 0:b.call(n),d(Di,{active:a.value,onToggle:()=>{a.value=!a.value}})])]),d(Is,{show:a.value,onClose:()=>{a.value=!1}},{before:()=>{var v;return(v=n.screenTop)==null?void 0:v.call(n)},after:()=>{var v;return(v=n.screenBottom)==null?void 0:v.call(n)}})]}}}),vt=(e,t,n=!1)=>"activeMatch"in t?new RegExp(t.activeMatch).test(e.path):wr(e,t.link)?!0:t.children&&!n?t.children.some(r=>vt(e,r)):!1,Li=(e,t)=>t.type==="group"?t.children.some(n=>n.type==="group"?Li(e,n):n.type==="page"&&vt(e,n,!0))||"prefix"in t&&wr(e,t.prefix):!1,Ai=(e,t)=>e.link?d(pe,{...t,config:e}):d("p",t,[d(me,{icon:e.icon}),e.text]),xi=e=>{const t=Ee();return e?d("ul",{class:"sidebar-sub-headers"},e.map(n=>{const r=vt(t,n,!0);return d("li",{class:"sidebar-sub-header"},[Ai(n,{class:["sidebar-link","heading",{active:r}]}),xi(n.children)])})):null},Ar={},jn=(e="",t="")=>Or(t)?t:`${Qc(e)}${t}`,Cs=(e,t)=>{const n=J();return{type:"heading",text:e.title,link:`${n.value.path}#${e.slug}`,children:xr(e.children,t)}},xr=(e,t)=>t>0?e.map(n=>Cs(n,t-1)):[],Ci=e=>{const t=J();return xr(t.value.headers,e)},Jn=(e,t,n="")=>{const r=J(),o=(a,i=n)=>{var l;const c=be(a)?ut(jn(i,a)):a.link?{...a,...cn(a.link)?{}:{link:ut(jn(i,a.link)).link}}:a;if("children"in c){const s=jn(i,c.prefix),u=c.children==="structure"?Ar[s]:c.children;return{type:"group",...c,prefix:s,children:u.map(p=>o(p,s))}}return{type:"page",...c,children:c.link===r.value.path?xr(((l=r.value.headers[0])==null?void 0:l.level)===1?r.value.headers[0].children:r.value.headers,t):[]}};return e.map(a=>o(a))},Rs=(e,t)=>{const n=J(),r=Qe(e).sort((o,a)=>a.length-o.length);for(const o of r)if(pt(decodeURI(n.value.path),o)){const a=e[o];return a?Jn(a==="structure"?Ar[o]:a==="heading"?Ci(t):a,t,o):[]}return console.warn(`${n.value.path} is missing sidebar config.`),[]},js=()=>{const e=Je(),t=oe(),n=K(),r=t.value.home?!1:t.value.sidebar??n.value.sidebar??"structure",o=t.value.headerDepth??n.value.headerDepth??2;return r===!1?[]:r==="heading"?Ci(o):r==="structure"?Jn(Ar[e.value],o,e.value):_n(r)?Jn(r,o):bn(r)?Rs(r,o):[]},Ri=Symbol.for("sidebarItems"),$s=()=>{const e=I(()=>js());Ia(Ri,e)},Cr=()=>{const e=Ve(Ri);if(!e)throw new Error("useSidebarItems() is called without provider.");return e};const Vs=j({name:"SidebarChild",props:{config:{type:Object,required:!0}},setup(e){const t=Ee();return()=>[Ai(e.config,{class:["sidebar-link",`sidebar-${e.config.type}`,{active:vt(t,e.config,!0)}],exact:!0}),xi(e.config.children)]}});const zs=j({name:"SidebarGroup",props:{config:{type:Object,required:!0},open:{type:Boolean,required:!0}},emits:{toggle:()=>!0},setup(e,{emit:t}){const n=Ee(),r=I(()=>vt(n,e.config)),o=I(()=>vt(n,e.config,!0));return()=>{const{collapsible:a,children:i=[],icon:c,prefix:l,link:s,text:u}=e.config;return d("section",{class:"sidebar-group"},[d(a?"button":"p",{class:["sidebar-heading",{clickable:a||s,exact:o.value,active:r.value}],...a?{onClick:()=>t("toggle"),onKeydown:p=>{p.key==="Enter"&&t("toggle")}}:{}},[d(me,{icon:c}),s?d(Re,{to:s,class:"title"},()=>u):d("span",{class:"title"},u),a?d("span",{class:["arrow",e.open?"down":"end"]}):null]),e.open||!a?d(ji,{key:l,config:i}):null])}}});const ji=j({name:"SidebarLinks",props:{config:{type:Array,required:!0}},setup(e){const t=Ee(),n=z(-1),r=o=>{n.value=o===n.value?-1:o};return X(()=>t.path,()=>{const o=e.config.findIndex(a=>Li(t,a));n.value=o},{immediate:!0,flush:"post"}),()=>d("ul",{class:"sidebar-links"},e.config.map((o,a)=>d("li",o.type==="group"?d(zs,{config:o,open:a===n.value,onToggle:()=>r(a)}):d(Vs,{config:o}))))}});const Ms=j({name:"SideBar",setup(e,{slots:t}){const n=Ee(),r=K(),o=Cr(),a=z();return re(()=>{X(()=>n.hash,i=>{const c=document.querySelector(`.sidebar a.sidebar-link[href="${n.path}${i}"]`);if(!c)return;const{top:l,height:s}=a.value.getBoundingClientRect(),{top:u,height:p}=c.getBoundingClientRect();ul+s&&c.scrollIntoView(!1)})}),()=>{var i,c,l;return d("aside",{class:["sidebar",{"hide-icon":r.value.sidebarIcon===!1}],id:"sidebar",ref:a},[(i=t.top)==null?void 0:i.call(t),((c=t.default)==null?void 0:c.call(t))||d(ji,{config:o.value}),(l=t.bottom)==null?void 0:l.call(t)])}}});const $i=j({name:"CommonWrapper",props:{noNavbar:Boolean,noSidebar:Boolean},setup(e,{slots:t}){const n=Se(),r=J(),o=oe(),a=K(),{isMobile:i,isWide:c}=Pn(),l=z(),s=z(!1),u=I(()=>e.noNavbar||o.value.navbar===!1||a.value.navbar===!1?!1:Boolean(r.value.title||a.value.logo||a.value.repo||a.value.navbar)),p=Cr(),f=I(()=>e.noSidebar?!1:o.value.sidebar!==!1&&p.value.length!==0&&!o.value.home),m=z(!1),b=z(!1),v=T=>{m.value=typeof T=="boolean"?T:!m.value},_=T=>{b.value=typeof T=="boolean"?T:!b.value},y={x:0,y:0},E=T=>{y.x=T.changedTouches[0].clientX,y.y=T.changedTouches[0].clientY},w=T=>{const P=T.changedTouches[0].clientX-y.x,D=T.changedTouches[0].clientY-y.y;Math.abs(P)>Math.abs(D)*1.5&&Math.abs(P)>40&&(P>0&&y.x<=80?v(!0):v(!1))},O=I(()=>o.value.home?!1:o.value.toc||a.value.toc!==!1&&o.value.toc!==!1),k=()=>window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;let C=0;return Le("scroll",$l(()=>{const T=k();C58?m.value||(s.value=!0):s.value=!1,C=T},300,!0)),X(i,T=>{T||v(!1)}),re(()=>{const T=n.afterEach(()=>{v(!1)});hr(()=>{T()}),X(m,P=>{const D=l.value.$el;P?fi(D,{reserveScrollBarGap:!0}):us(D)})}),()=>d(we("GlobalEncrypt")?ye("GlobalEncrypt"):$a,()=>{var T;return d("div",{class:["theme-container",{"no-navbar":!u.value,"no-sidebar":!f.value&&!(t.sidebar||t.sidebarTop||t.sidebarBottom),"has-toc":O.value,"hide-navbar":s.value,"sidebar-collapsed":!i.value&&!c.value&&b.value,"sidebar-open":i.value&&m.value},o.value.containerClass||""],onTouchStart:E,onTouchEnd:w},[u.value?d(xs,{onToggleSidebar:()=>v()},{startBefore:()=>{var P;return(P=t.navbarStartBefore)==null?void 0:P.call(t)},startAfter:()=>{var P;return(P=t.navbarStartAfter)==null?void 0:P.call(t)},centerBefore:()=>{var P;return(P=t.navbarCenterBefore)==null?void 0:P.call(t)},centerAfter:()=>{var P;return(P=t.navbarCenterAfter)==null?void 0:P.call(t)},endBegin:()=>{var P;return(P=t.navbarEndBegin)==null?void 0:P.call(t)},endAfter:()=>{var P;return(P=t.navbarEndAfter)==null?void 0:P.call(t)},screenTop:()=>{var P;return(P=t.navScreenTop)==null?void 0:P.call(t)},screenBottom:()=>{var P;return(P=t.navScreenBottom)==null?void 0:P.call(t)}}):null,d(dt,{name:"fade"},()=>m.value?d("div",{class:"sidebar-mask",onClick:()=>v(!1)}):null),d(dt,{name:"fade"},()=>i.value?null:d("div",{class:"toggle-sidebar-wrapper",onClick:()=>_()},d("span",{class:["arrow",b.value?"end":"start"]}))),d(Ms,{ref:l},{...t.sidebar?{default:()=>{var P;return(P=t.sidebar)==null?void 0:P.call(t)}}:{},top:()=>{var P;return(P=t.sidebarTop)==null?void 0:P.call(t)},bottom:()=>{var P;return(P=t.sidebarBottom)==null?void 0:P.call(t)}}),(T=t.default)==null?void 0:T.call(t),d(hs)])})}});const Ns=j({name:"FeaturePanel",props:{items:{type:Object,default:()=>[]},header:{type:String,default:""}},setup(e){return()=>d("div",{class:"feature-panel"},[e.header?d("h2",{class:"feature-header"},e.header):null,e.items.length?d("div",{class:"feature-wrapper"},e.items.map(t=>{const n=[d("h3",[d(me,{icon:t.icon}),d("span",{innerHTML:t.title})]),d("p",{innerHTML:t.details})];return t.link?cn(t.link)?d("a",{class:"feature-item link",href:t.link,role:"navigation","aria-label":t.title,target:"_blank"},n):d(Re,{class:"feature-item link",to:t.link,role:"navigation","aria-label":t.title},()=>n):d("div",{class:"feature-item"},n)})):null])}}),it=j({name:"DropTransition",props:{type:{type:String,default:"single"},delay:{type:Number,default:0},duration:{type:Number,default:.25},appear:Boolean},setup(e,{slots:t}){const n=o=>{o.style.transition=`transform ${e.duration}s ease-in-out ${e.delay}s, opacity ${e.duration}s ease-in-out ${e.delay}s`,o.style.transform="translateY(-20px)",o.style.opacity="0"},r=o=>{o.style.transform="translateY(0)",o.style.opacity="1"};return()=>d(e.type==="single"?dt:Zc,{name:"drop",appear:e.appear,onAppear:n,onAfterAppear:r,onEnter:n,onAfterEnter:r,onBeforeLeave:n},()=>{var o;return(o=t.default)==null?void 0:o.call(t)})}});const Hs=j({name:"HeroInfo",setup(e,{slots:t}){const n=oe(),r=yn(),o=I(()=>n.value.heroText===!1?!1:n.value.heroText||r.value.title||"Hello"),a=I(()=>n.value.tagline===!1?!1:n.value.tagline||r.value.description||"Welcome to your VuePress site"),i=I(()=>n.value.heroImage?Ke(n.value.heroImage):null),c=I(()=>n.value.heroImageDark?Ke(n.value.heroImageDark):null),l=I(()=>n.value.heroAlt||o.value||"hero"),s=I(()=>n.value.actions??[]);return()=>{var u,p;return d("header",{class:"hero-info-wrapper"},[((u=t.heroImage)==null?void 0:u.call(t))||d(it,{appear:!0,type:"group"},()=>[i.value?d("img",{key:"light",class:{light:c.value},src:i.value,alt:l.value}):null,c.value?d("img",{key:"dark",class:"dark",src:c.value,alt:l.value}):null]),((p=t.heroInfo)==null?void 0:p.call(t))||d("div",{class:"hero-info"},[o.value?d(it,{appear:!0,delay:.04},()=>d("h1",{id:"main-title"},o.value)):null,a.value?d(it,{appear:!0,delay:.08},()=>d("p",{class:"description"},a.value)):null,s.value.length?d(it,{appear:!0,delay:.12},()=>d("p",{class:"actions"},s.value.map(f=>d(pe,{class:["action-button",f.type||"default"],config:f,noExternalLinkIcon:!0})))):null])])}}}),In=({custom:e})=>d(ja,{class:["theme-hope-content",{custom:e}]});In.displayName="MarkdownContent";In.props={custom:Boolean};const Bs=j({name:"HopePage",setup(e,{slots:t}){const n=kn(),r=oe(),o=I(()=>{const{features:a}=r.value;return _n(a)?a.some(i=>!("items"in i))?[{items:a}]:a:[]});return()=>{var a,i,c;return d("main",{class:["home project",{pure:n.value}],id:"main-content","aria-labelledby":r.value.heroText===null?void 0:"main-title"},[(a=t.top)==null?void 0:a.call(t),d(Hs),o.value.map(({header:l="",items:s},u)=>d(it,{appear:!0,delay:.16+u*.08},()=>d(Ns,{header:l,items:s}))),(i=t.center)==null?void 0:i.call(t),d(it,{appear:!0,delay:.16+o.value.length*.08},()=>d(In)),(c=t.bottom)==null?void 0:c.call(t)])}}}),Fs=(e,t)=>{const n=e.replace(t,"/").split("/"),r=[];let o=_r(t);return n.forEach((a,i)=>{i!==n.length-1?(o+=`${a}/`,r.push(o)):a!==""&&(o+=a,r.push(o))}),r};const qs=j({name:"BreadCrumb",setup(){const e=Se(),t=J(),n=Je(),r=oe(),o=K(),a=z([]),i=I(()=>(r.value.breadcrumb||r.value.breadcrumb!==!1&&o.value.breadcrumb!==!1)&&a.value.length>1),c=I(()=>r.value.breadcrumbIcon||r.value.breadcrumbIcon!==!1&&o.value.breadcrumbIcon!==!1),l=()=>{const s=e.getRoutes(),u=Fs(t.value.path,n.value).map(p=>{const f=s.find(m=>m.path===p);if(f){const{meta:m,path:b}=Sr(e,f.path),v=m.s||m.t;if(v)return{title:v,icon:m.i,path:b}}return null}).filter(p=>p!==null);u.length>1&&(a.value=u)};return re(()=>{l(),X(()=>t.value.path,l)}),()=>d("nav",{class:["breadcrumb",{disable:!i.value}]},i.value?d("ol",{vocab:"https://schema.org/",typeof:"BreadcrumbList"},a.value.map((s,u)=>d("li",{class:{"is-active":a.value.length-1===u},property:"itemListElement",typeof:"ListItem"},[d(Re,{to:s.path,property:"item",typeof:"WebPage"},()=>[c.value?d(me,{icon:s.icon}):null,d("span",{property:"name"},s.title||"Unknown")]),d("meta",{property:"position",content:u+1})]))):[])}});const so=e=>e===!1?!1:be(e)?ut(e,!0):bn(e)?e:null,Qn=(e,t,n)=>{const r=e.findIndex(o=>o.link===t);if(r!==-1){const o=e[r+n];return o!=null&&o.link?o:null}for(const o of e)if(o.children){const a=Qn(o.children,t,n);if(a)return a}return null},Us=j({name:"PageNav",setup(){const e=K(),t=oe(),n=Cr(),r=J(),o=ss(),a=I(()=>{const c=so(t.value.prev);return c===!1?null:c||(e.value.prevLink===!1?null:Qn(n.value,r.value.path,-1))}),i=I(()=>{const c=so(t.value.next);return c===!1?null:c||(e.value.nextLink===!1?null:Qn(n.value,r.value.path,1))});return Le("keydown",c=>{c.altKey&&(c.key==="ArrowRight"?i.value&&(o(i.value.link),c.preventDefault()):c.key==="ArrowLeft"&&a.value&&(o(a.value.link),c.preventDefault()))}),()=>a.value||i.value?d("nav",{class:"page-nav"},[a.value?d(pe,{class:"prev",config:a.value},()=>{var c,l;return[d("div",{class:"hint"},[d("span",{class:"arrow start"}),e.value.metaLocales.prev]),d("div",{class:"link"},[d(me,{icon:(c=a.value)==null?void 0:c.icon}),(l=a.value)==null?void 0:l.text])]}):null,i.value?d(pe,{class:"next",config:i.value},()=>{var c,l;return[d("div",{class:"hint"},[e.value.metaLocales.next,d("span",{class:"arrow end"})]),d("div",{class:"link"},[(c=i.value)==null?void 0:c.text,d(me,{icon:(l=i.value)==null?void 0:l.icon})])]}):null]):null}}),Vi=()=>d(Z,{name:"author"},()=>d("path",{d:"M649.6 633.6c86.4-48 147.2-144 147.2-249.6 0-160-128-288-288-288s-288 128-288 288c0 108.8 57.6 201.6 147.2 249.6-121.6 48-214.4 153.6-240 288-3.2 9.6 0 19.2 6.4 25.6 3.2 9.6 12.8 12.8 22.4 12.8h704c9.6 0 19.2-3.2 25.6-12.8 6.4-6.4 9.6-16 6.4-25.6-25.6-134.4-121.6-240-243.2-288z"}));Vi.displayName="AuthorIcon";const zi=()=>d(Z,{name:"calendar"},()=>d("path",{d:"M716.4 110.137c0-18.753-14.72-33.473-33.472-33.473-18.753 0-33.473 14.72-33.473 33.473v33.473h66.993v-33.473zm-334.87 0c0-18.753-14.72-33.473-33.473-33.473s-33.52 14.72-33.52 33.473v33.473h66.993v-33.473zm468.81 33.52H716.4v100.465c0 18.753-14.72 33.473-33.472 33.473a33.145 33.145 0 01-33.473-33.473V143.657H381.53v100.465c0 18.753-14.72 33.473-33.473 33.473a33.145 33.145 0 01-33.473-33.473V143.657H180.6A134.314 134.314 0 0046.66 277.595v535.756A134.314 134.314 0 00180.6 947.289h669.74a134.36 134.36 0 00133.94-133.938V277.595a134.314 134.314 0 00-133.94-133.938zm33.473 267.877H147.126a33.145 33.145 0 01-33.473-33.473c0-18.752 14.72-33.473 33.473-33.473h736.687c18.752 0 33.472 14.72 33.472 33.473a33.145 33.145 0 01-33.472 33.473z"}));zi.displayName="CalendarIcon";const Mi=()=>d(Z,{name:"category"},()=>d("path",{d:"M148.41 106.992h282.176c22.263 0 40.31 18.048 40.31 40.31V429.48c0 22.263-18.047 40.31-40.31 40.31H148.41c-22.263 0-40.311-18.047-40.311-40.31V147.302c0-22.263 18.048-40.31 40.311-40.31zM147.556 553.478H429.73c22.263 0 40.311 18.048 40.311 40.31v282.176c0 22.263-18.048 40.312-40.31 40.312H147.555c-22.263 0-40.311-18.049-40.311-40.312V593.79c0-22.263 18.048-40.311 40.31-40.311zM593.927 106.992h282.176c22.263 0 40.31 18.048 40.31 40.31V429.48c0 22.263-18.047 40.31-40.31 40.31H593.927c-22.263 0-40.311-18.047-40.311-40.31V147.302c0-22.263 18.048-40.31 40.31-40.31zM730.22 920.502H623.926c-40.925 0-74.22-33.388-74.22-74.425V623.992c0-41.038 33.387-74.424 74.425-74.424h222.085c41.038 0 74.424 33.226 74.424 74.067v114.233c0 10.244-8.304 18.548-18.547 18.548s-18.548-8.304-18.548-18.548V623.635c0-20.388-16.746-36.974-37.33-36.974H624.13c-20.585 0-37.331 16.747-37.331 37.33v222.086c0 20.585 16.654 37.331 37.126 37.331H730.22c10.243 0 18.547 8.304 18.547 18.547 0 10.244-8.304 18.547-18.547 18.547z"}));Mi.displayName="CategoryIcon";const Ni=()=>d(Z,{name:"eye"},()=>d("path",{d:"M992 512.096c0-5.76-.992-10.592-1.28-11.136-.192-2.88-1.152-8.064-2.08-10.816-.256-.672-.544-1.376-.832-2.08-.48-1.568-1.024-3.104-1.6-4.32C897.664 290.112 707.104 160 512 160c-195.072 0-385.632 130.016-473.76 322.592-1.056 2.112-1.792 4.096-2.272 5.856a55.512 55.512 0 00-.64 1.6c-1.76 5.088-1.792 8.64-1.632 7.744-.832 3.744-1.568 11.168-1.568 11.168-.224 2.272-.224 4.032.032 6.304 0 0 .736 6.464 1.088 7.808.128 1.824.576 4.512 1.12 6.976h-.032c.448 2.08 1.12 4.096 1.984 6.08.48 1.536.992 2.976 1.472 4.032C126.432 733.856 316.992 864 512 864c195.136 0 385.696-130.048 473.216-321.696 1.376-2.496 2.24-4.832 2.848-6.912.256-.608.48-1.184.672-1.728 1.536-4.48 1.856-8.32 1.728-8.32l-.032.032c.608-3.104 1.568-7.744 1.568-13.28zM512 672c-88.224 0-160-71.776-160-160s71.776-160 160-160 160 71.776 160 160-71.776 160-160 160z"}));Ni.displayName="EyeIcon";const Hi=()=>d(Z,{name:"fire"},()=>d("path",{d:"M726.4 201.6c-12.8-9.6-28.8-6.4-38.4 0-9.6 9.6-16 25.6-9.6 38.4 6.4 12.8 9.6 28.8 12.8 44.8C604.8 83.2 460.8 38.4 454.4 35.2c-9.6-3.2-22.4 0-28.8 6.4-9.6 6.4-12.8 19.2-9.6 28.8 12.8 86.4-25.6 188.8-115.2 310.4-6.4-25.6-16-51.2-32-80-9.6-9.6-22.4-16-35.2-12.8-16 3.2-25.6 12.8-25.6 28.8-3.2 48-25.6 92.8-51.2 140.8C134.4 499.2 112 544 102.4 592c-32 150.4 99.2 329.6 233.6 380.8 9.6 3.2 19.2 6.4 32 9.6-25.6-19.2-41.6-51.2-48-96C294.4 691.2 505.6 640 515.2 460.8c153.6 105.6 224 336 137.6 505.6 3.2 0 6.4-3.2 9.6-3.2 0 0 3.2 0 3.2-3.2 163.2-89.6 252.8-208 259.2-345.6 16-211.2-163.2-390.4-198.4-412.8z"}));Hi.displayName="FireIcon";const Bi=()=>d(Z,{name:"print"},()=>d("path",{d:"M819.2 364.8h-44.8V128c0-17.067-14.933-32-32-32H281.6c-17.067 0-32 14.933-32 32v236.8h-44.8C145.067 364.8 96 413.867 96 473.6v192c0 59.733 49.067 108.8 108.8 108.8h44.8V896c0 17.067 14.933 32 32 32h460.8c17.067 0 32-14.933 32-32V774.4h44.8c59.733 0 108.8-49.067 108.8-108.8v-192c0-59.733-49.067-108.8-108.8-108.8zM313.6 160h396.8v204.8H313.6V160zm396.8 704H313.6V620.8h396.8V864zM864 665.6c0 25.6-19.2 44.8-44.8 44.8h-44.8V588.8c0-17.067-14.933-32-32-32H281.6c-17.067 0-32 14.933-32 32v121.6h-44.8c-25.6 0-44.8-19.2-44.8-44.8v-192c0-25.6 19.2-44.8 44.8-44.8h614.4c25.6 0 44.8 19.2 44.8 44.8v192z"}));Bi.displayName="PrintIcon";const Fi=()=>d(Z,{name:"tag"},()=>d("path",{d:"M939.902 458.563L910.17 144.567c-1.507-16.272-14.465-29.13-30.737-30.737L565.438 84.098h-.402c-3.215 0-5.726 1.005-7.634 2.913l-470.39 470.39a10.004 10.004 0 000 14.164l365.423 365.424c1.909 1.908 4.42 2.913 7.132 2.913s5.223-1.005 7.132-2.913l470.39-470.39c2.01-2.11 3.014-5.023 2.813-8.036zm-240.067-72.121c-35.458 0-64.286-28.828-64.286-64.286s28.828-64.285 64.286-64.285 64.286 28.828 64.286 64.285-28.829 64.286-64.286 64.286z"}));Fi.displayName="TagIcon";const qi=()=>d(Z,{name:"timer"},()=>d("path",{d:"M799.387 122.15c4.402-2.978 7.38-7.897 7.38-13.463v-1.165c0-8.933-7.38-16.312-16.312-16.312H256.33c-8.933 0-16.311 7.38-16.311 16.312v1.165c0 5.825 2.977 10.874 7.637 13.592 4.143 194.44 97.22 354.963 220.201 392.763-122.204 37.542-214.893 196.511-220.2 389.397-4.661 5.049-7.638 11.651-7.638 19.03v5.825h566.49v-5.825c0-7.379-2.849-13.981-7.509-18.9-5.049-193.016-97.867-351.985-220.2-389.527 123.24-37.67 216.446-198.453 220.588-392.892zM531.16 450.445v352.632c117.674 1.553 211.787 40.778 211.787 88.676H304.097c0-48.286 95.149-87.382 213.728-88.676V450.445c-93.077-3.107-167.901-81.297-167.901-177.093 0-8.803 6.99-15.793 15.793-15.793 8.803 0 15.794 6.99 15.794 15.793 0 80.261 63.69 145.635 142.01 145.635s142.011-65.374 142.011-145.635c0-8.803 6.99-15.793 15.794-15.793s15.793 6.99 15.793 15.793c0 95.019-73.789 172.82-165.96 177.093z"}));qi.displayName="TimerIcon";const Ui=()=>d(Z,{name:"word"},()=>[d("path",{d:"M518.217 432.64V73.143A73.143 73.143 0 01603.43 1.097a512 512 0 01419.474 419.474 73.143 73.143 0 01-72.046 85.212H591.36a73.143 73.143 0 01-73.143-73.143z"}),d("path",{d:"M493.714 566.857h340.297a73.143 73.143 0 0173.143 85.577A457.143 457.143 0 11371.566 117.76a73.143 73.143 0 0185.577 73.143v339.383a36.571 36.571 0 0036.571 36.571z"})]);Ui.displayName="WordIcon";const Me=()=>{const e=K();return I(()=>e.value.metaLocales)},Wi={"/zh/":{word:"约 $word 字",less1Minute:"小于 1 分钟",time:"大约 $time 分钟"},"/":{word:"About $word words",less1Minute:"Less than 1 minute",time:"About $time min"}},Ws={GitHub:":repo/edit/:branch/:path",GitLab:":repo/-/edit/:branch/:path",Gitee:":repo/edit/:branch/:path",Bitbucket:":repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default"},Gs=({docsRepo:e,docsBranch:t,docsDir:n,filePathRelative:r,editLinkPattern:o})=>{if(!r)return null;const a=Ka(e);let i;return o?i=o:a!==null&&(i=Ws[a]),i?i.replace(/:repo/,Vt(e)?e:`https://github.com/${e}`).replace(/:branch/,t).replace(/:path/,ka(`${_r(n)}/${r}`)):null},Ks=()=>{const e=K(),t=J(),n=oe();return I(()=>{const{repo:r,docsRepo:o=r,docsBranch:a="main",docsDir:i="",editLink:c,editLinkPattern:l=""}=e.value;if(!(n.value.editLink??c??!0)||!o)return null;const u=Gs({docsRepo:o,docsBranch:a,docsDir:i,editLinkPattern:l,filePathRelative:t.value.filePathRelative});return u?{text:e.value.metaLocales.editLink,link:u}:null})},Ys=()=>{const e=yn(),t=K(),n=J(),r=oe();return I(()=>{var i,c;return!(r.value.lastUpdated??t.value.lastUpdated??!0)||!((i=n.value.git)!=null&&i.updatedTime)?null:new Date((c=n.value.git)==null?void 0:c.updatedTime).toLocaleString(e.value.lang)})},Js=()=>{const e=K(),t=J(),n=oe();return I(()=>{var o;return n.value.contributors??e.value.contributors??!0?((o=t.value.git)==null?void 0:o.contributors)??null:null})};const Qs=j({name:"AuthorInfo",inheritAttrs:!1,props:{author:{type:Array,required:!0},pure:Boolean},setup(e){const t=Me();return()=>e.author.length?d("span",{class:"page-author-info","aria-label":`${t.value.author}${e.pure?"":"🖊"}`,...e.pure?{}:{"data-balloon-pos":"down"}},[d(Vi),d("span",e.author.map(n=>n.url?d("a",{class:"page-author-item",href:n.url,target:"_blank",rel:"noopener noreferrer"},n.name):d("span",{class:"page-author-item"},n.name))),d("span",{property:"author",content:e.author.map(n=>n.name).join(", ")})]):null}});const Zs=j({name:"CategoryInfo",inheritAttrs:!1,props:{category:{type:Array,required:!0},pure:Boolean},setup(e){const t=Se(),n=J(),r=Me(),o=(a,i="")=>{i&&n.value.path!==i&&(a.preventDefault(),t.push(i))};return()=>e.category.length?d("span",{class:"page-category-info","aria-label":`${r.value.category}${e.pure?"":"🌈"}`,...e.pure?{}:{"data-balloon-pos":"down"}},[d(Mi),...e.category.map(({name:a,path:i})=>d("span",{class:["page-category-item",{[`category${Ua(a,9)}`]:!e.pure,clickable:i}],role:i?"navigation":"",onClick:c=>o(c,i)},a)),d("meta",{property:"articleSection",content:e.category.map(({name:a})=>a).join(",")})]):null}}),Xs=j({name:"DateInfo",inheritAttrs:!1,props:{date:{type:Object,default:null},localizedDate:{type:String,default:""},pure:Boolean},setup(e){const t=br(),n=Me();return()=>{var r,o;return e.date?d("span",{class:"page-date-info","aria-label":`${n.value.date}${e.pure?"":"📅"}`,...e.pure?{}:{"data-balloon-pos":"down"}},[d(zi),d("span",d(En,()=>{var a;return e.localizedDate||((a=e.date.value)==null?void 0:a.toLocaleDateString(t.value))})),d("meta",{property:"datePublished",content:((o=(r=e.date)==null?void 0:r.value)==null?void 0:o.toISOString())||""})]):null}}});const e1=j({name:"OriginalInfo",inheritAttrs:!1,props:{isOriginal:Boolean},setup(e){const t=Me();return()=>e.isOriginal?d("span",{class:"page-original-info"},t.value.origin):null}});j({name:"PageViewInfo",inheritAttrs:!1,props:{pageview:{type:[Boolean,String],default:!1},pure:Boolean},setup(e){const t=Ee(),n=Me(),r=z(),o=z(0);return du(r,()=>{const a=r.value.textContent;a&&!isNaN(Number(a))&&(o.value=Number(a))},{childList:!0}),()=>e.pageview?d("span",{class:"page-pageview-info","aria-label":`${n.value.views}${e.pure?"":"🔢"}`,...e.pure?{}:{"data-balloon-pos":"down"}},[d(o.value<1e3?Ni:Hi),d("span",{ref:r,class:"waline-pageview-count",id:"ArtalkPV","data-path":be(e.pageview)?e.pageview:Ke(t.path)},"...")]):null}});const t1=j({name:"ReadingTimeInfo",inheritAttrs:!1,props:{readingTime:{type:Object,default:()=>null},pure:Boolean},setup(e){const t=Me(),n=ht(Wi),r=I(()=>{if(!e.readingTime)return null;const{minutes:o}=e.readingTime;return o<1?{text:n.value.less1Minute,time:"PT1M"}:{text:n.value.time.replace("$time",Math.round(o).toString()),time:`PT${Math.round(o)}M`}});return()=>r.value?d("span",{class:"page-reading-time-info","aria-label":`${t.value.readingTime}${e.pure?"":"⌛"}`,...e.pure?{}:{"data-balloon-pos":"down"}},[d(qi),d("span",r.value.text),d("meta",{property:"timeRequired",content:r.value.time})]):null}});const n1=j({name:"TagInfo",inheritAttrs:!1,props:{tag:{type:Array,default:()=>[]},pure:Boolean},setup(e){const t=Se(),n=J(),r=Me(),o=(a,i="")=>{i&&n.value.path!==i&&(a.preventDefault(),t.push(i))};return()=>e.tag.length?d("span",{class:"page-tag-info","aria-label":`${r.value.tag}${e.pure?"":"🏷"}`,...e.pure?{}:{"data-balloon-pos":"down"}},[d(Fi),...e.tag.map(({name:a,path:i})=>d("span",{class:["page-tag-item",{[`tag${Ua(a,9)}`]:!e.pure,clickable:i}],role:i?"navigation":"",onClick:c=>o(c,i)},a)),d("meta",{property:"keywords",content:e.tag.map(({name:a})=>a).join(",")})]):null}}),r1=j({name:"ReadTimeInfo",inheritAttrs:!1,props:{readingTime:{type:Object,default:()=>null},pure:Boolean},setup(e){const t=Me(),n=ht(Wi),r=I(()=>{var a;return(a=e.readingTime)==null?void 0:a.words.toString()}),o=I(()=>n.value.word.replace("$word",r.value||""));return()=>r.value?d("span",{class:"page-word-info","aria-label":`${t.value.words}${e.pure?"":"🔠"}`,...e.pure?{}:{"data-balloon-pos":"down"}},[d(Ui),d("span",o.value),d("meta",{property:"wordCount",content:r.value})]):null}});const o1=j({name:"PageInfo",components:{AuthorInfo:Qs,CategoryInfo:Zs,DateInfo:Xs,OriginalInfo:e1,PageViewInfo:()=>null,ReadingTimeInfo:t1,TagInfo:n1,WordInfo:r1},props:{items:{type:[Array,Boolean],default:()=>["Author","Original","Date","PageView","ReadingTime","Category","Tag"]},info:{type:Object,required:!0}},setup(e){const t=kn();return()=>e.items?d("div",{class:"page-info"},e.items.map(n=>d(ye(`${n}Info`),{...e.info,pure:t.value}))):null}});const a1=j({name:"PageTitle",setup(){const e=J(),t=oe(),n=K(),{info:r,items:o}=ms();return()=>d("div",{class:"page-title"},[d("h1",[n.value.titleIcon===!1?null:d(me,{icon:t.value.icon}),e.value.title]),d(o1,{info:r.value,...o.value===null?{}:{items:o.value}}),d("hr")])}}),Gi=()=>d(Z,{name:"edit"},()=>[d("path",{d:"M430.818 653.65a60.46 60.46 0 0 1-50.96-93.281l71.69-114.012 7.773-10.365L816.038 80.138A60.46 60.46 0 0 1 859.225 62a60.46 60.46 0 0 1 43.186 18.138l43.186 43.186a60.46 60.46 0 0 1 0 86.373L588.879 565.55l-8.637 8.637-117.466 68.234a60.46 60.46 0 0 1-31.958 11.229z"}),d("path",{d:"M728.802 962H252.891A190.883 190.883 0 0 1 62.008 771.98V296.934a190.883 190.883 0 0 1 190.883-192.61h267.754a60.46 60.46 0 0 1 0 120.92H252.891a69.962 69.962 0 0 0-69.098 69.099V771.98a69.962 69.962 0 0 0 69.098 69.098h475.911A69.962 69.962 0 0 0 797.9 771.98V503.363a60.46 60.46 0 1 1 120.922 0V771.98A190.883 190.883 0 0 1 728.802 962z"})]);Gi.displayName="EditIcon";const i1=j({name:"PageMeta",setup(){const e=K(),t=Ks(),n=Ys(),r=Js();return()=>{const{metaLocales:o}=e.value;return d("footer",{class:"page-meta"},[t.value?d("div",{class:"meta-item edit-link"},d(pe,{class:"label",config:t.value},{before:()=>d(Gi)})):null,d("div",{class:"meta-item git-info"},[n.value?d("div",{class:"update-time"},[d("span",{class:"label"},`${o.lastUpdated}: `),d(En,()=>d("span",{class:"info"},n.value))]):null,r.value&&r.value.length?d("div",{class:"contributors"},[d("span",{class:"label"},`${o.contributors}: `),r.value.map(({email:a,name:i},c)=>[d("span",{class:"contributor",title:`email: ${a}`},i),c!==r.value.length-1?",":""])]):null])])}}});const c1=j({name:"PrintButton",setup(){const e=ze();return()=>e.value.print===!1?null:d("button",{class:"print-button",title:"print",onClick:()=>{window.print()}},d(Bi))}});const l1=({title:e,level:t,slug:n})=>d(Re,{to:`#${n}`,class:["toc-link",`level${t}`]},()=>e),Zn=(e,t)=>{const n=Ee();return e.length&&t>0?d("ul",{class:"toc-list"},e.map(r=>[d("li",{class:["toc-item",{active:wr(n,`#${r.slug}`)}]},l1(r)),Zn(r.children,t-1)])):null},u1=j({name:"TOC",props:{items:{type:Array,default:()=>[]},headerDepth:{type:Number,default:2}},setup(e,{slots:t}){const n=Ee(),r=J(),o=Me(),a=z(),i=c=>{var l;(l=a.value)==null||l.scrollTo({top:c,behavior:"smooth"})};return re(()=>{X(()=>n.hash,c=>{if(a.value){const l=document.querySelector(`#toc a.toc-link[href$="${c}"]`);if(!l)return;const{top:s,height:u}=a.value.getBoundingClientRect(),{top:p,height:f}=l.getBoundingClientRect();ps+u&&i(a.value.scrollTop+p+f-s-u)}})}),()=>{var l,s;const c=e.items.length?Zn(e.items,e.headerDepth):r.value.headers?Zn(r.value.headers,e.headerDepth):null;return c?d("div",{class:"toc-place-holder"},[d("aside",{id:"toc"},[(l=t.before)==null?void 0:l.call(t),d("div",{class:"toc-header"},[o.value.toc,d(c1)]),d("div",{class:"toc-wrapper",ref:a},c),(s=t.after)==null?void 0:s.call(t)])]):null}}});const s1=j({name:"NormalPage",setup(e,{slots:t}){const n=oe(),{isDarkmode:r}=Bt(),o=K(),a=I(()=>n.value.toc||n.value.toc!==!1&&o.value.toc!==!1);return()=>d("main",{class:"page",id:"main-content"},d(we("LocalEncrypt")?ye("LocalEncrypt"):$a,()=>{var i,c,l,s;return[(i=t.top)==null?void 0:i.call(t),d(qs),d(a1),a.value?d(u1,{headerDepth:n.value.headerDepth??o.value.headerDepth??2},{before:()=>{var u;return(u=t.tocBefore)==null?void 0:u.call(t)},after:()=>{var u;return(u=t.tocAfter)==null?void 0:u.call(t)}}):null,(c=t.contentBefore)==null?void 0:c.call(t),d(In),(l=t.contentAfter)==null?void 0:l.call(t),d(i1),d(Us),we("CommentService")?d(ye("CommentService"),{darkmode:r.value}):null,(s=t.bottom)==null?void 0:s.call(t)]}))}});const Ki=j({name:"SkipLink",props:{content:{type:String,default:"main-content"}},setup(e){const t=J(),n=K(),r=z(),o=({target:a})=>{const i=document.querySelector(a.hash);if(i){const c=()=>{i.removeAttribute("tabindex"),i.removeEventListener("blur",c)};i.setAttribute("tabindex","-1"),i.addEventListener("blur",c),i.focus(),window.scrollTo(0,0)}};return re(()=>{X(()=>t.value.path,()=>r.value.focus())}),()=>[d("span",{ref:r,tabindex:"-1"}),d("a",{href:`#${e.content}`,class:"skip-link sr-only",onClick:o},n.value.routeLocales.skipToContent)]}});const Yi=j({name:"FadeSlideY",setup(e,{slots:t}){const{resolve:n,pending:r}=mi();return()=>d(dt,{name:"fade-slide-y",mode:"out-in",onBeforeEnter:n,onBeforeLeave:r},()=>{var o;return(o=t.default)==null?void 0:o.call(t)})}}),d1=j({name:"Layout",setup(){K();const e=J(),t=oe(),{isMobile:n}=Pn(),r=I(()=>"none");return()=>[d(Ki),d($i,{},{default:()=>t.value.home?d(Bs):d(Yi,()=>d(s1,{key:e.value.path})),...r.value!=="none"?{navScreenBottom:()=>d(ye("BloggerInfo"))}:{},...!n.value&&r.value==="always"?{sidebar:()=>d(ye("BloggerInfo"))}:{}})]}});const f1=j({name:"NotFoundHint",setup(){const e=K(),t=()=>{const n=e.value.routeLocales.notFoundMsg;return n[Math.floor(Math.random()*n.length)]};return()=>d("div",{class:"not-found-hint"},[d("p",{class:"error-code"},"404"),d("h1",{class:"error-title"},e.value.routeLocales.notFoundTitle),d("p",{class:"error-hint"},t())])}});const p1=j({name:"NotFound",setup(e,{slots:t}){const n=Je(),r=K(),{navigate:o}=Xc({to:r.value.home??n.value});return()=>[d(Ki),d($i,{noSidebar:!0},()=>{var a;return d("main",{class:"page not-found",id:"main-content"},((a=t.default)==null?void 0:a.call(t))||[d(f1),d("div",{class:"actions"},[d("button",{class:"action-button",onClick:()=>{window.history.go(-1)}},r.value.routeLocales.back),d("button",{class:"action-button",onClick:()=>o()},r.value.routeLocales.home)])])})]}});const Ji=()=>d(Z,{name:"lock"},()=>d("path",{d:"M787.168 952.268H236.832c-30.395 0-55.033-24.638-55.033-55.033V429.45c0-30.395 24.638-55.034 55.033-55.034h82.55V264.35c0-106.38 86.238-192.618 192.618-192.618S704.618 157.97 704.618 264.35v110.066h82.55c30.395 0 55.033 24.639 55.033 55.034v467.785c0 30.395-24.639 55.033-55.033 55.033zM484.483 672.046v115.122h55.034V672.046c31.99-11.373 55.033-41.605 55.033-77.496 0-45.592-36.958-82.55-82.55-82.55s-82.55 36.958-82.55 82.55c0 35.89 23.042 66.123 55.033 77.496zM622.067 264.35c0-60.788-49.28-110.067-110.067-110.067s-110.067 49.28-110.067 110.067v110.066h220.135V264.35z"}));Ji.displayName="LockIcon";const Qi=j({name:"PasswordModal",props:{full:Boolean},emits:{verify:(e,t)=>!0},setup(e,{emit:t}){const n=oe(),r=K(),o=z(""),a=z(!1),i=z(!1),c=I(()=>r.value.encryptLocales);let l=null;const s=()=>{l&&clearTimeout(l),a.value=!1,t("verify",o.value,i.value),zt().then(()=>{a.value=!0,l=setTimeout(()=>{a.value=!1},1e3)})};return()=>d("div",{class:["password-layer",{expand:e.full||n.value.home}]},d("div",{class:"password-modal"},[d("div",{class:["hint",{tried:a.value}]},a.value?c.value.errorHint:d(Ji,{"aria-label":c.value.iconLabel})),d("div",{class:"password"},[d("input",{type:"password",value:o.value,placeholder:c.value.placeholder,onInput:({target:u})=>{o.value=u.value},onKeydown:({key:u})=>{u==="Enter"&&s()}})]),d("div",{class:"remember-password"},[d("input",{type:"checkbox",value:i.value,onChange:()=>i.value=!i.value}),c.value.remember]),d("button",{class:"submit",onClick:()=>s()},"OK")]))}}),et="./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),He=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,54,55,56,57,58,59,60,61,62,63,-1,-1,-1,-1,-1,-1,-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,-1,-1,-1,-1,-1,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,-1,-1,-1,-1,-1],fo=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],po=[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946,1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055,3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504,976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],Zi=[1332899944,1700884034,1701343084,1684370003,1668446532,1869963892],Xn=(e,t)=>{if(t<=0||t>e.length)throw Error(`Illegal len: ${t}`);let n,r,o=0;const a=[];for(;o>2&63]),n=(3&n)<<4,o>=t){a.push(et[63&n]);break}if(r=255&e[o++],n|=r>>4&15,a.push(et[63&n]),n=(15&r)<<2,o>=t){a.push(et[63&n]);break}r=255&e[o++],n|=r>>6&3,a.push(et[63&n]),a.push(et[63&r])}return a.join("")},m1=typeof process<"u"&&process&&typeof process.nextTick=="function"?typeof setImmediate=="function"?setImmediate:process.nextTick:setTimeout,Tt=(e,t,n,r)=>{let o,a=e[t],i=e[t+1];return a^=n[0],o=r[a>>>24],o+=r[256|a>>16&255],o^=r[512|a>>8&255],o+=r[768|255&a],i^=o^n[1],o=r[i>>>24],o+=r[256|i>>16&255],o^=r[512|i>>8&255],o+=r[768|255&i],a^=o^n[2],o=r[a>>>24],o+=r[256|a>>16&255],o^=r[512|a>>8&255],o+=r[768|255&a],i^=o^n[3],o=r[i>>>24],o+=r[256|i>>16&255],o^=r[512|i>>8&255],o+=r[768|255&i],a^=o^n[4],o=r[a>>>24],o+=r[256|a>>16&255],o^=r[512|a>>8&255],o+=r[768|255&a],i^=o^n[5],o=r[i>>>24],o+=r[256|i>>16&255],o^=r[512|i>>8&255],o+=r[768|255&i],a^=o^n[6],o=r[a>>>24],o+=r[256|a>>16&255],o^=r[512|a>>8&255],o+=r[768|255&a],i^=o^n[7],o=r[i>>>24],o+=r[256|i>>16&255],o^=r[512|i>>8&255],o+=r[768|255&i],a^=o^n[8],o=r[a>>>24],o+=r[256|a>>16&255],o^=r[512|a>>8&255],o+=r[768|255&a],i^=o^n[9],o=r[i>>>24],o+=r[256|i>>16&255],o^=r[512|i>>8&255],o+=r[768|255&i],a^=o^n[10],o=r[a>>>24],o+=r[256|a>>16&255],o^=r[512|a>>8&255],o+=r[768|255&a],i^=o^n[11],o=r[i>>>24],o+=r[256|i>>16&255],o^=r[512|i>>8&255],o+=r[768|255&i],a^=o^n[12],o=r[a>>>24],o+=r[256|a>>16&255],o^=r[512|a>>8&255],o+=r[768|255&a],i^=o^n[13],o=r[i>>>24],o+=r[256|i>>16&255],o^=r[512|i>>8&255],o+=r[768|255&i],a^=o^n[14],o=r[a>>>24],o+=r[256|a>>16&255],o^=r[512|a>>8&255],o+=r[768|255&a],i^=o^n[15],o=r[i>>>24],o+=r[256|i>>16&255],o^=r[512|i>>8&255],o+=r[768|255&i],a^=o^n[16],e[t]=i^n[17],e[t+1]=a,e},rt=(e,t)=>{let n=0;for(let r=0;r<4;++r)n=n<<8|255&e[t],t=(t+1)%e.length;return{key:n,offp:t}},mo=(e,t,n)=>{const r=t.length,o=n.length;let a,i=0,c=[0,0];for(let l=0;l{const a=Zi.slice(),i=a.length;if(n<4||n>31){const f=new Error(`Illegal number of rounds (4-31): ${n}`);if(r===!1)return Promise.reject(f);throw f}if(t.length!==16){const f=new Error(`Illegal salt length: ${t.length} != 16`);if(r===!1)return Promise.reject(f);throw f}let c,l;n=1<>>0;let s,u=0;Int32Array?(c=new Int32Array(fo),l=new Int32Array(po)):(c=fo.slice(),l=po.slice()),((f,m,b,v)=>{const _=b.length,y=v.length;let E,w=0,O=[0,0];for(let k=0;k<_;k++)E=rt(m,w),w=E.offp,b[k]=b[k]^E.key;w=0;for(let k=0;k<_;k+=2)E=rt(f,w),w=E.offp,O[0]^=E.key,E=rt(f,w),w=E.offp,O[1]^=E.key,O=Tt(O,0,b,v),b[k]=O[0],b[k+1]=O[1];for(let k=0;k{if(o&&o(u/n),!(u>1;s++)Tt(a,s<<1,c,l);const f=[];for(u=0;u>24&255)>>>0),f.push((a[u]>>16&255)>>>0),f.push((a[u]>>8&255)>>>0),f.push((255&a[u])>>>0);return r===!1?Promise.resolve(f):f}{const f=Date.now();for(;u100)););}if(r===!1)return new Promise(f=>m1(()=>{p().then(f)}))};if(r===!1)return p();{let f;for(;;)if((f=p())!==void 0)return f||[]}},v1=(e=10)=>{if(typeof e!="number")throw Error("Illegal arguments: "+typeof e);e<4?e=4:e>31&&(e=31);const t=[];return t.push("$2a$"),e<10&&t.push("0"),t.push(e.toString()),t.push("$"),t.push(Xn((n=>{try{let r;return(self.crypto||self.msCrypto).getRandomValues(r=new Uint32Array(n)),Array.prototype.slice.call(r)}catch{throw Error("WebCryptoAPI is not available")}})(16),16)),t.join("")};function h1(e,t,n,r){if(typeof e!="string"||typeof t!="string"){const p=new Error("Invalid string / salt: Not a string");if(n===!1)return Promise.reject(p);throw p}let o,a;if(t.charAt(0)!=="$"||t.charAt(1)!=="2"){const p=new Error("Invalid salt version: "+t.substring(0,2));if(n===!1)return Promise.reject(p);throw p}if(t.charAt(2)==="$")o=String.fromCharCode(0),a=3;else{if(o=t.charAt(2),o!=="a"&&o!=="b"&&o!=="y"||t.charAt(3)!=="$"){const p=Error("Invalid salt revision: "+t.substring(2,4));if(n===!1)return Promise.reject(p);throw p}a=4}if(t.charAt(a+2)>"$"){const p=new Error("Missing salt rounds");if(n===!1)return Promise.reject(p);throw p}const i=10*parseInt(t.substring(a,a+1),10)+parseInt(t.substring(a+1,a+2),10),c=t.substring(a+3,a+25),l=(p=>{const f=[];let m=0;var b;return b=v=>{f.push(v)},((v,_)=>{let y,E=null;for(;(y=E!==null?E:v())!==null;)y>=55296&&y<=57343&&(E=v())!==null&&E>=56320&&E<=57343?(_(1024*(y-55296)+E-56320+65536),E=null):_(y);E!==null&&_(E)})(()=>m>=p.length?null:p.charCodeAt(m++),function(v){((_,y)=>{let E=null;for(typeof _=="number"&&(E=_,_=()=>null);E!==null||(E=_())!==null;)E<128?y(127&E):E<2048?(y(E>>6&31|192),y(63&E|128)):E<65536?(y(E>>12&15|224),y(E>>6&63|128),y(63&E|128)):(y(E>>18&7|240),y(E>>12&63|128),y(E>>6&63|128),y(63&E|128)),E=null})(v,b)}),f})(e+=o>="a"?"\0":""),s=((p,f)=>{if(f<=0)throw Error(`Illegal len: ${f}`);const m=p.length;let b,v,_,y,E,w,O=0,k=0;const C=[];for(;O>>0,E|=(48&v)>>4,C.push(String.fromCharCode(E)),!(++k>=f||O>=m))&&(w=p.charCodeAt(O++),_=w>>0,E|=(60&_)>>2,C.push(String.fromCharCode(E)),!(++k>=f||O>=m));)w=p.charCodeAt(O++),y=w>>0,E|=y,C.push(String.fromCharCode(E)),++k;return C.map(T=>T.charCodeAt(0))})(c,16),u=p=>{const f=[];return f.push("$2"),o>="a"&&f.push(o),f.push("$"),i<10&&f.push("0"),f.push(i.toString()),f.push("$"),f.push(Xn(s,s.length)),f.push(Xn(p,4*Zi.length-1)),f.join("")};return n===!1?vo(l,s,i,!1,r).then(p=>u(p)):u(vo(l,s,i,!0,r))}const g1=(e,t=10)=>{if(typeof t=="number"&&(t=v1(t)),typeof e!="string"||typeof t!="string")throw Error("Illegal arguments: "+typeof e+", "+typeof t);return h1(e,t,!0)},er=(e,t)=>{if(typeof e!="string"||typeof t!="string")throw Error("Illegal arguments: "+typeof e+", "+typeof t);return t.length===60&&g1(e,t.substring(0,t.length-31))===t},Xi=()=>{const e=ze();return I(()=>e.value.encrypt||{})},ho="VUEPRESS_HOPE_GLOBAL_TOKEN",_1=()=>{const e=Xi(),t=Ht(ho,""),n=ti(ho,""),r=I(()=>{const{global:i=!1,admin:c=[]}=e.value;return i&&c.length>0}),o=I(()=>{if(r.value){if(t.value)return e.value.admin.some(i=>er(t.value,i));if(n.value)return e.value.admin.some(i=>er(n.value,i))}return!1});return{isEncrypted:r,isDecrypted:o,validate:(i,c=!1)=>{(c?t:n).value=i}}},$n=(e="",t)=>Boolean(e)&&er(e,t),go="VUEPRESS_HOPE_PATH_TOKEN",b1=()=>{const e=J(),t=Xi(),n=Ht(go,{}),r=ti(go,{}),o=l=>bn(t.value.config)?Qe(t.value.config).filter(s=>pt(decodeURI(l),s)).sort((s,u)=>u.length-s.length):[],a=l=>{const s=o(l);if(s.length>0){const{config:u={}}=t.value;return{isEncrypted:!0,isDecrypted:s.some(p=>n.value[p]&&u[p].some(f=>$n(n.value[p],f))||r.value[p]&&u[p].some(f=>$n(r.value[p],f)))}}return{isDecrypted:!1,isEncrypted:!1}};return{status:I(()=>a(e.value.path)),getStatus:a,validate:(l,s=!1)=>{const{config:u={}}=t.value,p=o(e.value.path);for(const f of p)if(u[f].filter(m=>$n(l,m))){(s?n:r).value[f]=l;break}}}},y1=j({name:"GlobalEncrypt",setup(e,{slots:t}){const{isDecrypted:n,isEncrypted:r,validate:o}=_1(),a=z(!1);return re(()=>{a.value=!0}),()=>d(Yi,()=>{var i,c;return r.value?a.value?n.value?(i=t.default)==null?void 0:i.call(t):d(Qi,{full:!0,onVerify:o}):null:(c=t.default)==null?void 0:c.call(t)})}}),E1=j({name:"LocalEncrypt",setup(e,{slots:t}){const{status:n,validate:r}=b1(),o=z(!1);return re(()=>{o.value=!0}),()=>{var c,l;const{isEncrypted:a,isDecrypted:i}=n.value;return a?o.value?i?((c=t.default)==null?void 0:c.call(t))||null:d(Qi,{full:!0,onVerify:r}):null:((l=t.default)==null?void 0:l.call(t))||null}}}),O1=ke({enhance:({app:e,router:t})=>{const{scrollBehavior:n}=t.options;t.options.scrollBehavior=async(...r)=>(await mi().wait(),n(...r)),Os(e),e.component("HopeIcon",me),e.component("GlobalEncrypt",y1),e.component("LocalEncrypt",E1)},setup:()=>{ws(),$s()},layouts:{Layout:d1,NotFound:p1}});/*! @docsearch/js 3.3.3 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */function _o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function G(e){for(var t=1;t=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function sn(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,r){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var a,i,c=[],l=!0,s=!1;try{for(o=o.call(n);!(l=(a=o.next()).done)&&(c.push(a.value),!r||c.length!==r);l=!0);}catch(u){s=!0,i=u}finally{try{l||o.return==null||o.return()}finally{if(s)throw i}}return c}}(e,t)||ec(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function dn(e){return function(t){if(Array.isArray(t))return nr(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||ec(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ec(e,t){if(e){if(typeof e=="string")return nr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nr(e,t):void 0}}function nr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3)for(n=[n],a=3;a0?Lt(m.type,m.props,m.key,null,m.__v):m)!=null){if(m.__=n,m.__b=n.__b+1,(f=y[u])===null||f&&m.key==f.key&&m.type===f.type)y[u]=void 0;else for(p=0;p3)for(n=[n],a=3;a=n.__.length&&n.__.push({}),n.__[e]}function fc(e){return st=1,pc(vc,e)}function pc(e,t,n){var r=Ft(gt++,2);return r.t=e,r.__c||(r.__=[n?n(t):vc(void 0,t),function(o){var a=r.t(r.__[0],o);r.__[0]!==a&&(r.__=[a,r.__[1]],r.__c.setState({}))}],r.__c=le),r.__}function mc(e,t){var n=Ft(gt++,3);!V.__s&&$r(n.__H,t)&&(n.__=e,n.__H=t,le.__H.__h.push(n))}function Do(e,t){var n=Ft(gt++,4);!V.__s&&$r(n.__H,t)&&(n.__=e,n.__H=t,le.__h.push(n))}function Vn(e,t){var n=Ft(gt++,7);return $r(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function D1(){or.forEach(function(e){if(e.__P)try{e.__H.__h.forEach(nn),e.__H.__h.forEach(ar),e.__H.__h=[]}catch(t){e.__H.__h=[],V.__e(t,e.__v)}}),or=[]}V.__b=function(e){le=null,So&&So(e)},V.__r=function(e){ko&&ko(e),gt=0;var t=(le=e.__c).__H;t&&(t.__h.forEach(nn),t.__h.forEach(ar),t.__h=[])},V.diffed=function(e){Po&&Po(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(or.push(t)!==1&&wo===V.requestAnimationFrame||((wo=V.requestAnimationFrame)||function(n){var r,o=function(){clearTimeout(a),Lo&&cancelAnimationFrame(r),setTimeout(n)},a=setTimeout(o,100);Lo&&(r=requestAnimationFrame(o))})(D1)),le=void 0},V.__c=function(e,t){t.some(function(n){try{n.__h.forEach(nn),n.__h=n.__h.filter(function(r){return!r.__||ar(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],V.__e(r,n.__v)}}),Io&&Io(e,t)},V.unmount=function(e){To&&To(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(nn)}catch(n){V.__e(n,t.__v)}};var Lo=typeof requestAnimationFrame=="function";function nn(e){var t=le;typeof e.__c=="function"&&e.__c(),le=t}function ar(e){var t=le;e.__c=e.__(),le=t}function $r(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function vc(e,t){return typeof t=="function"?t(e):t}function hc(e,t){for(var n in t)e[n]=t[n];return e}function ir(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function cr(e){this.props=e}(cr.prototype=new De).isPureReactComponent=!0,cr.prototype.shouldComponentUpdate=function(e,t){return ir(this.props,e)||ir(this.state,t)};var Ao=V.__b;V.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ao&&Ao(e)};var L1=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,xo=function(e,t){return e==null?null:$e($e(e).map(t))},A1={map:xo,forEach:xo,count:function(e){return e?$e(e).length:0},only:function(e){var t=$e(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:$e},x1=V.__e;function rn(){this.__u=0,this.t=null,this.__b=null}function gc(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function St(){this.u=null,this.o=null}V.__e=function(e,t,n){if(e.then){for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}x1(e,t,n)},(rn.prototype=new De).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=gc(r.__v),a=!1,i=function(){a||(a=!0,n.componentWillUnmount=n.__c,o?o(c):c())};n.__c=n.componentWillUnmount,n.componentWillUnmount=function(){i(),n.__c&&n.__c()};var c=function(){if(!--r.__u){if(r.state.__e){var s=r.state.__e;r.__v.__k[0]=function p(f,m,b){return f&&(f.__v=null,f.__k=f.__k&&f.__k.map(function(v){return p(v,m,b)}),f.__c&&f.__c.__P===m&&(f.__e&&b.insertBefore(f.__e,f.__d),f.__c.__e=!0,f.__c.__P=b)),f}(s,s.__c.__P,s.__c.__O)}var u;for(r.setState({__e:r.__b=null});u=r.t.pop();)u.forceUpdate()}},l=t.__h===!0;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(i,i)},rn.prototype.componentWillUnmount=function(){this.t=[]},rn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function a(i,c,l){return i&&(i.__c&&i.__c.__H&&(i.__c.__H.__.forEach(function(s){typeof s.__c=="function"&&s.__c()}),i.__c.__H=null),(i=hc({},i)).__c!=null&&(i.__c.__P===l&&(i.__c.__P=c),i.__c=null),i.__k=i.__k&&i.__k.map(function(s){return a(s,c,l)})),i}(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__e&&Te(Fe,null,e.fallback);return o&&(o.__h=null),[Te(Fe,null,t.__e?null:e.children),o]};var Co=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(r)}}),jt(Te(C1,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function _c(e,t){return Te(R1,{__v:e,i:t})}(St.prototype=new De).__e=function(e){var t=this,n=gc(t.__v),r=t.o.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),Co(t,e,r)):o()};n?n(a):a()}},St.prototype.render=function(e){this.u=null,this.o=new Map;var t=$e(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},St.prototype.componentDidUpdate=St.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Co(e,n,t)})};var bc=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,j1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,$1=function(e){return(typeof Symbol<"u"&&Ct(Symbol())=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};function yc(e,t,n){return t.__k==null&&(t.textContent=""),jt(e,t),typeof n=="function"&&n(),e?e.__c:null}De.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(De.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ro=V.event;function V1(){}function z1(){return this.cancelBubble}function M1(){return this.defaultPrevented}V.event=function(e){return Ro&&(e=Ro(e)),e.persist=V1,e.isPropagationStopped=z1,e.isDefaultPrevented=M1,e.nativeEvent=e};var Ec,jo={configurable:!0,get:function(){return this.class}},$o=V.vnode;V.vnode=function(e){var t=e.type,n=e.props,r=n;if(typeof t=="string"){for(var o in r={},n){var a=n[o];o==="value"&&"defaultValue"in n&&a==null||(o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&a===!0?a="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!$1(n.type)?o="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():j1.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():a===null&&(a=void 0),r[o]=a)}t=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=$e(n.children).forEach(function(i){i.props.selected=r.value.indexOf(i.props.value)!=-1})),t=="select"&&r.defaultValue!=null&&(r.value=$e(n.children).forEach(function(i){i.props.selected=r.multiple?r.defaultValue.indexOf(i.props.value)!=-1:r.defaultValue==i.props.value})),e.props=r}t&&n.class!=n.className&&(jo.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",jo)),e.$$typeof=bc,$o&&$o(e)};var Vo=V.__r;V.__r=function(e){Vo&&Vo(e),Ec=e.__c};var N1={ReactCurrentDispatcher:{current:{readContext:function(e){return Ec.__n[e.__c].props.value}}}};(typeof performance>"u"?"undefined":Ct(performance))=="object"&&typeof performance.now=="function"&&performance.now.bind(performance);function zo(e){return!!e&&e.$$typeof===bc}var g={useState:fc,useReducer:pc,useEffect:mc,useLayoutEffect:Do,useRef:function(e){return st=5,Vn(function(){return{current:e}},[])},useImperativeHandle:function(e,t,n){st=6,Do(function(){typeof e=="function"?e(t()):e&&(e.current=t())},n==null?n:n.concat(e))},useMemo:Vn,useCallback:function(e,t){return st=8,Vn(function(){return e},t)},useContext:function(e){var t=le.context[e.__c],n=Ft(gt++,9);return n.__c=e,t?(n.__==null&&(n.__=!0,t.sub(le)),t.props.value):e.__},useDebugValue:function(e,t){V.useDebugValue&&V.useDebugValue(t?t(e):e)},version:"16.8.0",Children:A1,render:yc,hydrate:function(e,t,n){return dc(e,t),typeof n=="function"&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(jt(null,e),!0)},createPortal:_c,createElement:Te,createContext:function(e,t){var n={__c:t="__cC"+nc++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,a;return this.getChildContext||(o=[],(a={})[t]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(i){this.props.value!==i.value&&o.some(rr)},this.sub=function(i){o.push(i);var c=i.componentWillUnmount;i.componentWillUnmount=function(){o.splice(o.indexOf(i),1),c&&c.call(i)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n},createFactory:function(e){return Te.bind(null,e)},cloneElement:function(e){return zo(e)?T1.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:Fe,isValidElement:zo,findDOMNode:function(e){return e&&(e.base||e.nodeType===1&&e)||null},Component:De,PureComponent:cr,memo:function(e,t){function n(o){var a=this.props.ref,i=a==o.ref;return!i&&a&&(a.call?a(null):a.current=null),t?!t(this.props,o)||!i:ir(this.props,o)}function r(o){return this.shouldComponentUpdate=n,Te(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:function(e){function t(n,r){var o=hc({},n);return delete o.ref,e(o,(r=n.ref||r)&&(Ct(r)!="object"||"current"in r)?r:null)}return t.$$typeof=L1,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:Fe,Suspense:rn,SuspenseList:St,lazy:function(e){var t,n,r;function o(a){if(t||(t=e()).then(function(i){n=i.default||i},function(i){r=i}),r)throw r;if(!n)throw t;return Te(n,a)}return o.displayName="Lazy",o.__f=!0,o},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:N1};function H1(){return g.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},g.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}function Oc(){return g.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},g.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}var B1=["translations"];function lr(){return lr=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var U1=g.forwardRef(function(e,t){var n=e.translations,r=n===void 0?{}:n,o=q1(e,B1),a=r.buttonText,i=a===void 0?"Search":a,c=r.buttonAriaLabel,l=c===void 0?"Search":c,s=F1(fc(null),2),u=s[0],p=s[1];return mc(function(){typeof navigator<"u"&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?p("⌘"):p("Ctrl"))},[]),g.createElement("button",lr({type:"button",className:"DocSearch DocSearch-Button","aria-label":l},o,{ref:t}),g.createElement("span",{className:"DocSearch-Button-Container"},g.createElement(Oc,null),g.createElement("span",{className:"DocSearch-Button-Placeholder"},i)),g.createElement("span",{className:"DocSearch-Button-Keys"},u!==null&&g.createElement(g.Fragment,null,g.createElement("kbd",{className:"DocSearch-Button-Key"},u==="Ctrl"?g.createElement(H1,null):u),g.createElement("kbd",{className:"DocSearch-Button-Key"},"K"))))});function $t(e){return e.reduce(function(t,n){return t.concat(n)},[])}var W1=0;function ur(e){return e.collections.length===0?0:e.collections.reduce(function(t,n){return t+n.items.length},0)}var wc=function(){},G1=[{segment:"autocomplete-core",version:"1.7.4"}];function on(e,t){var n=t;return{then:function(r,o){return on(e.then(Kt(r,n,e),Kt(o,n,e)),n)},catch:function(r){return on(e.catch(Kt(r,n,e)),n)},finally:function(r){return r&&n.onCancelList.push(r),on(e.finally(Kt(r&&function(){return n.onCancelList=[],r()},n,e)),n)},cancel:function(){n.isCanceled=!0;var r=n.onCancelList;n.onCancelList=[],r.forEach(function(o){o()})},isCanceled:function(){return n.isCanceled===!0}}}function No(e){return on(e,{isCanceled:!1,onCancelList:[]})}function Kt(e,t,n){return e?function(r){return t.isCanceled?r:e(r)}:n}function Ho(e,t,n,r){if(!n)return null;if(e<0&&(t===null||r!==null&&t===0))return n+e;var o=(t===null?-1:t)+e;return o<=-1||o>=n?r===null?null:0:o}function Bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function K1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y1(e,t){var n=[];return Promise.resolve(e(t)).then(function(r){return Promise.all(r.filter(function(o){return Boolean(o)}).map(function(o){if(o.sourceId,n.includes(o.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(o.sourceId)," is not unique."));n.push(o.sourceId);var a=function(i){for(var c=1;ce.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Qo,Nn,Xt,Ot=null,Zo=(Qo=-1,Nn=-1,Xt=void 0,function(e){var t=++Qo;return Promise.resolve(e).then(function(n){return Xt&&t=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var md=["props","refresh","store"],vd=["inputElement","formElement","panelElement"],hd=["inputElement"],gd=["inputElement","maxLength"],_d=["item","source"];function ea(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function yd(e){var t=e.props,n=e.refresh,r=e.store,o=wt(e,md);return{getEnvironmentProps:function(a){var i=a.inputElement,c=a.formElement,l=a.panelElement;function s(u){!r.getState().isOpen&&r.pendingRequests.isEmpty()||u.target===i||[c,l].some(function(p){return f=p,m=u.target,f===m||f.contains(m);var f,m})===!1&&(r.dispatch("blur",null),t.debug||r.pendingRequests.cancelAll())}return ce({onTouchStart:s,onMouseDown:s,onTouchMove:function(u){r.getState().isOpen!==!1&&i===t.environment.document.activeElement&&u.target!==i&&i.blur()}},wt(a,vd))},getRootProps:function(a){return ce({role:"combobox","aria-expanded":r.getState().isOpen,"aria-haspopup":"listbox","aria-owns":r.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label")},a)},getFormProps:function(a){return a.inputElement,ce({action:"",noValidate:!0,role:"search",onSubmit:function(i){var c;i.preventDefault(),t.onSubmit(ce({event:i,refresh:n,state:r.getState()},o)),r.dispatch("submit",null),(c=a.inputElement)===null||c===void 0||c.blur()},onReset:function(i){var c;i.preventDefault(),t.onReset(ce({event:i,refresh:n,state:r.getState()},o)),r.dispatch("reset",null),(c=a.inputElement)===null||c===void 0||c.focus()}},wt(a,hd))},getLabelProps:function(a){return ce({htmlFor:"".concat(t.id,"-input"),id:"".concat(t.id,"-label")},a)},getInputProps:function(a){var i;function c(v){(t.openOnFocus||Boolean(r.getState().query))&&ot(ce({event:v,props:t,query:r.getState().completion||r.getState().query,refresh:n,store:r},o)),r.dispatch("focus",null)}var l=a||{},s=(l.inputElement,l.maxLength),u=s===void 0?512:s,p=wt(l,gd),f=ct(r.getState()),m=function(v){return Boolean(v&&v.match(J1))}(((i=t.environment.navigator)===null||i===void 0?void 0:i.userAgent)||""),b=f!=null&&f.itemUrl&&!m?"go":"search";return ce({"aria-autocomplete":"both","aria-activedescendant":r.getState().isOpen&&r.getState().activeItemId!==null?"".concat(t.id,"-item-").concat(r.getState().activeItemId):void 0,"aria-controls":r.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label"),value:r.getState().completion||r.getState().query,id:"".concat(t.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:b,spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:u,type:"search",onChange:function(v){ot(ce({event:v,props:t,query:v.currentTarget.value.slice(0,u),refresh:n,store:r},o))},onKeyDown:function(v){(function(_){var y=_.event,E=_.props,w=_.refresh,O=_.store,k=pd(_,dd);if(y.key==="ArrowUp"||y.key==="ArrowDown"){var C=function(){var $=E.environment.document.getElementById("".concat(E.id,"-item-").concat(O.getState().activeItemId));$&&($.scrollIntoViewIfNeeded?$.scrollIntoViewIfNeeded(!1):$.scrollIntoView(!1))},T=function(){var $=ct(O.getState());if(O.getState().activeItemId!==null&&$){var x=$.item,L=$.itemInputValue,M=$.itemUrl,A=$.source;A.onActive(Ue({event:y,item:x,itemInputValue:L,itemUrl:M,refresh:w,source:A,state:O.getState()},k))}};y.preventDefault(),O.getState().isOpen===!1&&(E.openOnFocus||Boolean(O.getState().query))?ot(Ue({event:y,props:E,query:O.getState().query,refresh:w,store:O},k)).then(function(){O.dispatch(y.key,{nextActiveItemId:E.defaultActiveItemId}),T(),setTimeout(C,0)}):(O.dispatch(y.key,{}),T(),C())}else if(y.key==="Escape")y.preventDefault(),O.dispatch(y.key,null),O.pendingRequests.cancelAll();else if(y.key==="Tab")O.dispatch("blur",null),O.pendingRequests.cancelAll();else if(y.key==="Enter"){if(O.getState().activeItemId===null||O.getState().collections.every(function($){return $.items.length===0}))return void(E.debug||O.pendingRequests.cancelAll());y.preventDefault();var P=ct(O.getState()),D=P.item,R=P.itemInputValue,Y=P.itemUrl,fe=P.source;if(y.metaKey||y.ctrlKey)Y!==void 0&&(fe.onSelect(Ue({event:y,item:D,itemInputValue:R,itemUrl:Y,refresh:w,source:fe,state:O.getState()},k)),E.navigator.navigateNewTab({itemUrl:Y,item:D,state:O.getState()}));else if(y.shiftKey)Y!==void 0&&(fe.onSelect(Ue({event:y,item:D,itemInputValue:R,itemUrl:Y,refresh:w,source:fe,state:O.getState()},k)),E.navigator.navigateNewWindow({itemUrl:Y,item:D,state:O.getState()}));else if(!y.altKey){if(Y!==void 0)return fe.onSelect(Ue({event:y,item:D,itemInputValue:R,itemUrl:Y,refresh:w,source:fe,state:O.getState()},k)),void E.navigator.navigate({itemUrl:Y,item:D,state:O.getState()});ot(Ue({event:y,nextState:{isOpen:!1},props:E,query:R,refresh:w,store:O},k)).then(function(){fe.onSelect(Ue({event:y,item:D,itemInputValue:R,itemUrl:Y,refresh:w,source:fe,state:O.getState()},k))})}}})(ce({event:v,props:t,refresh:n,store:r},o))},onFocus:c,onBlur:wc,onClick:function(v){a.inputElement!==t.environment.document.activeElement||r.getState().isOpen||c(v)}},p)},getPanelProps:function(a){return ce({onMouseDown:function(i){i.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},a)},getListProps:function(a){return ce({role:"listbox","aria-labelledby":"".concat(t.id,"-label"),id:"".concat(t.id,"-list")},a)},getItemProps:function(a){var i=a.item,c=a.source,l=wt(a,_d);return ce({id:"".concat(t.id,"-item-").concat(i.__autocomplete_id),role:"option","aria-selected":r.getState().activeItemId===i.__autocomplete_id,onMouseMove:function(s){if(i.__autocomplete_id!==r.getState().activeItemId){r.dispatch("mousemove",i.__autocomplete_id);var u=ct(r.getState());if(r.getState().activeItemId!==null&&u){var p=u.item,f=u.itemInputValue,m=u.itemUrl,b=u.source;b.onActive(ce({event:s,item:p,itemInputValue:f,itemUrl:m,refresh:n,source:b,state:r.getState()},o))}}},onMouseDown:function(s){s.preventDefault()},onClick:function(s){var u=c.getItemInputValue({item:i,state:r.getState()}),p=c.getItemUrl({item:i,state:r.getState()});(p?Promise.resolve():ot(ce({event:s,nextState:{isOpen:!1},props:t,query:u,refresh:n,store:r},o))).then(function(){c.onSelect(ce({event:s,item:i,itemInputValue:u,itemUrl:p,refresh:n,source:c,state:r.getState()},o))})}},l)}}}function ta(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ed(e){for(var t=1;t0},reshape:function(f){return f.sources}},c),{},{id:(s=c.id)!==null&&s!==void 0?s:"autocomplete-".concat(W1++),plugins:p,initialState:tt({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},c.initialState),onStateChange:function(f){var m;(m=c.onStateChange)===null||m===void 0||m.call(c,f),p.forEach(function(b){var v;return(v=b.onStateChange)===null||v===void 0?void 0:v.call(b,f)})},onSubmit:function(f){var m;(m=c.onSubmit)===null||m===void 0||m.call(c,f),p.forEach(function(b){var v;return(v=b.onSubmit)===null||v===void 0?void 0:v.call(b,f)})},onReset:function(f){var m;(m=c.onReset)===null||m===void 0||m.call(c,f),p.forEach(function(b){var v;return(v=b.onReset)===null||v===void 0?void 0:v.call(b,f)})},getSources:function(f){return Promise.all([].concat(td(p.map(function(m){return m.getSources})),[c.getSources]).filter(Boolean).map(function(m){return Y1(m,f)})).then(function(m){return $t(m)}).then(function(m){return m.map(function(b){return tt(tt({},b),{},{onSelect:function(v){b.onSelect(v),l.forEach(function(_){var y;return(y=_.onSelect)===null||y===void 0?void 0:y.call(_,v)})},onActive:function(v){b.onActive(v),l.forEach(function(_){var y;return(y=_.onActive)===null||y===void 0?void 0:y.call(_,v)})}})})})},navigator:tt({navigate:function(f){var m=f.itemUrl;u.location.assign(m)},navigateNewTab:function(f){var m=f.itemUrl,b=u.open(m,"_blank","noopener");b==null||b.focus()},navigateNewWindow:function(f){var m=f.itemUrl;u.open(m,"_blank","noopener")}},c.navigator)})}(e,t),r=X1(Sd,n,function(c){var l=c.prevState,s=c.state;n.onStateChange(We({prevState:l,state:s,refresh:i},o))}),o=function(c){var l=c.store;return{setActiveItemId:function(s){l.dispatch("setActiveItemId",s)},setQuery:function(s){l.dispatch("setQuery",s)},setCollections:function(s){var u=0,p=s.map(function(f){return Jt(Jt({},f),{},{items:$t(f.items).map(function(m){return Jt(Jt({},m),{},{__autocomplete_id:u++})})})});l.dispatch("setCollections",p)},setIsOpen:function(s){l.dispatch("setIsOpen",s)},setStatus:function(s){l.dispatch("setStatus",s)},setContext:function(s){l.dispatch("setContext",s)}}}({store:r}),a=yd(We({props:n,refresh:i,store:r},o));function i(){return ot(We({event:new Event("input"),nextState:{isOpen:r.getState().isOpen},props:n,query:r.getState().query,refresh:i,store:r},o))}return n.plugins.forEach(function(c){var l;return(l=c.subscribe)===null||l===void 0?void 0:l.call(c,We(We({},o),{},{refresh:i,onSelect:function(s){t.push({onSelect:s})},onActive:function(s){t.push({onActive:s})}}))}),function(c){var l,s,u=c.metadata,p=c.environment;if(!((l=p.navigator)===null||l===void 0||(s=l.userAgent)===null||s===void 0)&&s.includes("Algolia Crawler")){var f=p.document.createElement("meta"),m=p.document.querySelector("head");f.name="algolia:metadata",setTimeout(function(){f.content=JSON.stringify(u),m.appendChild(f)},0)}}({metadata:Od({plugins:n.plugins,options:e}),environment:n.environment}),We(We({refresh:i},a),o)}function Id(e){var t=e.translations,n=(t===void 0?{}:t).searchByText,r=n===void 0?"Search by":n;return g.createElement("a",{href:"https://www.algolia.com/ref/docsearch/?utm_source=".concat(window.location.hostname,"&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch"),target:"_blank",rel:"noopener noreferrer"},g.createElement("span",{className:"DocSearch-Label"},r),g.createElement("svg",{width:"77",height:"19","aria-label":"Algolia",role:"img",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2196.2 500"},g.createElement("defs",null,g.createElement("style",null,".cls-1,.cls-2{fill:#003dff;}.cls-2{fill-rule:evenodd;}")),g.createElement("path",{className:"cls-2",d:"M1070.38,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"}),g.createElement("rect",{className:"cls-1",x:"1845.88",y:"104.73",width:"62.58",height:"277.9",rx:"5.9",ry:"5.9"}),g.createElement("path",{className:"cls-2",d:"M1851.78,71.38h50.77c3.26,0,5.9-2.64,5.9-5.9V5.9c0-3.62-3.24-6.39-6.82-5.83l-50.77,7.95c-2.87,.45-4.99,2.92-4.99,5.83v51.62c0,3.26,2.64,5.9,5.9,5.9Z"}),g.createElement("path",{className:"cls-2",d:"M1764.03,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"}),g.createElement("path",{className:"cls-2",d:"M1631.95,142.72c-11.14-12.25-24.83-21.65-40.78-28.31-15.92-6.53-33.26-9.85-52.07-9.85-18.78,0-36.15,3.17-51.92,9.85-15.59,6.66-29.29,16.05-40.76,28.31-11.47,12.23-20.38,26.87-26.76,44.03-6.38,17.17-9.24,37.37-9.24,58.36,0,20.99,3.19,36.87,9.55,54.21,6.38,17.32,15.14,32.11,26.45,44.36,11.29,12.23,24.83,21.62,40.6,28.46,15.77,6.83,40.12,10.33,52.4,10.48,12.25,0,36.78-3.82,52.7-10.48,15.92-6.68,29.46-16.23,40.78-28.46,11.29-12.25,20.05-27.04,26.25-44.36,6.22-17.34,9.24-33.22,9.24-54.21,0-20.99-3.34-41.19-10.03-58.36-6.38-17.17-15.14-31.8-26.43-44.03Zm-44.43,163.75c-11.47,15.75-27.56,23.7-48.09,23.7-20.55,0-36.63-7.8-48.1-23.7-11.47-15.75-17.21-34.01-17.21-61.2,0-26.89,5.59-49.14,17.06-64.87,11.45-15.75,27.54-23.52,48.07-23.52,20.55,0,36.63,7.78,48.09,23.52,11.47,15.57,17.36,37.98,17.36,64.87,0,27.19-5.72,45.3-17.19,61.2Z"}),g.createElement("path",{className:"cls-2",d:"M894.42,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"}),g.createElement("path",{className:"cls-2",d:"M2133.97,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"}),g.createElement("path",{className:"cls-2",d:"M1314.05,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-11.79,18.34-19.6,39.64-22.11,62.59-.58,5.3-.88,10.68-.88,16.14s.31,11.15,.93,16.59c4.28,38.09,23.14,71.61,50.66,94.52,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47h0c17.99,0,34.61-5.93,48.16-15.97,16.29-11.58,28.88-28.54,34.48-47.75v50.26h-.11v11.08c0,21.84-5.71,38.27-17.34,49.36-11.61,11.08-31.04,16.63-58.25,16.63-11.12,0-28.79-.59-46.6-2.41-2.83-.29-5.46,1.5-6.27,4.22l-12.78,43.11c-1.02,3.46,1.27,7.02,4.83,7.53,21.52,3.08,42.52,4.68,54.65,4.68,48.91,0,85.16-10.75,108.89-32.21,21.48-19.41,33.15-48.89,35.2-88.52V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,64.1s.65,139.13,0,143.36c-12.08,9.77-27.11,13.59-43.49,14.7-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-1.32,0-2.63-.03-3.94-.1-40.41-2.11-74.52-37.26-74.52-79.38,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33Z"}),g.createElement("path",{className:"cls-1",d:"M249.83,0C113.3,0,2,110.09,.03,246.16c-2,138.19,110.12,252.7,248.33,253.5,42.68,.25,83.79-10.19,120.3-30.03,3.56-1.93,4.11-6.83,1.08-9.51l-23.38-20.72c-4.75-4.21-11.51-5.4-17.36-2.92-25.48,10.84-53.17,16.38-81.71,16.03-111.68-1.37-201.91-94.29-200.13-205.96,1.76-110.26,92-199.41,202.67-199.41h202.69V407.41l-115-102.18c-3.72-3.31-9.42-2.66-12.42,1.31-18.46,24.44-48.53,39.64-81.93,37.34-46.33-3.2-83.87-40.5-87.34-86.81-4.15-55.24,39.63-101.52,94-101.52,49.18,0,89.68,37.85,93.91,85.95,.38,4.28,2.31,8.27,5.52,11.12l29.95,26.55c3.4,3.01,8.79,1.17,9.63-3.3,2.16-11.55,2.92-23.58,2.07-35.92-4.82-70.34-61.8-126.93-132.17-131.26-80.68-4.97-148.13,58.14-150.27,137.25-2.09,77.1,61.08,143.56,138.19,145.26,32.19,.71,62.03-9.41,86.14-26.95l150.26,133.2c6.44,5.71,16.61,1.14,16.61-7.47V9.48C499.66,4.25,495.42,0,490.18,0H249.83Z"})))}function en(e){return g.createElement("svg",{width:"15",height:"15","aria-label":e.ariaLabel,role:"img"},g.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"},e.children))}function Td(e){var t=e.translations,n=t===void 0?{}:t,r=n.selectText,o=r===void 0?"to select":r,a=n.selectKeyAriaLabel,i=a===void 0?"Enter key":a,c=n.navigateText,l=c===void 0?"to navigate":c,s=n.navigateUpKeyAriaLabel,u=s===void 0?"Arrow up":s,p=n.navigateDownKeyAriaLabel,f=p===void 0?"Arrow down":p,m=n.closeText,b=m===void 0?"to close":m,v=n.closeKeyAriaLabel,_=v===void 0?"Escape key":v,y=n.searchByText,E=y===void 0?"Search by":y;return g.createElement(g.Fragment,null,g.createElement("div",{className:"DocSearch-Logo"},g.createElement(Id,{translations:{searchByText:E}})),g.createElement("ul",{className:"DocSearch-Commands"},g.createElement("li",null,g.createElement("kbd",{className:"DocSearch-Commands-Key"},g.createElement(en,{ariaLabel:i},g.createElement("path",{d:"M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3"}))),g.createElement("span",{className:"DocSearch-Label"},o)),g.createElement("li",null,g.createElement("kbd",{className:"DocSearch-Commands-Key"},g.createElement(en,{ariaLabel:f},g.createElement("path",{d:"M7.5 3.5v8M10.5 8.5l-3 3-3-3"}))),g.createElement("kbd",{className:"DocSearch-Commands-Key"},g.createElement(en,{ariaLabel:u},g.createElement("path",{d:"M7.5 11.5v-8M10.5 6.5l-3-3-3 3"}))),g.createElement("span",{className:"DocSearch-Label"},l)),g.createElement("li",null,g.createElement("kbd",{className:"DocSearch-Commands-Key"},g.createElement(en,{ariaLabel:_},g.createElement("path",{d:"M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956"}))),g.createElement("span",{className:"DocSearch-Label"},b))))}function Dd(e){var t=e.hit,n=e.children;return g.createElement("a",{href:t.url},n)}function Ld(){return g.createElement("svg",{viewBox:"0 0 38 38",stroke:"currentColor",strokeOpacity:".5"},g.createElement("g",{fill:"none",fillRule:"evenodd"},g.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},g.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),g.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},g.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}function Ad(){return g.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},g.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},g.createElement("path",{d:"M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0"}),g.createElement("path",{d:"M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13"})))}function sr(){return g.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},g.createElement("path",{d:"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function xd(){return g.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},g.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},g.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),g.createElement("path",{d:"M8 17l-6-6 6-6"})))}var Cd=function(){return g.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},g.createElement("path",{d:"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))};function Rd(e){switch(e.type){case"lvl1":return g.createElement(Cd,null);case"content":return g.createElement($d,null);default:return g.createElement(jd,null)}}function jd(){return g.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},g.createElement("path",{d:"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function $d(){return g.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},g.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function aa(){return g.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},g.createElement("path",{d:"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function Vd(){return g.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},g.createElement("path",{d:"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0"}))}function zd(){return g.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},g.createElement("path",{d:"M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2"}))}function Md(e){var t=e.translations,n=t===void 0?{}:t,r=n.titleText,o=r===void 0?"Unable to fetch results":r,a=n.helpText,i=a===void 0?"You might want to check your network connection.":a;return g.createElement("div",{className:"DocSearch-ErrorScreen"},g.createElement("div",{className:"DocSearch-Screen-Icon"},g.createElement(Vd,null)),g.createElement("p",{className:"DocSearch-Title"},o),g.createElement("p",{className:"DocSearch-Help"},i))}var Nd=["translations"];function Hd(e){return function(t){if(Array.isArray(t))return Hn(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||function(t,n){if(t){if(typeof t=="string")return Hn(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hn(t,n)}}(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Hn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Fd(e){var t=e.translations,n=t===void 0?{}:t,r=Bd(e,Nd),o=n.noResultsText,a=o===void 0?"No results for":o,i=n.suggestedQueryText,c=i===void 0?"Try searching for":i,l=n.reportMissingResultsText,s=l===void 0?"Believe this query should return results?":l,u=n.reportMissingResultsLinkText,p=u===void 0?"Let us know.":u,f=r.state.context.searchSuggestions;return g.createElement("div",{className:"DocSearch-NoResults"},g.createElement("div",{className:"DocSearch-Screen-Icon"},g.createElement(zd,null)),g.createElement("p",{className:"DocSearch-Title"},a,' "',g.createElement("strong",null,r.state.query),'"'),f&&f.length>0&&g.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},g.createElement("p",{className:"DocSearch-Help"},c,":"),g.createElement("ul",null,f.slice(0,3).reduce(function(m,b){return[].concat(Hd(m),[g.createElement("li",{key:b},g.createElement("button",{className:"DocSearch-Prefill",key:b,type:"button",onClick:function(){r.setQuery(b.toLowerCase()+" "),r.refresh(),r.inputRef.current.focus()}},b))])},[]))),r.getMissingResultsUrl&&g.createElement("p",{className:"DocSearch-Help"},"".concat(s," "),g.createElement("a",{href:r.getMissingResultsUrl({query:r.state.query}),target:"_blank",rel:"noopener noreferrer"},p)))}var qd=["hit","attribute","tagName"];function ia(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ca(e){for(var t=1;t=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function la(e,t){return t.split(".").reduce(function(n,r){return n!=null&&n[r]?n[r]:null},e)}function nt(e){var t=e.hit,n=e.attribute,r=e.tagName;return Te(r===void 0?"span":r,ca(ca({},Wd(e,qd)),{},{dangerouslySetInnerHTML:{__html:la(t,"_snippetResult.".concat(n,".value"))||la(t,n)}}))}function ua(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,r){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var a,i,c=[],l=!0,s=!1;try{for(o=o.call(n);!(l=(a=o.next()).done)&&(c.push(a.value),!r||c.length!==r);l=!0);}catch(u){s=!0,i=u}finally{try{l||o.return==null||o.return()}finally{if(s)throw i}}return c}}(e,t)||function(n,r){if(n){if(typeof n=="string")return sa(n,r);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set")return Array.from(n);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return sa(n,r)}}(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function sa(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n|<\/mark>)/g,Yd=RegExp(Pc.source);function Ic(e){var t,n,r,o,a,i=e;if(!i.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var c=((i.__docsearch_parent?(t=i.__docsearch_parent)===null||t===void 0||(n=t._highlightResult)===null||n===void 0||(r=n.hierarchy)===null||r===void 0?void 0:r.lvl0:(o=e._highlightResult)===null||o===void 0||(a=o.hierarchy)===null||a===void 0?void 0:a.lvl0)||{}).value;return c&&Yd.test(c)?c.replace(Pc,""):c}function fr(){return fr=Object.assign||function(e){for(var t=1;t=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Xd(e){var t=e.translations,n=t===void 0?{}:t,r=Zd(e,Qd),o=n.recentSearchesTitle,a=o===void 0?"Recent":o,i=n.noRecentSearchesText,c=i===void 0?"No recent searches":i,l=n.saveRecentSearchButtonTitle,s=l===void 0?"Save this search":l,u=n.removeRecentSearchButtonTitle,p=u===void 0?"Remove this search from history":u,f=n.favoriteSearchesTitle,m=f===void 0?"Favorite":f,b=n.removeFavoriteSearchButtonTitle,v=b===void 0?"Remove this search from favorites":b;return r.state.status==="idle"&&r.hasCollections===!1?r.disableUserPersonalization?null:g.createElement("div",{className:"DocSearch-StartScreen"},g.createElement("p",{className:"DocSearch-Help"},c)):r.hasCollections===!1?null:g.createElement("div",{className:"DocSearch-Dropdown-Container"},g.createElement(dr,vn({},r,{title:a,collection:r.state.collections[0],renderIcon:function(){return g.createElement("div",{className:"DocSearch-Hit-icon"},g.createElement(Ad,null))},renderAction:function(_){var y=_.item,E=_.runFavoriteTransition,w=_.runDeleteTransition;return g.createElement(g.Fragment,null,g.createElement("div",{className:"DocSearch-Hit-action"},g.createElement("button",{className:"DocSearch-Hit-action-button",title:s,type:"submit",onClick:function(O){O.preventDefault(),O.stopPropagation(),E(function(){r.favoriteSearches.add(y),r.recentSearches.remove(y),r.refresh()})}},g.createElement(aa,null))),g.createElement("div",{className:"DocSearch-Hit-action"},g.createElement("button",{className:"DocSearch-Hit-action-button",title:p,type:"submit",onClick:function(O){O.preventDefault(),O.stopPropagation(),w(function(){r.recentSearches.remove(y),r.refresh()})}},g.createElement(sr,null))))}})),g.createElement(dr,vn({},r,{title:m,collection:r.state.collections[1],renderIcon:function(){return g.createElement("div",{className:"DocSearch-Hit-icon"},g.createElement(aa,null))},renderAction:function(_){var y=_.item,E=_.runDeleteTransition;return g.createElement("div",{className:"DocSearch-Hit-action"},g.createElement("button",{className:"DocSearch-Hit-action-button",title:v,type:"submit",onClick:function(w){w.preventDefault(),w.stopPropagation(),E(function(){r.favoriteSearches.remove(y),r.refresh()})}},g.createElement(sr,null)))}})))}var e0=["translations"];function hn(){return hn=Object.assign||function(e){for(var t=1;t=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var n0=g.memo(function(e){var t=e.translations,n=t===void 0?{}:t,r=t0(e,e0);if(r.state.status==="error")return g.createElement(Md,{translations:n==null?void 0:n.errorScreen});var o=r.state.collections.some(function(a){return a.items.length>0});return r.state.query?o===!1?g.createElement(Fd,hn({},r,{translations:n==null?void 0:n.noResultsScreen})):g.createElement(Jd,r):g.createElement(Xd,hn({},r,{hasCollections:o,translations:n==null?void 0:n.startScreen}))},function(e,t){return t.state.status==="loading"||t.state.status==="stalled"}),r0=["translations"];function gn(){return gn=Object.assign||function(e){for(var t=1;t=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a0(e){var t=e.translations,n=t===void 0?{}:t,r=o0(e,r0),o=n.resetButtonTitle,a=o===void 0?"Clear the query":o,i=n.resetButtonAriaLabel,c=i===void 0?"Clear the query":i,l=n.cancelButtonText,s=l===void 0?"Cancel":l,u=n.cancelButtonAriaLabel,p=u===void 0?"Cancel":u,f=r.getFormProps({inputElement:r.inputRef.current}).onReset;return g.useEffect(function(){r.autoFocus&&r.inputRef.current&&r.inputRef.current.focus()},[r.autoFocus,r.inputRef]),g.useEffect(function(){r.isFromSelection&&r.inputRef.current&&r.inputRef.current.select()},[r.isFromSelection,r.inputRef]),g.createElement(g.Fragment,null,g.createElement("form",{className:"DocSearch-Form",onSubmit:function(m){m.preventDefault()},onReset:f},g.createElement("label",gn({className:"DocSearch-MagnifierLabel"},r.getLabelProps()),g.createElement(Oc,null)),g.createElement("div",{className:"DocSearch-LoadingIndicator"},g.createElement(Ld,null)),g.createElement("input",gn({className:"DocSearch-Input",ref:r.inputRef},r.getInputProps({inputElement:r.inputRef.current,autoFocus:r.autoFocus,maxLength:64}))),g.createElement("button",{type:"reset",title:a,className:"DocSearch-Reset","aria-label":c,hidden:!r.state.query},g.createElement(sr,null))),g.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":p,onClick:r.onClose},s))}var i0=["_highlightResult","_snippetResult"];function c0(e,t){if(e==null)return{};var n,r,o=function(i,c){if(i==null)return{};var l,s,u={},p=Object.keys(i);for(s=0;s=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function l0(e){return function(){var t="__TEST_KEY__";try{return localStorage.setItem(t,""),localStorage.removeItem(t),!0}catch{return!1}}()===!1?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function pa(e){var t=e.key,n=e.limit,r=n===void 0?5:n,o=l0(t),a=o.getItem().slice(0,r);return{add:function(i){var c=i,l=(c._highlightResult,c._snippetResult,c0(c,i0)),s=a.findIndex(function(u){return u.objectID===l.objectID});s>-1&&a.splice(s,1),a.unshift(l),a=a.slice(0,r),o.setItem(a)},remove:function(i){a=a.filter(function(c){return c.objectID!==i.objectID}),o.setItem(a)},getAll:function(){return a}}}var u0=["facetName","facetQuery"];function s0(e){var t,n="algoliasearch-client-js-".concat(e.key),r=function(){return t===void 0&&(t=e.localStorage||window.localStorage),t},o=function(){return JSON.parse(r().getItem(n)||"{}")};return{get:function(a,i){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){var l=JSON.stringify(a),s=o()[l];return Promise.all([s||i(),s!==void 0])}).then(function(l){var s=sn(l,2),u=s[0],p=s[1];return Promise.all([u,p||c.miss(u)])}).then(function(l){return sn(l,1)[0]})},set:function(a,i){return Promise.resolve().then(function(){var c=o();return c[JSON.stringify(a)]=i,r().setItem(n,JSON.stringify(c)),i})},delete:function(a){return Promise.resolve().then(function(){var i=o();delete i[JSON.stringify(a)],r().setItem(n,JSON.stringify(i))})},clear:function(){return Promise.resolve().then(function(){r().removeItem(n)})}}}function kt(e){var t=dn(e.caches),n=t.shift();return n===void 0?{get:function(r,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return o().then(function(i){return Promise.all([i,a.miss(i)])}).then(function(i){return sn(i,1)[0]})},set:function(r,o){return Promise.resolve(o)},delete:function(r){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(r,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(r,o,a).catch(function(){return kt({caches:t}).get(r,o,a)})},set:function(r,o){return n.set(r,o).catch(function(){return kt({caches:t}).set(r,o)})},delete:function(r){return n.delete(r).catch(function(){return kt({caches:t}).delete(r)})},clear:function(){return n.clear().catch(function(){return kt({caches:t}).clear()})}}}function Bn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=r(),c=o&&o.miss||function(){return Promise.resolve()};return i.then(function(l){return c(l)}).then(function(){return i})},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(n){return delete t[JSON.stringify(n)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function d0(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function Tc(e,t){return t&&Object.keys(t).forEach(function(n){e[n]=t[n](e)}),e}function Tn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var lt={Read:1,Write:2,Any:3},Dc=1,f0=2,Lc=3;function Ac(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dc;return G(G({},e),{},{status:t,lastUpdate:Date.now()})}function xc(e){return typeof e=="string"?{protocol:"https",url:e,accept:lt.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||lt.Any}}var va="GET",Dn="POST";function p0(e,t){return Promise.all(t.map(function(n){return e.get(n,function(){return Promise.resolve(Ac(n))})})).then(function(n){var r=n.filter(function(i){return function(c){return c.status===Dc||Date.now()-c.lastUpdate>12e4}(i)}),o=n.filter(function(i){return function(c){return c.status===Lc&&Date.now()-c.lastUpdate<=12e4}(i)}),a=[].concat(dn(r),dn(o));return{getTimeout:function(i,c){return(o.length===0&&i===0?1:o.length+3+i)*c},statelessHosts:a.length>0?a.map(function(i){return xc(i)}):t}})}function ha(e,t,n,r){var o=[],a=function(f,m){if(!(f.method===va||f.data===void 0&&m.data===void 0)){var b=Array.isArray(f.data)?f.data:G(G({},f.data),m.data);return JSON.stringify(b)}}(n,r),i=function(f,m){var b=G(G({},f.headers),m.headers),v={};return Object.keys(b).forEach(function(_){var y=b[_];v[_.toLowerCase()]=y}),v}(e,r),c=n.method,l=n.method!==va?{}:G(G({},n.data),r.data),s=G(G(G({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),r.queryParameters),u=0,p=function f(m,b){var v=m.pop();if(v===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:ga(o)};var _={data:a,headers:i,method:c,url:v0(v,n.path,s),connectTimeout:b(u,e.timeouts.connect),responseTimeout:b(u,r.timeout)},y=function(w){var O={request:_,response:w,host:v,triesLeft:m.length};return o.push(O),O},E={onSucess:function(w){return function(O){try{return JSON.parse(O.content)}catch(k){throw function(C,T){return{name:"DeserializationError",message:C,response:T}}(k.message,O)}}(w)},onRetry:function(w){var O=y(w);return w.isTimedOut&&u++,Promise.all([e.logger.info("Retryable failure",Rc(O)),e.hostsCache.set(v,Ac(v,w.isTimedOut?Lc:f0))]).then(function(){return f(m,b)})},onFail:function(w){throw y(w),function(O,k){var C=O.content,T=O.status,P=C;try{P=JSON.parse(C).message}catch{}return function(D,R,Y){return{name:"ApiError",message:D,status:R,transporterStackTrace:Y}}(P,T,k)}(w,ga(o))}};return e.requester.send(_).then(function(w){return function(O,k){return function(C){var T=C.status;return C.isTimedOut||function(P){var D=P.isTimedOut,R=P.status;return!D&&~~R==0}(C)||~~(T/100)!=2&&~~(T/100)!=4}(O)?k.onRetry(O):~~(O.status/100)==2?k.onSucess(O):k.onFail(O)}(w,E)})};return p0(e.hostsCache,t).then(function(f){return p(dn(f.statelessHosts).reverse(),f.getTimeout)})}function m0(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(n){var r="; ".concat(n.segment).concat(n.version!==void 0?" (".concat(n.version,")"):"");return t.value.indexOf(r)===-1&&(t.value="".concat(t.value).concat(r)),t}};return t}function v0(e,t,n){var r=Cc(n),o="".concat(e.protocol,"://").concat(e.url,"/").concat(t.charAt(0)==="/"?t.substr(1):t);return r.length&&(o+="?".concat(r)),o}function Cc(e){return Object.keys(e).map(function(t){return Tn("%s=%s",t,(n=e[t],Object.prototype.toString.call(n)==="[object Object]"||Object.prototype.toString.call(n)==="[object Array]"?JSON.stringify(e[t]):e[t]));var n}).join("&")}function ga(e){return e.map(function(t){return Rc(t)})}function Rc(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return G(G({},e),{},{request:G(G({},e.request),{},{headers:G(G({},e.request.headers),t)})})}var h0=function(e){var t=e.appId,n=function(a,i,c){var l={"x-algolia-api-key":c,"x-algolia-application-id":i};return{headers:function(){return a===an.WithinHeaders?l:{}},queryParameters:function(){return a===an.WithinQueryParameters?l:{}}}}(e.authMode!==void 0?e.authMode:an.WithinHeaders,t,e.apiKey),r=function(a){var i=a.hostsCache,c=a.logger,l=a.requester,s=a.requestsCache,u=a.responsesCache,p=a.timeouts,f=a.userAgent,m=a.hosts,b=a.queryParameters,v={hostsCache:i,logger:c,requester:l,requestsCache:s,responsesCache:u,timeouts:p,userAgent:f,headers:a.headers,queryParameters:b,hosts:m.map(function(_){return xc(_)}),read:function(_,y){var E=ma(y,v.timeouts.read),w=function(){return ha(v,v.hosts.filter(function(k){return(k.accept<.Read)!=0}),_,E)};if((E.cacheable!==void 0?E.cacheable:_.cacheable)!==!0)return w();var O={request:_,mappedRequestOptions:E,transporter:{queryParameters:v.queryParameters,headers:v.headers}};return v.responsesCache.get(O,function(){return v.requestsCache.get(O,function(){return v.requestsCache.set(O,w()).then(function(k){return Promise.all([v.requestsCache.delete(O),k])},function(k){return Promise.all([v.requestsCache.delete(O),Promise.reject(k)])}).then(function(k){var C=sn(k,2);return C[0],C[1]})})},{miss:function(k){return v.responsesCache.set(O,k)}})},write:function(_,y){return ha(v,v.hosts.filter(function(E){return(E.accept<.Write)!=0}),_,ma(y,v.timeouts.write))}};return v}(G(G({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:lt.Read},{url:"".concat(t,".algolia.net"),accept:lt.Write}].concat(d0([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:G(G(G({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:G(G({},n.queryParameters()),e.queryParameters)})),o={transporter:r,appId:t,addAlgoliaAgent:function(a,i){r.userAgent.add({segment:a,version:i})},clearCache:function(){return Promise.all([r.requestsCache.clear(),r.responsesCache.clear()]).then(function(){})}};return Tc(o,e.methods)},jc=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={transporter:e.transporter,appId:e.appId,indexName:t};return Tc(r,n.methods)}},_a=function(e){return function(t,n){var r=t.map(function(o){return G(G({},o),{},{params:Cc(o.params||{})})});return e.transporter.read({method:Dn,path:"1/indexes/*/queries",data:{requests:r},cacheable:!0},n)}},ba=function(e){return function(t,n){return Promise.all(t.map(function(r){var o=r.params,a=o.facetName,i=o.facetQuery,c=S1(o,u0);return jc(e)(r.indexName,{methods:{searchForFacetValues:$c}}).searchForFacetValues(a,i,G(G({},n),c))}))}},g0=function(e){return function(t,n,r){return e.transporter.read({method:Dn,path:Tn("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r)}},_0=function(e){return function(t,n){return e.transporter.read({method:Dn,path:Tn("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n)}},$c=function(e){return function(t,n,r){return e.transporter.read({method:Dn,path:Tn("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r)}},b0=1,y0=2,E0=3;function Vc(e,t,n){var r,o={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(a){return new Promise(function(i){var c=new XMLHttpRequest;c.open(a.method,a.url,!0),Object.keys(a.headers).forEach(function(p){return c.setRequestHeader(p,a.headers[p])});var l,s=function(p,f){return setTimeout(function(){c.abort(),i({status:0,content:f,isTimedOut:!0})},1e3*p)},u=s(a.connectTimeout,"Connection timeout");c.onreadystatechange=function(){c.readyState>c.OPENED&&l===void 0&&(clearTimeout(u),l=s(a.responseTimeout,"Socket timeout"))},c.onerror=function(){c.status===0&&(clearTimeout(u),clearTimeout(l),i({content:c.responseText||"Network request failed",status:c.status,isTimedOut:!1}))},c.onload=function(){clearTimeout(u),clearTimeout(l),i({content:c.responseText,status:c.status,isTimedOut:!1})},c.send(a.data)})}},logger:(r=E0,{debug:function(a,i){return b0>=r&&console.debug(a,i),Promise.resolve()},info:function(a,i){return y0>=r&&console.info(a,i),Promise.resolve()},error:function(a,i){return console.error(a,i),Promise.resolve()}}),responsesCache:Bn(),requestsCache:Bn({serializable:!1}),hostsCache:kt({caches:[s0({key:"".concat("4.8.5","-").concat(e)}),Bn()]}),userAgent:m0("4.8.5").add({segment:"Browser",version:"lite"}),authMode:an.WithinQueryParameters};return h0(G(G(G({},o),n),{},{methods:{search:_a,searchForFacetValues:ba,multipleQueries:_a,multipleSearchForFacetValues:ba,initIndex:function(a){return function(i){return jc(a)(i,{methods:{search:_0,searchForFacetValues:$c,findAnswers:g0}})}}}}))}Vc.version="4.8.5";var O0=["footer","searchBox"];function At(){return At=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(u[l]=i[l]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function P0(e){var t=e.appId,n=e.apiKey,r=e.indexName,o=e.placeholder,a=o===void 0?"Search docs":o,i=e.searchParameters,c=e.onClose,l=c===void 0?Kd:c,s=e.transformItems,u=s===void 0?fa:s,p=e.hitComponent,f=p===void 0?Dd:p,m=e.resultsFooterComponent,b=m===void 0?function(){return null}:m,v=e.navigator,_=e.initialScrollY,y=_===void 0?0:_,E=e.transformSearchClient,w=E===void 0?fa:E,O=e.disableUserPersonalization,k=O!==void 0&&O,C=e.initialQuery,T=C===void 0?"":C,P=e.translations,D=P===void 0?{}:P,R=e.getMissingResultsUrl,Y=D.footer,fe=D.searchBox,$=k0(D,O0),x=S0(g.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),L=x[0],M=x[1],A=g.useRef(null),N=g.useRef(null),H=g.useRef(null),F=g.useRef(null),Q=g.useRef(null),W=g.useRef(10),ae=g.useRef(typeof window<"u"?window.getSelection().toString().slice(0,64):"").current,ie=g.useRef(T||ae).current,ve=function(q,ee,ue){return g.useMemo(function(){var se=Vc(q,ee);return se.addAlgoliaAgent("docsearch","3.3.3"),/docsearch.js \(.*\)/.test(se.transporter.userAgent.value)===!1&&se.addAlgoliaAgent("docsearch-react","3.3.3"),ue(se)},[q,ee,ue])}(t,n,w),he=g.useRef(pa({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(r),limit:10})).current,Oe=g.useRef(pa({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(r),limit:he.getAll().length===0?7:4})).current,ge=g.useCallback(function(q){if(!k){var ee=q.type==="content"?q.__docsearch_parent:q;ee&&he.getAll().findIndex(function(ue){return ue.objectID===ee.objectID})===-1&&Oe.add(ee)}},[he,Oe,k]),te=g.useMemo(function(){return Pd({id:"docsearch",defaultActiveItemId:0,placeholder:a,openOnFocus:!0,initialState:{query:ie,context:{searchSuggestions:[]}},navigator:v,onStateChange:function(q){M(q.state)},getSources:function(q){var ee=q.query,ue=q.state,se=q.setContext,Ne=q.setStatus;return ee?ve.search([{query:ee,indexName:r,params:Fn({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(W.current),"hierarchy.lvl2:".concat(W.current),"hierarchy.lvl3:".concat(W.current),"hierarchy.lvl4:".concat(W.current),"hierarchy.lvl5:".concat(W.current),"hierarchy.lvl6:".concat(W.current),"content:".concat(W.current)],snippetEllipsisText:"…",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20},i)}]).catch(function(ne){throw ne.name==="RetryError"&&Ne("error"),ne}).then(function(ne){var de=ne.results[0],_e=de.hits,zc=de.nbHits,Ln=da(_e,function(An){return Ic(An)});return ue.context.searchSuggestions.length0&&(qe(),Q.current&&Q.current.focus())},[ie,qe]),g.useEffect(function(){function q(){if(N.current){var ee=.01*window.innerHeight;N.current.style.setProperty("--docsearch-vh","".concat(ee,"px"))}}return q(),window.addEventListener("resize",q),function(){window.removeEventListener("resize",q)}},[]),g.createElement("div",At({ref:A},_t({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container",L.status==="stalled"&&"DocSearch-Container--Stalled",L.status==="error"&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(q){q.target===q.currentTarget&&l()}}),g.createElement("div",{className:"DocSearch-Modal",ref:N},g.createElement("header",{className:"DocSearch-SearchBar",ref:H},g.createElement(a0,At({},te,{state:L,autoFocus:ie.length===0,inputRef:Q,isFromSelection:Boolean(ie)&&ie===ae,translations:fe,onClose:l}))),g.createElement("div",{className:"DocSearch-Dropdown",ref:F},g.createElement(n0,At({},te,{indexName:r,state:L,hitComponent:f,resultsFooterComponent:b,disableUserPersonalization:k,recentSearches:Oe,favoriteSearches:he,inputRef:Q,translations:$,getMissingResultsUrl:R,onItemClick:function(q){ge(q),l()}}))),g.createElement("footer",{className:"DocSearch-Footer"},g.createElement(Td,{translations:Y}))))}function pr(){return pr=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:window;return typeof t=="string"?n.document.querySelector(t):t}(e.container,e.environment))}const D0=e=>e.button===1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey,L0=()=>{const e=Se();return{hitComponent:({hit:t,children:n})=>({type:"a",ref:void 0,constructor:void 0,key:void 0,props:{href:t.url,onClick:r=>{D0(r)||(r.preventDefault(),e.push(zr(t.url,"/")))},children:n},__v:null}),navigator:{navigate:({itemUrl:t})=>{e.push(zr(t,"/"))}},transformSearchClient:t=>{const n=oi(t.search,500);return{...t,search:async(...r)=>n(...r)}}}};h(()=>import("./style-e9220a04.js"),[]),h(()=>import("./docsearch-1d421ddb.js"),[]);const A0=j({name:"Docsearch",props:{containerId:{type:String,required:!1,default:"docsearch-container"},options:{type:Object,required:!0}},setup(e){const t=Je(),n=br(),r=L0(),o=I(()=>{var c;return{...e.options,...(c=e.options.locales)==null?void 0:c[t.value]}}),a=[],i=()=>{var l;const c=((l=o.value.searchParameters)==null?void 0:l.facetFilters)??[];a.splice(0,a.length,`lang:${n.value}`,..._n(c)?c:[c]),T0({...r,...o.value,container:`#${e.containerId}`,searchParameters:{...o.value.searchParameters,facetFilters:a}})};return re(()=>{i(),X([t,o],([c,l],[s,u])=>{c!==s&&JSON.stringify(l)!==JSON.stringify(u)&&i()}),X(n,(c,l)=>{if(c!==l){const s=a.findIndex(u=>u===`lang:${l}`);s>-1&&a.splice(s,1,`lang:${c}`)}})}),()=>d("div",{id:e.containerId})}}),x0={appId:"34YFD9IUQ2",apiKey:"9a9058b8655746634e01071411c366b8",indexName:"vuepress",searchParameters:{facetFilters:["tags:v2"]},locales:{"/zh/":{placeholder:"搜索文档",translations:{button:{buttonText:"搜索文档",buttonAriaLabel:"搜索文档"},modal:{searchBox:{resetButtonTitle:"清除查询条件",resetButtonAriaLabel:"清除查询条件",cancelButtonText:"取消",cancelButtonAriaLabel:"取消"},startScreen:{recentSearchesTitle:"搜索历史",noRecentSearchesText:"没有搜索历史",saveRecentSearchButtonTitle:"保存至搜索历史",removeRecentSearchButtonTitle:"从搜索历史中移除",favoriteSearchesTitle:"收藏",removeFavoriteSearchButtonTitle:"从收藏中移除"},errorScreen:{titleText:"无法获取结果",helpText:"你可能需要检查你的网络连接"},footer:{selectText:"选择",navigateText:"切换",closeText:"关闭",searchByText:"搜索提供者"},noResultsScreen:{noResultsText:"无法找到相关结果",suggestedQueryText:"你可以尝试查询",reportMissingResultsText:"你认为该查询应该有结果?",reportMissingResultsLinkText:"点击反馈"}}}}}},C0=ke({enhance({app:e}){e.component("Docsearch",()=>d(A0,{options:x0}))}}),tn=[gl,Eu,Iu,Du,xu,$u,Hu,Ku,Qu,os,O1,C0],R0=[["v-8daa1a0e","/",{y:"h",t:"Home",i:"fa6-solid:house"},["/index.html","/README.md"]],["v-6ce48554","/contributing.html",{y:"a",t:"Contributing Guide",i:"fa6-solid:signs-post"},["/contributing","/contributing.md"]],["v-b4ed4f1c","/advanced/architecture.html",{y:"a",t:"Architecture",i:"fa6-solid:folder-tree"},["/advanced/architecture","/advanced/architecture.md"]],["v-301ab792","/advanced/plugin.html",{y:"a",t:"Writing a Plugin",i:"fa6-solid:plug"},["/advanced/plugin","/advanced/plugin.md"]],["v-06329db8","/advanced/theme.html",{y:"a",t:"Writing a Theme",i:"fa6-solid:palette"},["/advanced/theme","/advanced/theme.md"]],["v-fffb8e28","/guide/",{y:"a",t:"Introduction",i:"fa6-solid:circle-info"},["/guide/index.html","/guide/README.md"]],["v-3c32c2ca","/guide/assets.html",{y:"a",t:"Assets",i:"fa6-solid:photo-film"},["/guide/assets","/guide/assets.md"]],["v-6f1f3595","/guide/bundler.html",{y:"a",t:"Bundler",i:"fa6-solid:boxes-packing"},["/guide/bundler","/guide/bundler.md"]],["v-4f4ccb8f","/guide/configuration.html",{y:"a",t:"Configuration",i:"fa6-solid:gear"},["/guide/configuration","/guide/configuration.md"]],["v-e8a66a70","/guide/deployment.html",{y:"a",t:"Deployment",i:"fa6-solid:rocket"},["/guide/deployment","/guide/deployment.md"]],["v-fb0f0066","/guide/getting-started.html",{y:"a",t:"Getting Started",i:"fa6-solid:lightbulb"},["/guide/getting-started","/guide/getting-started.md"]],["v-acb10be2","/guide/i18n.html",{y:"a",t:"I18n",i:"fa6-solid:language"},["/guide/i18n","/guide/i18n.md"]],["v-0978b044","/guide/markdown.html",{y:"a",t:"Markdown",i:"fa6-brands:markdown"},["/guide/markdown","/guide/markdown.md"]],["v-d0112c92","/guide/migration.html",{y:"a",t:"Migrating from v1",i:"fa6-solid:code-compare"},["/guide/migration","/guide/migration.md"]],["v-4eaf9f84","/guide/page.html",{y:"a",t:"Page",i:"fa6-solid:file"},["/guide/page","/guide/page.md"]],["v-1d14d5cc","/guide/plugin.html",{y:"a",t:"Plugin",i:"fa6-solid:plug"},["/guide/plugin","/guide/plugin.md"]],["v-4d76029c","/guide/theme.html",{y:"a",t:"Theme",i:"fa6-solid:palette"},["/guide/theme","/guide/theme.md"]],["v-a951be94","/reference/cli.html",{y:"a",t:"Command Line Interface",i:"bi:terminal-fill"},["/reference/cli","/reference/cli.md"]],["v-a84e51b8","/reference/client-api.html",{y:"a",t:"Client API",i:"fa6-brands:chrome"},["/reference/client-api","/reference/client-api.md"]],["v-55453034","/reference/components.html",{y:"a",t:"Built-in Components",i:"fa6-solid:puzzle-piece"},["/reference/components","/reference/components.md"]],["v-b249668c","/reference/config.html",{y:"a",t:"Config",i:"fa6-solid:gear"},["/reference/config","/reference/config.md"]],["v-3590f0ec","/reference/frontmatter.html",{y:"a",t:"Frontmatter",i:"fa-solid:bars"},["/reference/frontmatter","/reference/frontmatter.md"]],["v-4986678d","/reference/node-api.html",{y:"a",t:"Node API",i:"fa6-brands:node-js"},["/reference/node-api","/reference/node-api.md"]],["v-51569e88","/reference/plugin-api.html",{y:"a",t:"Plugin API",i:"fa6-solid:plug"},["/reference/plugin-api","/reference/plugin-api.md"]],["v-6b76c1c0","/reference/theme-api.html",{y:"a",t:"Theme API",i:"fa6-solid:palette"},["/reference/theme-api","/reference/theme-api.md"]],["v-2d0ad528","/zh/",{y:"h",t:"首页",i:"fa6-solid:house"},["/zh/index.html","/zh/README.md"]],["v-e012c1f2","/zh/contributing.html",{y:"a",t:"贡献指南",i:"fa6-solid:signs-post"},["/zh/contributing","/zh/contributing.md"]],["v-03c9312a","/advanced/cookbook/",{y:"a",t:"Introduction",i:"fa6-solid:circle-info"},["/advanced/cookbook/index.html","/advanced/cookbook/README.md"]],["v-2a57b498","/advanced/cookbook/adding-extra-pages.html",{y:"a",t:"Adding Extra Pages",i:"fa6-solid:circle-plus"},["/advanced/cookbook/adding-extra-pages","/advanced/cookbook/adding-extra-pages.md"]],["v-06adec7d","/advanced/cookbook/making-a-theme-extendable.html",{y:"a",t:"Making a Theme Extendable",i:"fa6-solid:clone"},["/advanced/cookbook/making-a-theme-extendable","/advanced/cookbook/making-a-theme-extendable.md"]],["v-4e3c9b8c","/advanced/cookbook/markdown-and-vue-sfc.html",{y:"a",t:"Markdown and Vue SFC",i:"fa6-brands:vuejs"},["/advanced/cookbook/markdown-and-vue-sfc","/advanced/cookbook/markdown-and-vue-sfc.md"]],["v-3bc3633f","/advanced/cookbook/passing-data-to-client-code.html",{y:"a",t:"Passing Data to Client Code",i:"fa6-solid:right-to-bracket"},["/advanced/cookbook/passing-data-to-client-code","/advanced/cookbook/passing-data-to-client-code.md"]],["v-3d6c80f5","/advanced/cookbook/usage-of-client-config.html",{y:"a",t:"Usage of Client Config",i:"fa6-solid:gear"},["/advanced/cookbook/usage-of-client-config","/advanced/cookbook/usage-of-client-config.md"]],["v-cf5a290e","/reference/bundler/vite.html",{y:"a",t:"Vite",i:"simple-icons:vite"},["/reference/bundler/vite","/reference/bundler/vite.md"]],["v-d4319af0","/reference/bundler/webpack.html",{y:"a",t:"Webpack",i:"mdi:webpack"},["/reference/bundler/webpack","/reference/bundler/webpack.md"]],["v-2e97e858","/reference/default-theme/components.html",{y:"a",t:"Built-in Components",i:"fa6-solid:puzzle-piece"},["/reference/default-theme/components","/reference/default-theme/components.md"]],["v-0f0d17a8","/reference/default-theme/config.html",{y:"a",t:"Config",i:"fa6-solid:gear"},["/reference/default-theme/config","/reference/default-theme/config.md"]],["v-6175ace0","/reference/default-theme/extending.html",{y:"a",t:"Extending",i:"fa6-solid:clone"},["/reference/default-theme/extending","/reference/default-theme/extending.md"]],["v-e5e26a84","/reference/default-theme/frontmatter.html",{y:"a",t:"Frontmatter",i:"fa-solid:bars"},["/reference/default-theme/frontmatter","/reference/default-theme/frontmatter.md"]],["v-176c9c4a","/reference/default-theme/markdown.html",{y:"a",t:"Markdown",i:"fa6-brands:markdown"},["/reference/default-theme/markdown","/reference/default-theme/markdown.md"]],["v-31e08608","/reference/default-theme/styles.html",{y:"a",t:"Styles",i:"fa6-solid:wand-magic-sparkles"},["/reference/default-theme/styles","/reference/default-theme/styles.md"]],["v-3ba02eb8","/reference/plugin/active-header-links.html",{y:"a",t:"active-header-links"},["/reference/plugin/active-header-links","/reference/plugin/active-header-links.md"]],["v-6474e88f","/reference/plugin/back-to-top.html",{y:"a",t:"back-to-top"},["/reference/plugin/back-to-top","/reference/plugin/back-to-top.md"]],["v-3df91977","/reference/plugin/container.html",{y:"a",t:"container"},["/reference/plugin/container","/reference/plugin/container.md"]],["v-ec0baf10","/reference/plugin/docsearch.html",{y:"a",t:"docsearch"},["/reference/plugin/docsearch","/reference/plugin/docsearch.md"]],["v-5c864690","/reference/plugin/external-link-icon.html",{y:"a",t:"external-link-icon"},["/reference/plugin/external-link-icon","/reference/plugin/external-link-icon.md"]],["v-0f9e4c06","/reference/plugin/git.html",{y:"a",t:"git"},["/reference/plugin/git","/reference/plugin/git.md"]],["v-b3f1b470","/reference/plugin/google-analytics.html",{y:"a",t:"google-analytics"},["/reference/plugin/google-analytics","/reference/plugin/google-analytics.md"]],["v-2ad6454d","/reference/plugin/medium-zoom.html",{y:"a",t:"medium-zoom"},["/reference/plugin/medium-zoom","/reference/plugin/medium-zoom.md"]],["v-46d4f19d","/reference/plugin/nprogress.html",{y:"a",t:"nprogress"},["/reference/plugin/nprogress","/reference/plugin/nprogress.md"]],["v-37c5e106","/reference/plugin/palette.html",{y:"a",t:"palette"},["/reference/plugin/palette","/reference/plugin/palette.md"]],["v-35ebfb0e","/reference/plugin/prismjs.html",{y:"a",t:"prismjs"},["/reference/plugin/prismjs","/reference/plugin/prismjs.md"]],["v-5f86289f","/reference/plugin/pwa-popup.html",{y:"a",t:"pwa-popup"},["/reference/plugin/pwa-popup","/reference/plugin/pwa-popup.md"]],["v-7ab4099e","/reference/plugin/pwa.html",{y:"a",t:"pwa"},["/reference/plugin/pwa","/reference/plugin/pwa.md"]],["v-7f8fee18","/reference/plugin/register-components.html",{y:"a",t:"register-components"},["/reference/plugin/register-components","/reference/plugin/register-components.md"]],["v-260e1012","/reference/plugin/search.html",{y:"a",t:"search"},["/reference/plugin/search","/reference/plugin/search.md"]],["v-bb2079f4","/reference/plugin/shiki.html",{y:"a",t:"shiki"},["/reference/plugin/shiki","/reference/plugin/shiki.md"]],["v-18fd0fcc","/reference/plugin/theme-data.html",{y:"a",t:"theme-data"},["/reference/plugin/theme-data","/reference/plugin/theme-data.md"]],["v-76709450","/reference/plugin/toc.html",{y:"a",t:"toc"},["/reference/plugin/toc","/reference/plugin/toc.md"]],["v-0754cde1","/zh/advanced/architecture.html",{y:"a",t:"架构",i:"fa6-solid:folder-tree"},["/zh/advanced/architecture","/zh/advanced/architecture.md"]],["v-574aac41","/zh/advanced/plugin.html",{y:"a",t:"开发插件",i:"fa6-solid:plug"},["/zh/advanced/plugin","/zh/advanced/plugin.md"]],["v-66c42ad6","/zh/advanced/theme.html",{y:"a",t:"开发主题",i:"fa6-solid:palette"},["/zh/advanced/theme","/zh/advanced/theme.md"]],["v-47357bdb","/zh/guide/",{y:"a",t:"介绍",i:"fa6-solid:circle-info"},["/zh/guide/index.html","/zh/guide/README.md"]],["v-029ba47b","/zh/guide/assets.html",{y:"a",t:"静态资源",i:"fa6-solid:photo-film"},["/zh/guide/assets","/zh/guide/assets.md"]],["v-75d28a04","/zh/guide/bundler.html",{y:"a",t:"打包工具",i:"fa6-solid:boxes-packing"},["/zh/guide/bundler","/zh/guide/bundler.md"]],["v-81f65e84","/zh/guide/configuration.html",{y:"a",t:"配置",i:"fa6-solid:gear"},["/zh/guide/configuration","/zh/guide/configuration.md"]],["v-4a7b6bf9","/zh/guide/deployment.html",{y:"a",t:"部署",i:"fa6-solid:rocket"},["/zh/guide/deployment","/zh/guide/deployment.md"]],["v-37781588","/zh/guide/getting-started.html",{y:"a",t:"快速上手",i:"fa6-solid:lightbulb"},["/zh/guide/getting-started","/zh/guide/getting-started.md"]],["v-4b8f1400","/zh/guide/i18n.html",{y:"a",t:"多语言支持",i:"fa6-solid:language"},["/zh/guide/i18n","/zh/guide/i18n.md"]],["v-6a0a3d62","/zh/guide/markdown.html",{y:"a",t:"Markdown",i:"fa6-brands:markdown"},["/zh/guide/markdown","/zh/guide/markdown.md"]],["v-81b14334","/zh/guide/migration.html",{y:"a",t:"从 v1 迁移",i:"fa6-solid:code-compare"},["/zh/guide/migration","/zh/guide/migration.md"]],["v-7a8fca2f","/zh/guide/page.html",{y:"a",t:"页面",i:"fa6-solid:file"},["/zh/guide/page","/zh/guide/page.md"]],["v-9043126a","/zh/guide/plugin.html",{y:"a",t:"插件",i:"fa6-solid:plug"},["/zh/guide/plugin","/zh/guide/plugin.md"]],["v-2efcb26a","/zh/guide/theme.html",{y:"a",t:"主题",i:"fa6-solid:palette"},["/zh/guide/theme","/zh/guide/theme.md"]],["v-9beb15b6","/zh/reference/cli.html",{y:"a",t:"命令行接口",i:"bi:terminal-fill"},["/zh/reference/cli","/zh/reference/cli.md"]],["v-332177d5","/zh/reference/client-api.html",{y:"a",t:"客户端 API",i:"fa6-brands:chrome"},["/zh/reference/client-api","/zh/reference/client-api.md"]],["v-5ca60897","/zh/reference/components.html",{y:"a",t:"内置组件",i:"fa6-solid:puzzle-piece"},["/zh/reference/components","/zh/reference/components.md"]],["v-65a9edeb","/zh/reference/config.html",{y:"a",t:"配置",i:"fa6-solid:gear"},["/zh/reference/config","/zh/reference/config.md"]],["v-d147334a","/zh/reference/frontmatter.html",{y:"a",t:"Frontmatter",i:"fa-solid:bars"},["/zh/reference/frontmatter","/zh/reference/frontmatter.md"]],["v-e19cff04","/zh/reference/node-api.html",{y:"a",t:"Node API",i:"fa6-brands:node-js"},["/zh/reference/node-api","/zh/reference/node-api.md"]],["v-5e9d516d","/zh/reference/plugin-api.html",{y:"a",t:"插件 API",i:"fa6-solid:plug"},["/zh/reference/plugin-api","/zh/reference/plugin-api.md"]],["v-49a27222","/zh/reference/theme-api.html",{y:"a",t:"主题 API",i:"fa6-solid:palette"},["/zh/reference/theme-api","/zh/reference/theme-api.md"]],["v-0a7c8599","/zh/advanced/cookbook/",{y:"a",t:"介绍",i:"fa6-solid:circle-info"},["/zh/advanced/cookbook/index.html","/zh/advanced/cookbook/README.md"]],["v-5b617736","/zh/advanced/cookbook/adding-extra-pages.html",{y:"a",t:"添加额外页面",i:"fa6-solid:circle-plus"},["/zh/advanced/cookbook/adding-extra-pages","/zh/advanced/cookbook/adding-extra-pages.md"]],["v-04c514ac","/zh/advanced/cookbook/making-a-theme-extendable.html",{y:"a",t:"开发一个可继承的主题",i:"fa6-solid:clone"},["/zh/advanced/cookbook/making-a-theme-extendable","/zh/advanced/cookbook/making-a-theme-extendable.md"]],["v-63e02eaa","/zh/advanced/cookbook/markdown-and-vue-sfc.html",{y:"a",t:"Markdown 与 Vue SFC",i:"fa6-brands:vuejs"},["/zh/advanced/cookbook/markdown-and-vue-sfc","/zh/advanced/cookbook/markdown-and-vue-sfc.md"]],["v-10b13bae","/zh/advanced/cookbook/passing-data-to-client-code.html",{y:"a",t:"向客户端代码传递数据",i:"fa6-solid:right-to-bracket"},["/zh/advanced/cookbook/passing-data-to-client-code","/zh/advanced/cookbook/passing-data-to-client-code.md"]],["v-c03241b4","/zh/advanced/cookbook/usage-of-client-config.html",{y:"a",t:"客户端配置的使用方法",i:"fa6-solid:gear"},["/zh/advanced/cookbook/usage-of-client-config","/zh/advanced/cookbook/usage-of-client-config.md"]],["v-6ff623ea","/zh/reference/bundler/vite.html",{y:"a",t:"Vite",i:"simple-icons:vite"},["/zh/reference/bundler/vite","/zh/reference/bundler/vite.md"]],["v-dde74f12","/zh/reference/bundler/webpack.html",{y:"a",t:"Webpack",i:"mdi:webpack"},["/zh/reference/bundler/webpack","/zh/reference/bundler/webpack.md"]],["v-551922c5","/zh/reference/default-theme/components.html",{y:"a",t:"内置组件",i:"fa6-solid:puzzle-piece"},["/zh/reference/default-theme/components","/zh/reference/default-theme/components.md"]],["v-03a561ce","/zh/reference/default-theme/config.html",{y:"a",t:"配置",i:"fa6-solid:gear"},["/zh/reference/default-theme/config","/zh/reference/default-theme/config.md"]],["v-90ed1862","/zh/reference/default-theme/extending.html",{y:"a",t:"继承",i:"fa6-solid:clone"},["/zh/reference/default-theme/extending","/zh/reference/default-theme/extending.md"]],["v-a566dc26","/zh/reference/default-theme/frontmatter.html",{y:"a",t:"Frontmatter",i:"fa-solid:bars"},["/zh/reference/default-theme/frontmatter","/zh/reference/default-theme/frontmatter.md"]],["v-c78c5de8","/zh/reference/default-theme/markdown.html",{y:"a",t:"Markdown",i:"fa6-brands:markdown"},["/zh/reference/default-theme/markdown","/zh/reference/default-theme/markdown.md"]],["v-2100bd79","/zh/reference/default-theme/styles.html",{y:"a",t:"样式",i:"fa6-solid:wand-magic-sparkles"},["/zh/reference/default-theme/styles","/zh/reference/default-theme/styles.md"]],["v-231b4d69","/zh/reference/plugin/active-header-links.html",{y:"a",t:"active-header-links"},["/zh/reference/plugin/active-header-links","/zh/reference/plugin/active-header-links.md"]],["v-6c6e4840","/zh/reference/plugin/back-to-top.html",{y:"a",t:"back-to-top"},["/zh/reference/plugin/back-to-top","/zh/reference/plugin/back-to-top.md"]],["v-b10e9d30","/zh/reference/plugin/container.html",{y:"a",t:"container"},["/zh/reference/plugin/container","/zh/reference/plugin/container.md"]],["v-190c7f2e","/zh/reference/plugin/docsearch.html",{y:"a",t:"docsearch"},["/zh/reference/plugin/docsearch","/zh/reference/plugin/docsearch.md"]],["v-7cc40dbf","/zh/reference/plugin/external-link-icon.html",{y:"a",t:"external-link-icon"},["/zh/reference/plugin/external-link-icon","/zh/reference/plugin/external-link-icon.md"]],["v-d2322692","/zh/reference/plugin/git.html",{y:"a",t:"git"},["/zh/reference/plugin/git","/zh/reference/plugin/git.md"]],["v-07ca2692","/zh/reference/plugin/google-analytics.html",{y:"a",t:"google-analytics"},["/zh/reference/plugin/google-analytics","/zh/reference/plugin/google-analytics.md"]],["v-32cfa4fe","/zh/reference/plugin/medium-zoom.html",{y:"a",t:"medium-zoom"},["/zh/reference/plugin/medium-zoom","/zh/reference/plugin/medium-zoom.md"]],["v-9f56ece4","/zh/reference/plugin/nprogress.html",{y:"a",t:"nprogress"},["/zh/reference/plugin/nprogress","/zh/reference/plugin/nprogress.md"]],["v-5fd3efae","/zh/reference/plugin/palette.html",{y:"a",t:"palette"},["/zh/reference/plugin/palette","/zh/reference/plugin/palette.md"]],["v-9cba4982","/zh/reference/plugin/prismjs.html",{y:"a",t:"prismjs"},["/zh/reference/plugin/prismjs","/zh/reference/plugin/prismjs.md"]],["v-6df47ee0","/zh/reference/plugin/pwa-popup.html",{y:"a",t:"pwa-popup"},["/zh/reference/plugin/pwa-popup","/zh/reference/plugin/pwa-popup.md"]],["v-01fcaa4f","/zh/reference/plugin/pwa.html",{y:"a",t:"pwa"},["/zh/reference/plugin/pwa","/zh/reference/plugin/pwa.md"]],["v-670b0cc9","/zh/reference/plugin/register-components.html",{y:"a",t:"register-components"},["/zh/reference/plugin/register-components","/zh/reference/plugin/register-components.md"]],["v-42d1e5c1","/zh/reference/plugin/search.html",{y:"a",t:"search"},["/zh/reference/plugin/search","/zh/reference/plugin/search.md"]],["v-7a12fb77","/zh/reference/plugin/shiki.html",{y:"a",t:"shiki"},["/zh/reference/plugin/shiki","/zh/reference/plugin/shiki.md"]],["v-411f140a","/zh/reference/plugin/theme-data.html",{y:"a",t:"theme-data"},["/zh/reference/plugin/theme-data","/zh/reference/plugin/theme-data.md"]],["v-048d95fe","/zh/reference/plugin/toc.html",{y:"a",t:"toc"},["/zh/reference/plugin/toc","/zh/reference/plugin/toc.md"]],["v-3706649a","/404.html",{y:"p",t:""},["/404"]],["v-638c1d18","/advanced/",{y:"p",t:"Advanced"},["/advanced/index.html"]],["v-22a2f9fd","/reference/",{y:"p",t:"Reference"},["/reference/index.html"]],["v-2b10d2fc","/reference/bundler/",{y:"p",t:"Bundler"},["/reference/bundler/index.html"]],["v-43e2b7cf","/reference/default-theme/",{y:"p",t:"Default Theme"},["/reference/default-theme/index.html"]],["v-d61a9282","/reference/plugin/",{y:"p",t:"Plugin"},["/reference/plugin/index.html"]],["v-16d7d7b6","/zh/advanced/",{y:"p",t:"Advanced"},["/zh/advanced/index.html"]],["v-70e5a528","/zh/reference/",{y:"p",t:"Reference"},["/zh/reference/index.html"]],["v-31c4276b","/zh/reference/bundler/",{y:"p",t:"Bundler"},["/zh/reference/bundler/index.html"]],["v-98ca8604","/zh/reference/default-theme/",{y:"p",t:"Default Theme"},["/zh/reference/default-theme/index.html"]],["v-5b5b9870","/zh/reference/plugin/",{y:"p",t:"Plugin"},["/zh/reference/plugin/index.html"]]];var Sa=j({name:"Vuepress",setup(){const e=pl();return()=>d(e.value)}}),j0=()=>R0.reduce((e,[t,n,r,o])=>(e.push({name:t,path:n,component:Sa,meta:r},...o.map(a=>({path:a,redirect:n}))),e),[{name:"404",path:"/:catchAll(.*)",component:Sa}]),$0=rl,V0=()=>{const e=el({history:$0(_r("/")),routes:j0(),scrollBehavior:(t,n,r)=>r||(t.hash?{el:t.hash}:{top:0})});return e.beforeResolve(async(t,n)=>{var r;(t.path!==n.path||n===tl)&&([Be.value]=await Promise.all([xe.resolvePageData(t.name),(r=Ta[t.name])==null?void 0:r.__asyncLoader()]))}),e},z0=e=>{e.component("ClientOnly",En),e.component("Content",ja)},M0=(e,t,n)=>{const r=I(()=>xe.resolveLayouts(n)),o=I(()=>xe.resolveRouteLocale(at.value.locales,t.currentRoute.value.path)),a=I(()=>xe.resolveSiteLocaleData(at.value,o.value)),i=I(()=>xe.resolvePageFrontmatter(Be.value)),c=I(()=>xe.resolvePageHeadTitle(Be.value,a.value)),l=I(()=>xe.resolvePageHead(c.value,i.value,a.value)),s=I(()=>xe.resolvePageLang(Be.value)),u=I(()=>xe.resolvePageLayout(Be.value,r.value));return e.provide(ul,r),e.provide(La,i),e.provide(fl,c),e.provide(Aa,l),e.provide(xa,s),e.provide(Ca,u),e.provide(yr,o),e.provide(Ra,a),Object.defineProperties(e.config.globalProperties,{$frontmatter:{get:()=>i.value},$head:{get:()=>l.value},$headTitle:{get:()=>c.value},$lang:{get:()=>s.value},$page:{get:()=>Be.value},$routeLocale:{get:()=>o.value},$site:{get:()=>at.value},$siteLocale:{get:()=>a.value},$withBase:{get:()=>Ke}}),{layouts:r,pageData:Be,pageFrontmatter:i,pageHead:l,pageHeadTitle:c,pageLang:s,pageLayout:u,routeLocale:o,siteData:at,siteLocaleData:a}},N0=()=>{const e=Ee(),t=dl(),n=br(),r=z([]),o=()=>{t.value.forEach(i=>{const c=H0(i);c&&r.value.push(c)})},a=()=>{document.documentElement.lang=n.value,r.value.forEach(i=>{i.parentNode===document.head&&document.head.removeChild(i)}),r.value.splice(0,r.value.length),t.value.forEach(i=>{const c=B0(i);c!==null&&(document.head.appendChild(c),r.value.push(c))})};Ia(ml,a),re(()=>{o(),a(),X(()=>e.path,()=>a())})},H0=([e,t,n=""])=>{const r=Object.entries(t).map(([c,l])=>be(l)?`[${c}=${JSON.stringify(l)}]`:l===!0?`[${c}]`:"").join(""),o=`head > ${e}${r}`;return Array.from(document.querySelectorAll(o)).find(c=>c.innerText===n)||null},B0=([e,t,n])=>{if(!be(e))return null;const r=document.createElement(e);return bn(t)&&Object.entries(t).forEach(([o,a])=>{be(a)?r.setAttribute(o,a):a===!0&&r.setAttribute(o,"")}),be(n)&&r.appendChild(document.createTextNode(n)),r},F0=nl,q0=async()=>{var n;const e=F0({name:"VuepressApp",setup(){var r;N0();for(const o of tn)(r=o.setup)==null||r.call(o);return()=>[d(ol),...tn.flatMap(({rootComponents:o=[]})=>o.map(a=>d(a)))]}}),t=V0();z0(e),M0(e,t,tn);for(const r of tn)await((n=r.enhance)==null?void 0:n.call(r,{app:e,router:t,siteData:at}));return e.use(t),{app:e,router:t}};q0().then(({app:e,router:t})=>{t.isReady().then(()=>{e.mount("#app")})});export{q0 as createVueApp}; diff --git a/assets/architecture.html-3196f842.js b/assets/architecture.html-3196f842.js new file mode 100644 index 00000000..10812465 --- /dev/null +++ b/assets/architecture.html-3196f842.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0754cde1","path":"/zh/advanced/architecture.html","title":"架构","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:folder-tree","description":"概览 vuepress-architecture-overview 上图展示了 VuePress 的简要架构: Node App 会生成临时文件,包括页面、路由等。; Bundler 会将 Client App 和临时文件一起进行打包,就像处理一个普通的 Vue SPA 一样。; 作为开发者,你必须要意识到 VuePress 分为两个主要部分: Nod...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/advanced/architecture.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/advanced/architecture.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"架构"}],["meta",{"property":"og:description","content":"概览 vuepress-architecture-overview 上图展示了 VuePress 的简要架构: Node App 会生成临时文件,包括页面、路由等。; Bundler 会将 Client App 和临时文件一起进行打包,就像处理一个普通的 Vue SPA 一样。; 作为开发者,你必须要意识到 VuePress 分为两个主要部分: Nod..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"架构\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"概览","slug":"概览","link":"#概览","children":[]},{"level":2,"title":"核心流程与 Hooks","slug":"核心流程与-hooks","link":"#核心流程与-hooks","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.49,"words":446},"filePathRelative":"zh/advanced/architecture.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/architecture.html-5185fb7b.js b/assets/architecture.html-5185fb7b.js new file mode 100644 index 00000000..ea185836 --- /dev/null +++ b/assets/architecture.html-5185fb7b.js @@ -0,0 +1 @@ +import{_ as r,a as i}from"./vuepress-core-process-3a7a342e.js";import{_ as a,W as s,X as u,$ as l,a0 as e,Y as t,Z as o,a1 as d,D as p}from"./framework-46b0e263.js";const c={},h=d('

架构

概览

vuepress-architecture-overview

上图展示了 VuePress 的简要架构:

  • Node App 会生成临时文件,包括页面、路由等。
  • Bundler 会将 Client App 和临时文件一起进行打包,就像处理一个普通的 Vue SPA 一样。

作为开发者,你必须要意识到 VuePress 分为两个主要部分: Node AppClient App ,这一点对于开发插件和主题来说都十分重要。

  • 插件或者主题的入口文件会在 Node App 中被加载。
  • 客户端文件会在 Client App 中被加载,也就是会被 Bundler 处理。比如组件、客户端配置文件等。

核心流程与 Hooks

vuepress-core-process

',9),_=l("strong",null,"init",-1),f=l("li",null,"主题和插件会被加载。这意味着插件需要在初始化之前使用。",-1),m=l("li",null,[e("在 "),l("strong",null,"prepare"),e(" 阶段: "),l("ul",null,[l("li",null,"临时文件会被生成,因此所有和客户端文件相关的 Hooks 会在此处调用。")])],-1),k=l("strong",null,"dev / build",-1);function g(x,w){const n=p("RouterLink");return s(),u("div",null,[h,l("p",null,[e("上图展示了 VuePress 的核心流程以及 "),t(n,{to:"/zh/reference/plugin-api.html"},{default:o(()=>[e("插件 API")]),_:1}),e(" 的 Hooks :")]),l("ul",null,[l("li",null,[e("在 "),_,e(" 阶段: "),l("ul",null,[f,l("li",null,[e("由于我们要使用 markdown-it 来解析 Markdown 文件,因此需要在加载页面文件之前创建 markdown-it 实例: "),l("ul",null,[l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#extendsmarkdownoptions"},{default:o(()=>[e("extendsMarkdownOptions")]),_:1}),e(" Hook 会被调用,用以创建 markdown-it 实例。")]),l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#extendsmarkdown"},{default:o(()=>[e("extendsMarkdown")]),_:1}),e(" Hook 会被调用,用以扩展 markdown-it 实例。")])])]),l("li",null,[e("页面文件会被加载: "),l("ul",null,[l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#extendspageoptions"},{default:o(()=>[e("extendsPageOptions")]),_:1}),e(" Hook 会被调用,用以创建页面。")]),l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#extendspage"},{default:o(()=>[e("extendsPage")]),_:1}),e(" Hook 会被调用,用以扩展页面对象。")])])])])]),m,l("li",null,[e("在 "),k,e(" 阶段: "),l("ul",null,[l("li",null,[e("Bundler 会被加载: "),l("ul",null,[l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#extendsbundleroptions"},{default:o(()=>[e("extendsBundlerOptions")]),_:1}),e(" Hook 会被调用,用以生成 Bundler 的配置。")]),l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#alias"},{default:o(()=>[e("alias")]),_:1}),e(" Hook 和 "),t(n,{to:"/zh/reference/plugin-api.html#define"},{default:o(()=>[e("define")]),_:1}),e(" Hook 会被用在 Bundler 的配置中,所以它们会在此处调用。")])])])])])])])}const v=a(c,[["render",g],["__file","architecture.html.vue"]]);export{v as default}; diff --git a/assets/architecture.html-60a60be6.js b/assets/architecture.html-60a60be6.js new file mode 100644 index 00000000..91e04217 --- /dev/null +++ b/assets/architecture.html-60a60be6.js @@ -0,0 +1 @@ +import{_ as i,a}from"./vuepress-core-process-3a7a342e.js";import{_ as r,W as s,X as d,$ as l,a0 as e,Y as n,Z as o,a1 as u,D as c}from"./framework-46b0e263.js";const p={},h=u('

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, routes, etc.
  • Bundler will handle Client App together with the temp files, just like a common Vue SPA.

As a developer, you must be aware of that VuePress has two main parts: Node App and Client App, which is important when developing plugins and themes:

  • The entry file of a plugin or a theme will be loaded in Node App.
  • Client files will be loaded in Client App, which will be handled by bundler. For example, components, client config files, etc.

Core Process and Hooks

vuepress-core-process

',9),f=l("strong",null,"init",-1),g=l("li",null,"Theme and plugins will be loaded. That means all the plugins should be used before initialization.",-1),m=l("li",null,[e("In the "),l("strong",null,"prepare"),e(" stage: "),l("ul",null,[l("li",null,"Temp files will be generated, so all hooks related to client files will be processed here.")])],-1),w=l("strong",null,"dev / build",-1);function _(b,k){const t=c("RouterLink");return s(),d("div",null,[h,l("p",null,[e("The above figure shows the core process of VuePress Node App and the hooks of "),n(t,{to:"/reference/plugin-api.html"},{default:o(()=>[e("Plugin API")]),_:1}),e(":")]),l("ul",null,[l("li",null,[e("In the "),f,e(" stage: "),l("ul",null,[g,l("li",null,[e("As we are using markdown-it to parse the markdown file, so we need to create markdown-it instance before loading pages: "),l("ul",null,[l("li",null,[n(t,{to:"/reference/plugin-api.html#extendsmarkdownoptions"},{default:o(()=>[e("extendsMarkdownOptions")]),_:1}),e(" hook will be processed to create markdown-it instance.")]),l("li",null,[n(t,{to:"/reference/plugin-api.html#extendsmarkdown"},{default:o(()=>[e("extendsMarkdown")]),_:1}),e(" hook will be processed extends markdown-it instance.")])])]),l("li",null,[e("Page files will be loaded: "),l("ul",null,[l("li",null,[n(t,{to:"/reference/plugin-api.html#extendspageoptions"},{default:o(()=>[e("extendsPageOptions")]),_:1}),e(" hook will be processed to create pages.")]),l("li",null,[n(t,{to:"/reference/plugin-api.html#extendspage"},{default:o(()=>[e("extendsPage")]),_:1}),e(" hook will be processed to extends page object.")])])])])]),m,l("li",null,[e("In the "),w,e(" stage: "),l("ul",null,[l("li",null,[e("Bundler will be resolved: "),l("ul",null,[l("li",null,[n(t,{to:"/reference/plugin-api.html#extendsbundleroptions"},{default:o(()=>[e("extendsBundlerOptions")]),_:1}),e(" hook will be processed to create bundler configuration.")]),l("li",null,[n(t,{to:"/reference/plugin-api.html#alias"},{default:o(()=>[e("alias")]),_:1}),e(" hook and "),n(t,{to:"/reference/plugin-api.html#define"},{default:o(()=>[e("define")]),_:1}),e(" hook would be used in bundler configuration, so they will be processed here.")])])])])])])])}const A=r(p,[["render",_],["__file","architecture.html.vue"]]);export{A as default}; diff --git a/assets/architecture.html-bfe48eba.js b/assets/architecture.html-bfe48eba.js new file mode 100644 index 00000000..6279e5a2 --- /dev/null +++ b/assets/architecture.html-bfe48eba.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-b4ed4f1c","path":"/advanced/architecture.html","title":"Architecture","lang":"en-US","frontmatter":{"icon":"fa6-solid:folder-tree","description":"Overview vuepress-architecture-overview The above figure shows a brief overview of the VuePress architecture: Node App will generate temp files, including the pages, routes, etc...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/advanced/architecture.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/advanced/architecture.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Architecture"}],["meta",{"property":"og:description","content":"Overview vuepress-architecture-overview The above figure shows a brief overview of the VuePress architecture: Node App will generate temp files, including the pages, routes, etc..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Architecture\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.08,"words":323},"filePathRelative":"advanced/architecture.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/assets.html-1b1d6062.js b/assets/assets.html-1b1d6062.js new file mode 100644 index 00000000..42c268db --- /dev/null +++ b/assets/assets.html-1b1d6062.js @@ -0,0 +1,33 @@ +import{_ as p}from"./hero-8a9eb0cf.js";import{_ as i,W as l,X as c,$ as a,a0 as s,Y as e,Z as t,a1 as o,D as r}from"./framework-46b0e263.js";const u={},d=o(`

Assets

Relative URLs

You can reference any assets using relative URLs in your Markdown content:

![An image](./image.png)
+

This is generally the suggested way to import images, as users usually place images near the Markdown file that references them.

Public Files

You can put some static assets inside public directory, and they will be copied to the root of the generated directory.

`,7),m=a("code",null,".vuepress/public",-1),k=o(`

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:

Input

![VuePress Logo](/images/hero.png)
+

Output

VuePress Logo

Base Helper

',10),g=a("code",null,"https://foo.github.io/bar/",-1),v=a("code",null,"'/bar/'",-1),h=a("code",null,"https://foo.github.io/bar/images/hero.png",-1),b=o('

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)\n
',2),f=a("code",null,"base",-1),y=a("code",null,"base",-1),_=o(`
<template>
+  <img :src="withBase(logoPath)" />
+</template>
+
+<script setup>
+import { ref } from "vue";
+import { withBase } from "@vuepress/client";
+
+const logoPath = ref("/images/hero.png");
+</script>
+

You can also access the helper by $withBase directly:

<img :src="$withBase('/images/hero.png')" alt="VuePress Logo">
+

Packages and Path Aliases

Although it is not a common usage, you can reference images from dependent packages:

npm install -D package-name
+
![Image from dependency](package-name/image.png)
+

The path aliases that set in config file are also supported:

import { getDirname, path } from "@vuepress/utils";
+
+const __dirname = getDirname(import.meta.url);
+
+export default {
+  alias: {
+    "@alias": path.resolve(__dirname, "./path/to/some/dir"),
+  },
+};
+
![Image from path alias](@alias/image.png)
+
`,10),w={class:"hint-container tip"},x=a("p",{class:"hint-container-title"},"Tips",-1);function q(P,L){const n=r("RouterLink");return l(),c("div",null,[d,a("p",null,[s("The default public directory is "),m,s(", which can be changed by "),e(n,{to:"/reference/config.html#public"},{default:t(()=>[s("public")]),_:1}),s(" option.")]),k,a("p",null,[s("If your site is deployed to a non-root URL, for example, "),g,s(", then the "),e(n,{to:"/reference/config.html#base"},{default:t(()=>[s("base")]),_:1}),s(" should be set to "),v,s(". Obviously, your public files would be served like "),h,s(" after deployment.")]),b,a("p",null,[s("However, sometimes you may have some dynamical links referencing public files, especially when you are authoring a custom theme. In such case, the "),f,s(" could not be handled automatically. To help with that, VuePress provides a "),e(n,{to:"/reference/client-api.html#withbase"},{default:t(()=>[s("withBase")]),_:1}),s(" helper to prepend "),y,s(" for you:")]),_,a("div",w,[x,a("p",null,[s("Config reference: "),e(n,{to:"/reference/plugin-api.html#alias"},{default:t(()=>[s("alias")]),_:1})])])])}const I=i(u,[["render",q],["__file","assets.html.vue"]]);export{I as default}; diff --git a/assets/assets.html-2f37d46f.js b/assets/assets.html-2f37d46f.js new file mode 100644 index 00000000..22dd6315 --- /dev/null +++ b/assets/assets.html-2f37d46f.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3c32c2ca","path":"/guide/assets.html","title":"Assets","lang":"en-US","frontmatter":{"icon":"fa6-solid:photo-film","description":"Relative URLs You can reference any assets using relative URLs in your Markdown content: This is generally the suggested way to import images, as users usually place images near...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/guide/assets.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/guide/assets.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Assets"}],["meta",{"property":"og:description","content":"Relative URLs You can reference any assets using relative URLs in your Markdown content: This is generally the suggested way to import images, as users usually place images near..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:image","content":"https://vuejs.press/"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2023-02-22T07:39:31.000Z"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:alt","content":"Assets"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Assets\\",\\"image\\":[\\"https://vuejs.press/\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.55,"words":465},"filePathRelative":"guide/assets.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/assets.html-4d2615e1.js b/assets/assets.html-4d2615e1.js new file mode 100644 index 00000000..7bdc5aa2 --- /dev/null +++ b/assets/assets.html-4d2615e1.js @@ -0,0 +1,33 @@ +import{_ as o}from"./hero-8a9eb0cf.js";import{_ as l,W as i,X as c,$ as n,a0 as s,Y as e,Z as t,a1 as p,D as u}from"./framework-46b0e263.js";const r={},d=p(`

静态资源

相对路径

你可以在你的 Markdown 内容中使用相对路径来引用静态资源:

![图片](./image.png)
+

一般情况下,我们推荐你使用这种方式来引用图片,因为人们通常会把图片放在引用它的 Markdown 文件附近。

Public 文件

你可以把一些静态资源放在 Public 目录中,它们会被复制到最终生成的网站的根目录下。

`,7),k=n("code",null,".vuepress/public",-1),m=p(`

在下列这些情况中,你可能会用到它:

  • 你可能需要提供一些静态资源,但是它们并不直接被你的 Markdown 文件引用,比如 favicon 和 PWA 图标。
  • 你可能想要托管一些共享的静态资源,甚至可能需要在你的网站外部引用它,比如 Logo 图片。
  • 你可能想在你的 Markdown 内容中通过绝对路径来引入图片。

以我们文档的源文件为例,我们把 VuePress 的 Logo 放在了 Public 目录下:

└─ docs
+   ├─ .vuepress
+   |  └─ public
+   |     └─ images
+   |        └─ hero.png  # <- Logo 文件
+   └─ guide
+      └─ assets.md       # <- 我们在这里
+

我们可以这样在当前页面引用 Logo :

Input

![VuePress Logo](/images/hero.png)
+

Output

VuePress Logo

Base Helper

',10),v=n("code",null,"https://foo.github.io/bar/",-1),g=n("code",null,"'/bar/'",-1),h=n("code",null,"https://foo.github.io/bar/images/hero.png",-1),b=p('

在大多数情况下,你不需要担心这些 Public 文件的引用路径,因为 VuePress 会自动帮你处理 base 前缀:

<!-- 你不需要给 `/images/hero.png` 手动添加 `/bar/` 前缀 -->\n\n![VuePress Logo](/images/hero.png)\n
',2),_=n("code",null,"base",-1),f=n("code",null,"base",-1),w=p(`
<template>
+  <img :src="withBase(logoPath)" />
+</template>
+
+<script setup>
+import { ref } from "vue";
+import { withBase } from "@vuepress/client";
+
+const logoPath = ref("/images/hero.png");
+</script>
+

你也可以通过 $withBase 来直接使用这个工具函数:

<img :src="$withBase('/images/hero.png')" alt="VuePress Logo">
+

依赖包和路径别名

尽管这不是常见用法,但是你可以从依赖包中引用图片:

npm install -D package-name
+
![来自依赖包的图片](package-name/image.png)
+

在配置文件中设置的路径别名也同样支持:

import { getDirname, path } from "@vuepress/utils";
+
+const __dirname = getDirname(import.meta.url);
+
+export default {
+  alias: {
+    "@alias": path.resolve(__dirname, "./path/to/some/dir"),
+  },
+};
+
![来自路径别名的图片](@alias/image.png)
+
`,10),q={class:"hint-container tip"},x=n("p",{class:"hint-container-title"},"提示",-1);function P(y,V){const a=u("RouterLink");return i(),c("div",null,[d,n("p",null,[s("默认的 Public 目录是 "),k,s(" ,可以通过 "),e(a,{to:"/zh/reference/config.html#public"},{default:t(()=>[s("public")]),_:1}),s(" 配置项来修改。")]),m,n("p",null,[s("如果你的网站部署在非根路径下,例如 "),v,s(" ,那么你应该把 "),e(a,{to:"/zh/reference/config.html#base"},{default:t(()=>[s("base")]),_:1}),s(" 设置为 "),g,s("。显然,此时你的 Public 文件会被部署在 "),h,s(" 这样的链接下。")]),b,n("p",null,[s("然而,有些情况下,你可能会有一些指向 Public 文件的动态路径,尤其是在你开发一个自定义主题的时候。在这种情况下, "),_,s(" 无法被自动处理。为了解决这个问题,VuePress 提供了 "),e(a,{to:"/zh/reference/client-api.html#withbase"},{default:t(()=>[s("withBase")]),_:1}),s(" 工具函数,它可以帮助你添加 "),f,s(" 前缀:")]),w,n("div",q,[x,n("p",null,[s("配置参考: "),e(a,{to:"/zh/reference/plugin-api.html#alias"},{default:t(()=>[s("alias")]),_:1})])])])}const z=l(r,[["render",P],["__file","assets.html.vue"]]);export{z as default}; diff --git a/assets/assets.html-9a1cabf8.js b/assets/assets.html-9a1cabf8.js new file mode 100644 index 00000000..fdf1fcbd --- /dev/null +++ b/assets/assets.html-9a1cabf8.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-029ba47b","path":"/zh/guide/assets.html","title":"静态资源","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:photo-film","description":"相对路径 你可以在你的 Markdown 内容中使用相对路径来引用静态资源: 一般情况下,我们推荐你使用这种方式来引用图片,因为人们通常会把图片放在引用它的 Markdown 文件附近。 Public 文件 你可以把一些静态资源放在 Public 目录中,它们会被复制到最终生成的网站的根目录下。 默认的 Public 目录是 .vuepress/pub...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/guide/assets.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/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 目录是 .vuepress/pub..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:image","content":"https://vuejs.press/"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2023-02-22T07:39:31.000Z"}],["meta",{"name":"twitter:card","content":"summary_large_image"}],["meta",{"name":"twitter:image:alt","content":"静态资源"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"静态资源\\",\\"image\\":[\\"https://vuejs.press/\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":2.3,"words":689},"filePathRelative":"zh/guide/assets.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/back-to-top.html-3d105bf2.js b/assets/back-to-top.html-3d105bf2.js new file mode 100644 index 00000000..963bb715 --- /dev/null +++ b/assets/back-to-top.html-3d105bf2.js @@ -0,0 +1,7 @@ +import{_ as s,W as e,X as t,Y as o,$ as a,a0 as p,a1 as c,D as i}from"./framework-46b0e263.js";const d={},l=a("h1",{id:"back-to-top",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#back-to-top","aria-hidden":"true"},"#"),p(" back-to-top")],-1),r=c(`

该插件会给你的站点添加一个 返回顶部 按钮。当页面向下滚动时,该按钮会显示在页面的右下角,点击它就会滚动到页面顶部。

该插件已经集成到默认主题中。

使用方法

npm i -D @vuepress/plugin-back-to-top@next
+
import { backToTopPlugin } from "@vuepress/plugin-back-to-top";
+
+export default {
+  plugins: [backToTopPlugin()],
+};
+

样式

你可以通过 CSS 变量来自定义 返回顶部 按钮的样式:

File not found
`,8);function u(k,m){const n=i("NpmBadge");return e(),t("div",null,[l,o(n,{package:"@vuepress/plugin-back-to-top"}),r])}const b=s(d,[["render",u],["__file","back-to-top.html.vue"]]);export{b as default}; diff --git a/assets/back-to-top.html-5a088d40.js b/assets/back-to-top.html-5a088d40.js new file mode 100644 index 00000000..82129ad6 --- /dev/null +++ b/assets/back-to-top.html-5a088d40.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6c6e4840","path":"/zh/reference/plugin/back-to-top.html","title":"back-to-top","lang":"zh-CN","frontmatter":{"description":"该插件会给你的站点添加一个 返回顶部 按钮。当页面向下滚动时,该按钮会显示在页面的右下角,点击它就会滚动到页面顶部。 该插件已经集成到默认主题中。 使用方法 样式 你可以通过 CSS 变量来自定义 返回顶部 按钮的样式: code css (@vuepress/plugin-back-to-top/src/client/styles/vars.css)","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/plugin/back-to-top.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/plugin/back-to-top.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"back-to-top"}],["meta",{"property":"og:description","content":"该插件会给你的站点添加一个 返回顶部 按钮。当页面向下滚动时,该按钮会显示在页面的右下角,点击它就会滚动到页面顶部。 该插件已经集成到默认主题中。 使用方法 样式 你可以通过 CSS 变量来自定义 返回顶部 按钮的样式: code css (@vuepress/plugin-back-to-top/src/client/styles/vars.css)"}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"back-to-top\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.47,"words":141},"filePathRelative":"zh/reference/plugin/back-to-top.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/back-to-top.html-5f6d8d82.js b/assets/back-to-top.html-5f6d8d82.js new file mode 100644 index 00000000..050b1d01 --- /dev/null +++ b/assets/back-to-top.html-5f6d8d82.js @@ -0,0 +1,7 @@ +import{_ as s,W as n,X as t,Y as o,$ as a,a0 as i,a1 as c,D as p}from"./framework-46b0e263.js";const l={},d=a("h1",{id:"back-to-top",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#back-to-top","aria-hidden":"true"},"#"),i(" back-to-top")],-1),r=c(`

This plugin will add a back to top button to your site. The button will be displayed in the bottom right corner of the page when scrolling down. By clicking the button, the page will scroll to the top.

This plugin has been integrated into the default theme.

Usage

npm i -D @vuepress/plugin-back-to-top@next
+
import { backToTopPlugin } from "@vuepress/plugin-back-to-top";
+
+export default {
+  plugins: [backToTopPlugin()],
+};
+

Styles

You can customize the style of the back to top button via CSS variables:

File not found
`,8);function u(h,k){const e=p("NpmBadge");return n(),t("div",null,[d,o(e,{package:"@vuepress/plugin-back-to-top"}),r])}const m=s(l,[["render",u],["__file","back-to-top.html.vue"]]);export{m as default}; diff --git a/assets/back-to-top.html-a351fd04.js b/assets/back-to-top.html-a351fd04.js new file mode 100644 index 00000000..d3e490d7 --- /dev/null +++ b/assets/back-to-top.html-a351fd04.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6474e88f","path":"/reference/plugin/back-to-top.html","title":"back-to-top","lang":"en-US","frontmatter":{"description":"This plugin will add a back to top button to your site. The button will be displayed in the bottom right corner of the page when scrolling down. By clicking the button, the page...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/plugin/back-to-top.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/plugin/back-to-top.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"back-to-top"}],["meta",{"property":"og:description","content":"This plugin will add a back to top button to your site. The button will be displayed in the bottom right corner of the page when scrolling down. By clicking the button, the page..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"back-to-top\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.36,"words":109},"filePathRelative":"reference/plugin/back-to-top.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/bundler.html-1e3cd6ec.js b/assets/bundler.html-1e3cd6ec.js new file mode 100644 index 00000000..b7673abe --- /dev/null +++ b/assets/bundler.html-1e3cd6ec.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-75d28a04","path":"/zh/guide/bundler.html","title":"打包工具","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:boxes-packing","description":"VuePress 一直以来都在使用 Webpack (https://webpack.js.org/) 作为打包工具来进行网站的开发和构建。从 VuePress v2 开始,我们还支持使用其他的打包工具,并且现在使用 Vite (https://vitejs.dev/) 作为默认的打包工具。当然,你仍然可以选择使用 Webpack 。 选择一个打包工具...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/guide/bundler.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/guide/bundler.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"打包工具"}],["meta",{"property":"og:description","content":"VuePress 一直以来都在使用 Webpack (https://webpack.js.org/) 作为打包工具来进行网站的开发和构建。从 VuePress v2 开始,我们还支持使用其他的打包工具,并且现在使用 Vite (https://vitejs.dev/) 作为默认的打包工具。当然,你仍然可以选择使用 Webpack 。 选择一个打包工具..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"打包工具\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"选择一个打包工具","slug":"选择一个打包工具","link":"#选择一个打包工具","children":[]},{"level":2,"title":"配置打包工具","slug":"配置打包工具","link":"#配置打包工具","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.17,"words":350},"filePathRelative":"zh/guide/bundler.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/bundler.html-4a16a5de.js b/assets/bundler.html-4a16a5de.js new file mode 100644 index 00000000..dca5da10 --- /dev/null +++ b/assets/bundler.html-4a16a5de.js @@ -0,0 +1,21 @@ +import{_ as u,W as d,X as v,$ as n,a0 as e,Y as s,Z as t,a1 as k,D as l}from"./framework-46b0e263.js";const b={},m=n("h1",{id:"打包工具",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#打包工具","aria-hidden":"true"},"#"),e(" 打包工具")],-1),h={href:"https://webpack.js.org/",target:"_blank",rel:"noopener noreferrer"},_={href:"https://vitejs.dev/",target:"_blank",rel:"noopener noreferrer"},f=n("h2",{id:"选择一个打包工具",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#选择一个打包工具","aria-hidden":"true"},"#"),e(" 选择一个打包工具")],-1),g={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},w={href:"https://www.npmjs.com/package/vuepress-webpack",target:"_blank",rel:"noopener noreferrer"},x=n("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token function"},"pnpm"),e(` uninstall vuepress +`),n("span",{class:"token function"},"pnpm"),e(),n("span",{class:"token function"},"add"),e(),n("span",{class:"token parameter variable"},"-D"),e(` vuepress-webpack@next +`)])]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"}),n("div",{class:"line-number"})])],-1),V=n("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token function"},"yarn"),e(` remove vuepress +`),n("span",{class:"token function"},"yarn"),e(),n("span",{class:"token function"},"add"),e(),n("span",{class:"token parameter variable"},"-D"),e(` vuepress-webpack@next +`)])]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"}),n("div",{class:"line-number"})])],-1),y=n("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token function"},"npm"),e(` uninstall vuepress +`),n("span",{class:"token function"},"npm"),e(),n("span",{class:"token function"},"install"),e(),n("span",{class:"token parameter variable"},"-D"),e(` vuepress-webpack@next +`)])]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"}),n("div",{class:"line-number"})])],-1),N={class:"hint-container tip"},j=n("p",{class:"hint-container-title"},"提示",-1),B={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},P={href:"https://www.npmjs.com/package/vuepress-vite",target:"_blank",rel:"noopener noreferrer"},C=n("h2",{id:"配置打包工具",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#配置打包工具","aria-hidden":"true"},"#"),e(" 配置打包工具")],-1),W=n("p",null,"一般情况下,你不要任何额外配置就可以使用打包工具,因为我们已经帮你配置好了它们。",-1),q=k(`
import { viteBundler } from "vuepress";
+// import { webpackBundler } from 'vuepress-webpack'
+
+export default {
+  bundler: viteBundler({
+    vuePluginOptions: {
+      template: {
+        compilerOptions: {
+          isCustomElement: (tag) => tag === "center",
+        },
+      },
+    },
+  }),
+};
+
`,1);function A(D,E){const a=l("ExternalLinkIcon"),r=l("CodeTabs"),o=l("RouterLink");return d(),v("div",null,[m,n("p",null,[e("VuePress 一直以来都在使用 "),n("a",h,[e("Webpack"),s(a)]),e(" 作为打包工具来进行网站的开发和构建。从 VuePress v2 开始,我们还支持使用其他的打包工具,并且现在使用 "),n("a",_,[e("Vite"),s(a)]),e(" 作为默认的打包工具。当然,你仍然可以选择使用 Webpack 。")]),f,n("p",null,[e("在使用 "),n("a",g,[e("vuepress"),s(a)]),e(" 包时,会自动安装和使用 Vite 打包工具。")]),n("p",null,[e("如果你想改为使用 Webpack 打包工具,那么你可以移除它,改为安装 "),n("a",w,[e("vuepress-webpack"),s(a)]),e(" 包:")]),s(r,{id:"15",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:0,"tab-id":"shell"},{tab0:t(({title:p,value:c,isActive:i})=>[x]),tab1:t(({title:p,value:c,isActive:i})=>[V]),tab2:t(({title:p,value:c,isActive:i})=>[y]),_:1}),n("div",N,[j,n("p",null,[e("实际上, "),n("a",B,[e("vuepress"),s(a)]),e(" 包只是 "),n("a",P,[e("vuepress-vite"),s(a)]),e(" 包的一个封装而已。")])]),C,W,n("p",null,[e("通过 "),s(o,{to:"/zh/reference/config.html#bundler"},{default:t(()=>[e("bundler")]),_:1}),e(" 配置项,你可以对打包工具进行进阶配置:")]),q,n("p",null,[e("你可以参考 "),s(o,{to:"/zh/reference/bundler/vite.html"},{default:t(()=>[e("打包工具 > Vite")]),_:1}),e(" 和 "),s(o,{to:"/zh/reference/bundler/webpack.html"},{default:t(()=>[e("打包工具 > Webpack")]),_:1}),e(" 来查看对应打包工具的所有配置项。")])])}const z=u(b,[["render",A],["__file","bundler.html.vue"]]);export{z as default}; diff --git a/assets/bundler.html-f028d973.js b/assets/bundler.html-f028d973.js new file mode 100644 index 00000000..f0a2692c --- /dev/null +++ b/assets/bundler.html-f028d973.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6f1f3595","path":"/guide/bundler.html","title":"Bundler","lang":"en-US","frontmatter":{"icon":"fa6-solid:boxes-packing","description":"VuePress has been using Webpack (https://webpack.js.org/) as the bundler to dev and build sites. Since VuePress v2, other bundlers are also supported, and now we are using Vite ...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/guide/bundler.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/guide/bundler.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Bundler"}],["meta",{"property":"og:description","content":"VuePress has been using Webpack (https://webpack.js.org/) as the bundler to dev and build sites. Since VuePress v2, other bundlers are also supported, and now we are using Vite ..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Bundler\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Choose a Bundler","slug":"choose-a-bundler","link":"#choose-a-bundler","children":[]},{"level":2,"title":"Configure Bundler","slug":"configure-bundler","link":"#configure-bundler","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.82,"words":246},"filePathRelative":"guide/bundler.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/bundler.html-f9a502f3.js b/assets/bundler.html-f9a502f3.js new file mode 100644 index 00000000..f9680426 --- /dev/null +++ b/assets/bundler.html-f9a502f3.js @@ -0,0 +1,21 @@ +import{_ as u,W as d,X as v,$ as e,a0 as n,Y as s,Z as t,a1 as b,D as r}from"./framework-46b0e263.js";const k={},h=e("h1",{id:"bundler",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#bundler","aria-hidden":"true"},"#"),n(" Bundler")],-1),m={href:"https://webpack.js.org/",target:"_blank",rel:"noopener noreferrer"},_={href:"https://vitejs.dev/",target:"_blank",rel:"noopener noreferrer"},f=e("h2",{id:"choose-a-bundler",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#choose-a-bundler","aria-hidden":"true"},"#"),n(" Choose a Bundler")],-1),g={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},w={href:"https://www.npmjs.com/package/vuepress-webpack",target:"_blank",rel:"noopener noreferrer"},x=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"pnpm"),n(` remove vuepress +`),e("span",{class:"token function"},"pnpm"),n(),e("span",{class:"token function"},"add"),n(),e("span",{class:"token parameter variable"},"-D"),n(` vuepress-webpack@next +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1),y=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"yarn"),n(` remove vuepress +`),e("span",{class:"token function"},"yarn"),n(),e("span",{class:"token function"},"add"),n(),e("span",{class:"token parameter variable"},"-D"),n(` vuepress-webpack@next +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1),B=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"npm"),n(` uninstall vuepress +`),e("span",{class:"token function"},"npm"),n(),e("span",{class:"token function"},"install"),n(),e("span",{class:"token parameter variable"},"-D"),n(` vuepress-webpack@next +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1),V={class:"hint-container tip"},j=e("p",{class:"hint-container-title"},"Tips",-1),C={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},N={href:"https://www.npmjs.com/package/vuepress-vite",target:"_blank",rel:"noopener noreferrer"},P=e("h2",{id:"configure-bundler",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#configure-bundler","aria-hidden":"true"},"#"),n(" Configure Bundler")],-1),W=e("p",null,"Generally, you could use a bundler without extra configuration, because we have already configured them properly to work with VuePress.",-1),q=b(`
import { viteBundler } from "vuepress";
+// import { webpackBundler } from 'vuepress-webpack'
+
+export default {
+  bundler: viteBundler({
+    vuePluginOptions: {
+      template: {
+        compilerOptions: {
+          isCustomElement: (tag) => tag === "center",
+        },
+      },
+    },
+  }),
+};
+
`,1);function A(D,E){const a=r("ExternalLinkIcon"),p=r("CodeTabs"),o=r("RouterLink");return d(),v("div",null,[h,e("p",null,[n("VuePress has been using "),e("a",m,[n("Webpack"),s(a)]),n(" as the bundler to dev and build sites. Since VuePress v2, other bundlers are also supported, and now we are using "),e("a",_,[n("Vite"),s(a)]),n(" as the default bundler. Of course, you can still choose to use Webpack.")]),f,e("p",null,[n("When using the "),e("a",g,[n("vuepress"),s(a)]),n(" package, Vite bundler is installed and used automatically.")]),e("p",null,[n("If you want to use Webpack bundler instead, you can remove it and install the "),e("a",w,[n("vuepress-webpack"),s(a)]),n(" package instead:")]),s(p,{id:"15",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:0,"tab-id":"shell"},{tab0:t(({title:l,value:c,isActive:i})=>[x]),tab1:t(({title:l,value:c,isActive:i})=>[y]),tab2:t(({title:l,value:c,isActive:i})=>[B]),_:1}),e("div",V,[j,e("p",null,[n("In fact, the "),e("a",C,[n("vuepress"),s(a)]),n(" package is just a wrapper of the "),e("a",N,[n("vuepress-vite"),s(a)]),n(" package.")])]),P,W,e("p",null,[n("You can configure bundler for advanced usage via the "),s(o,{to:"/reference/config.html#bundler"},{default:t(()=>[n("bundler")]),_:1}),n(" option:")]),q,e("p",null,[n("You can refer to "),s(o,{to:"/reference/bundler/vite.html"},{default:t(()=>[n("Bundlers > Vite")]),_:1}),n(" and "),s(o,{to:"/reference/bundler/webpack.html"},{default:t(()=>[n("Bundlers > Webpack")]),_:1}),n(" to check out all options of the corresponding bundler.")])])}const L=u(k,[["render",A],["__file","bundler.html.vue"]]);export{L as default}; diff --git a/assets/cli.html-13a56669.js b/assets/cli.html-13a56669.js new file mode 100644 index 00000000..320044c2 --- /dev/null +++ b/assets/cli.html-13a56669.js @@ -0,0 +1,46 @@ +import{_ as p,W as o,X as c,Y as s,$ as a,a0 as e,Z as d,a1 as i,D as t}from"./framework-46b0e263.js";const u={},v=a("h1",{id:"命令行接口",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#命令行接口","aria-hidden":"true"},"#"),e(" 命令行接口")],-1),m={href:"https://www.npmjs.com/package/@vuepress/cli",target:"_blank",rel:"noopener noreferrer"},b={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},h=i(`

执行 vuepress --help 来获取下列帮助信息:

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
+
`,2),k={class:"hint-container tip"},f=a("p",{class:"hint-container-title"},"提示",-1),g={href:"https://www.npmjs.com/package/debug",target:"_blank",rel:"noopener noreferrer"},_=a("p",null,[e("设置环境变量 "),a("code",null,"DEBUG=vuepress*"),e(" 可以启用调试日志。")],-1),y=i(`

dev

启动一个开发服务器,在本地开发你的 VuePress 站点。

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
+

提示

通过命令行设置的配置项,会覆盖你配置文件中的同名配置项。

build

`,5),w=i(`
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
+

提示

通过命令行设置的配置项,会覆盖你配置文件中的同名配置项。

info

输出当前系统和依赖相关的信息。

在你想要检查你的环境,或者提交 Issue 时候,可以使用该命令。

`,5);function x(D,S){const l=t("NpmBadge"),n=t("ExternalLinkIcon"),r=t("RouterLink");return o(),c("div",null,[v,s(l,{package:"@vuepress/cli"}),a("p",null,[e("VuePress 命令行接口是由 "),a("a",m,[e("@vuepress/cli"),s(n)]),e(" 包提供的。它包含在 "),a("a",b,[e("vuepress"),s(n)]),e(" 包之中,当然你也可以单独安装它。")]),h,a("div",k,[f,a("p",null,[e("VuePress 使用了 "),a("a",g,[e("debug"),s(n)]),e(" 模块。")]),_]),y,a("p",null,[e("将你的 VuePress 站点构建成静态文件,以便你进行后续"),s(r,{to:"/zh/guide/deployment.html"},{default:d(()=>[e("部署")]),_:1}),e("。")]),w])}const B=p(u,[["render",x],["__file","cli.html.vue"]]);export{B as default}; diff --git a/assets/cli.html-2761a139.js b/assets/cli.html-2761a139.js new file mode 100644 index 00000000..c33fc973 --- /dev/null +++ b/assets/cli.html-2761a139.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-a951be94","path":"/reference/cli.html","title":"Command Line Interface","lang":"en-US","frontmatter":{"icon":"bi:terminal-fill","description":"VuePress CLI is provided by @vuepress/cli (https://www.npmjs.com/package/@vuepress/cli) package. It is included by the vuepress (https://www.npmjs.com/package/vuepress) package,...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/cli.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/cli.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Command Line Interface"}],["meta",{"property":"og:description","content":"VuePress CLI is provided by @vuepress/cli (https://www.npmjs.com/package/@vuepress/cli) package. It is included by the vuepress (https://www.npmjs.com/package/vuepress) package,..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Command Line Interface\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.24,"words":373},"filePathRelative":"reference/cli.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/cli.html-cfbcbfaf.js b/assets/cli.html-cfbcbfaf.js new file mode 100644 index 00000000..3d994fd2 --- /dev/null +++ b/assets/cli.html-cfbcbfaf.js @@ -0,0 +1,46 @@ +import{_ as o,W as p,X as c,Y as n,$ as a,a0 as e,Z as d,a1 as i,D as t}from"./framework-46b0e263.js";const u={},v=a("h1",{id:"command-line-interface",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#command-line-interface","aria-hidden":"true"},"#"),e(" Command Line Interface")],-1),m={href:"https://www.npmjs.com/package/@vuepress/cli",target:"_blank",rel:"noopener noreferrer"},b={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},h=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
+
`,2),k={class:"hint-container tip"},f=a("p",{class:"hint-container-title"},"Tips",-1),g={href:"https://www.npmjs.com/package/debug",target:"_blank",rel:"noopener noreferrer"},_=a("p",null,[e("Set environment variable "),a("code",null,"DEBUG=vuepress*"),e(" to enable debug logs.")],-1),y=i(`

dev

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.

build

`,5),w=i(`
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.

info

Outputs information about your system and dependencies.

This command would be helpful when you want to check your environment or report an issue.

`,5);function x(D,C){const l=t("NpmBadge"),s=t("ExternalLinkIcon"),r=t("RouterLink");return p(),c("div",null,[v,n(l,{package:"@vuepress/cli"}),a("p",null,[e("VuePress CLI is provided by "),a("a",m,[e("@vuepress/cli"),n(s)]),e(" package. It is included by the "),a("a",b,[e("vuepress"),n(s)]),e(" package, and you can also install it separately.")]),h,a("div",k,[f,a("p",null,[e("VuePress is using "),a("a",g,[e("debug"),n(s)]),e(" module.")]),_]),y,a("p",null,[e("Build your VuePress site to static files, which are ready for "),n(r,{to:"/guide/deployment.html"},{default:d(()=>[e("deployment")]),_:1}),e(".")]),w])}const B=o(u,[["render",x],["__file","cli.html.vue"]]);export{B as default}; diff --git a/assets/cli.html-e7d4e52b.js b/assets/cli.html-e7d4e52b.js new file mode 100644 index 00000000..4dd749ac --- /dev/null +++ b/assets/cli.html-e7d4e52b.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-9beb15b6","path":"/zh/reference/cli.html","title":"命令行接口","lang":"zh-CN","frontmatter":{"icon":"bi:terminal-fill","description":"VuePress 命令行接口是由 @vuepress/cli (https://www.npmjs.com/package/@vuepress/cli) 包提供的。它包含在 vuepress (https://www.npmjs.com/package/vuepress) 包之中,当然你也可以单独安装它。 执行 vuepress --help 来获取下...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/cli.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/cli.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"命令行接口"}],["meta",{"property":"og:description","content":"VuePress 命令行接口是由 @vuepress/cli (https://www.npmjs.com/package/@vuepress/cli) 包提供的。它包含在 vuepress (https://www.npmjs.com/package/vuepress) 包之中,当然你也可以单独安装它。 执行 vuepress --help 来获取下..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"命令行接口\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.51,"words":453},"filePathRelative":"zh/reference/cli.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/client-api.html-787be4ae.js b/assets/client-api.html-787be4ae.js new file mode 100644 index 00000000..1e05661a --- /dev/null +++ b/assets/client-api.html-787be4ae.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-a84e51b8","path":"/reference/client-api.html","title":"Client API","lang":"en-US","frontmatter":{"icon":"fa6-brands:chrome","description":"Client API is provided by @vuepress/client (https://www.npmjs.com/package/@vuepress/client) package, which is used for developing client files. Composition API usePageData Detai...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/client-api.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/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 is provided by @vuepress/client (https://www.npmjs.com/package/@vuepress/client) package, which is used for developing client files. Composition API usePageData Detai..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Client API\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","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":"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":"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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.42,"words":425},"filePathRelative":"reference/client-api.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/client-api.html-79f0beda.js b/assets/client-api.html-79f0beda.js new file mode 100644 index 00000000..5567b5bf --- /dev/null +++ b/assets/client-api.html-79f0beda.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-332177d5","path":"/zh/reference/client-api.html","title":"客户端 API","lang":"zh-CN","frontmatter":{"icon":"fa6-brands:chrome","description":"客户端 API 是由 @vuepress/client (https://www.npmjs.com/package/@vuepress/client) Package 提供的,用于开发客户端文件。 Composition API usePageData 详情:; 返回当前页面数据的 Ref 对象。 参考:; Node API > Page 属性 > ...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/client-api.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/client-api.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"客户端 API"}],["meta",{"property":"og:description","content":"客户端 API 是由 @vuepress/client (https://www.npmjs.com/package/@vuepress/client) Package 提供的,用于开发客户端文件。 Composition API usePageData 详情:; 返回当前页面数据的 Ref 对象。 参考:; Node API > Page 属性 > ..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"客户端 API\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","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":"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":"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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":2.07,"words":620},"filePathRelative":"zh/reference/client-api.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/client-api.html-9d516b34.js b/assets/client-api.html-9d516b34.js new file mode 100644 index 00000000..8bf1367a --- /dev/null +++ b/assets/client-api.html-9d516b34.js @@ -0,0 +1,14 @@ +import{_ as r,W as u,X as d,Y as a,$ as e,a0 as n,Z as s,a1 as i,D as o}from"./framework-46b0e263.js";const h={},f=e("h1",{id:"client-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#client-api","aria-hidden":"true"},"#"),n(" Client API")],-1),g={href:"https://www.npmjs.com/package/@vuepress/client",target:"_blank",rel:"noopener noreferrer"},_=e("h2",{id:"composition-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#composition-api","aria-hidden":"true"},"#"),n(" Composition API")],-1),v=e("h3",{id:"usepagedata",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagedata","aria-hidden":"true"},"#"),n(" usePageData")],-1),k=e("li",null,[e("p",null,"Details:"),e("p",null,"Returns the page data ref object of current page.")],-1),m=e("p",null,"Also see:",-1),b=e("h3",{id:"usepagefrontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagefrontmatter","aria-hidden":"true"},"#"),n(" usePageFrontmatter")],-1),x=e("ul",null,[e("li",null,[e("p",null,"Details:"),e("p",null,"Returns the frontmatter ref object of current page."),e("p",null,[n("The value is the "),e("code",null,"frontmatter"),n(" property of the page data.")])])],-1),y=e("h3",{id:"usepagehead",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagehead","aria-hidden":"true"},"#"),n(" usePageHead")],-1),P=e("p",null,"Details:",-1),w=e("p",null,"Returns the head config ref object of current page.",-1),D=i('

usePageHeadTitle

  • Details:

    Returns the head title ref object of current page.

    The value is obtained by joining the page title and site title.

usePageLang

  • Details:

    Returns the language ref object of current page.

    The value is the lang property of the page data.

useRouteLocale

',5),R=e("p",null,"Details:",-1),C=e("p",null,"Returns the locale path ref object of current route.",-1),S=i('

useSiteData

  • Details:

    Returns the site data ref object.

useSiteLocaleData

  • Details:

    Returns the site data ref object of current locale.

    The properties of current locale have been merged into the root-level properties.

Helpers

defineClientConfig

',6),T=e("p",null,"Details:",-1),A=e("p",null,"Also see:",-1),j=e("h3",{id:"withbase",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#withbase","aria-hidden":"true"},"#"),n(" withBase")],-1),E=e("p",null,"Details:",-1),V=e("p",null,"Also see:",-1),B=i(`

Constants

There are some constants that available in the client side code.

To shim the types of these constants in client side code, add @vuepress/client/types to your tsconfig.json:

{
+  "compilerOptions": {
+    "types": ["@vuepress/client/types"]
+  }
+}
+

__VUEPRESS_VERSION__

  • Type: string

  • Details:

    Version of VuePress core package.

__VUEPRESS_BASE__

`,7),L=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string")])],-1),q=e("p",null,"Details:",-1),I=i('

__VUEPRESS_DEV__

  • Type: boolean

  • Details:

    An environment flag indicating whether it is currently running in dev mode.

__VUEPRESS_SSR__

  • Type: boolean

  • Details:

    An environment flag indicating whether it is currently running in server-side-rendering (SSR) build.

Advanced

',5),N={id:"resolvers",tabindex:"-1"},H=e("a",{class:"header-anchor",href:"#resolvers","aria-hidden":"true"},"#",-1),U=i(`
  • Type: Record<string, Function>

  • Details:

    An reactive object, methods of which determining how to resolve global computed.

  • Example:

Customizing the format of <title> in client config file:

import { defineClientConfig, resolvers } from "@vuepress/client";
+
+export default defineClientConfig({
+  enhance({ app, router, siteData }) {
+    resolvers.resolvePageHeadTitle = (page, siteLocale) =>
+      \`\${siteLocale.title} > \${page.title}\`;
+  },
+});
+

Warning

resolvers will affect the basic functionality of VuePress. Please make sure you have fully understood its purpose before modifying it.

`,4);function F($,O){const l=o("NpmBadge"),p=o("ExternalLinkIcon"),t=o("RouterLink"),c=o("Badge");return u(),d("div",null,[f,a(l,{package:"@vuepress/client"}),e("p",null,[n("Client API is provided by "),e("a",g,[n("@vuepress/client"),a(p)]),n(" package, which is used for developing client files.")]),_,v,e("ul",null,[k,e("li",null,[m,e("ul",null,[e("li",null,[a(t,{to:"/reference/node-api.html#data"},{default:s(()=>[n("Node API > Page Properties > data")]),_:1})]),e("li",null,[a(t,{to:"/reference/plugin-api.html#extendspage"},{default:s(()=>[n("Plugin API > extendsPage")]),_:1})])])])]),b,x,y,e("ul",null,[e("li",null,[P,w,e("p",null,[n("The value is obtained by merging and deduplicating "),a(t,{to:"/reference/frontmatter.html#head"},{default:s(()=>[n("head")]),_:1}),n(" frontmatter and "),a(t,{to:"/reference/config.html#head"},{default:s(()=>[n("head")]),_:1}),n(" config.")])])]),D,e("ul",null,[e("li",null,[R,C,e("p",null,[n("The value is one of the keys of the "),a(t,{to:"/reference/config.html#locales"},{default:s(()=>[n("locales")]),_:1}),n(" config.")])])]),S,e("ul",null,[e("li",null,[T,e("p",null,[n("Helper for creating "),a(t,{to:"/reference/plugin-api.html#clientconfigfile"},{default:s(()=>[n("clientConfigFile")]),_:1}),n(".")])]),e("li",null,[A,e("ul",null,[e("li",null,[a(t,{to:"/advanced/cookbook/usage-of-client-config.html"},{default:s(()=>[n("Advanced > Cookbook > Usage of Client Config")]),_:1})])])])]),j,e("ul",null,[e("li",null,[E,e("p",null,[n("Prefix URL with site "),a(t,{to:"/reference/config.html#base"},{default:s(()=>[n("base")]),_:1}),n(".")])]),e("li",null,[V,e("ul",null,[e("li",null,[a(t,{to:"/guide/assets.html#base-helper"},{default:s(()=>[n("Guide > Assets > Base Helper")]),_:1})])])])]),B,e("ul",null,[L,e("li",null,[q,e("p",null,[n("The "),a(t,{to:"/reference/config.html#base"},{default:s(()=>[n("base")]),_:1}),n(" option from config.")])])]),I,e("h3",N,[H,n(" resolvers "),a(c,{text:"experimental"})]),U])}const z=r(h,[["render",F],["__file","client-api.html.vue"]]);export{z as default}; diff --git a/assets/client-api.html-e1254874.js b/assets/client-api.html-e1254874.js new file mode 100644 index 00000000..a9d0beeb --- /dev/null +++ b/assets/client-api.html-e1254874.js @@ -0,0 +1,14 @@ +import{_ as u,W as d,X as r,Y as a,$ as e,a0 as n,Z as t,a1 as l,D as o}from"./framework-46b0e263.js";const h={},_=e("h1",{id:"客户端-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#客户端-api","aria-hidden":"true"},"#"),n(" 客户端 API")],-1),f={href:"https://www.npmjs.com/package/@vuepress/client",target:"_blank",rel:"noopener noreferrer"},k=e("h2",{id:"composition-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#composition-api","aria-hidden":"true"},"#"),n(" Composition API")],-1),g=e("h3",{id:"usepagedata",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagedata","aria-hidden":"true"},"#"),n(" usePageData")],-1),v=e("li",null,[e("p",null,"详情:"),e("p",null,"返回当前页面数据的 Ref 对象。")],-1),m=e("p",null,"参考:",-1),b=e("h3",{id:"usepagefrontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagefrontmatter","aria-hidden":"true"},"#"),n(" usePageFrontmatter")],-1),x=e("ul",null,[e("li",null,[e("p",null,"详情:"),e("p",null,"返回当前页面 Frontmatter 的 Ref 对象。"),e("p",null,[n("它的值是页面数据的 "),e("code",null,"frontmatter"),n(" 属性。")])])],-1),P=e("h3",{id:"usepagehead",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagehead","aria-hidden":"true"},"#"),n(" usePageHead")],-1),R=e("p",null,"详情:",-1),S=e("p",null,"返回当前页面 Head 配置的 Ref 对象。",-1),w=l('

usePageHeadTitle

  • 详情:

    返回当前页面 Head 中的标题的 Ref 对象。

    它的值是连接页面标题和站点标题后得到的。

usePageLang

  • 详情:

    返回当前页面语言的 Ref 对象。

    它的值是页面数据的 lang 属性。

useRouteLocale

',5),E=e("p",null,"详情:",-1),C=e("p",null,"返回当前路由对应的 locale path 的 Ref 对象。",-1),V=l('

useSiteData

  • 详情:

    返回站点数据的 Ref 对象。

useSiteLocaleData

  • 详情:

    返回当前 locale 的站点数据的 Ref 对象。

    当前 locale 中的配置已经合并到顶层配置中。

工具函数

defineClientConfig

',6),y=e("p",null,"详情:",-1),z=e("p",null,"参考:",-1),B=e("h3",{id:"withbase",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#withbase","aria-hidden":"true"},"#"),n(" withBase")],-1),L=e("p",null,"详情:",-1),q=e("p",null,"参考:",-1),I=l(`

常量

在客户端代码中有一些常量可以使用。

如果想要把这些常量的类型定义补充到你的代码环境中,请将 @vuepress/client/types 添加到你的 tsconfig.json 里:

{
+  "compilerOptions": {
+    "types": ["@vuepress/client/types"]
+  }
+}
+

__VUEPRESS_VERSION__

  • 类型: string

  • 详情:

    VuePress Core 的版本号。

__VUEPRESS_BASE__

`,7),N=e("li",null,[e("p",null,[n("类型: "),e("code",null,"string")])],-1),A=e("p",null,"详情:",-1),D=l('

__VUEPRESS_DEV__

  • 类型: boolean

  • 详情:

    一个环境标记,用于标识当前是否运行在 dev 模式下。

__VUEPRESS_SSR__

  • 类型: boolean

  • 详情:

    一个环境标记,用于标识当前是否运行在服务端渲染 (SSR) 环境下。

进阶能力

',5),H={id:"resolvers",tabindex:"-1"},j=e("a",{class:"header-anchor",href:"#resolvers","aria-hidden":"true"},"#",-1),F=l(`
  • 类型: Record<string, Function>

  • 详情:

    一个响应式对象,其中的方法决定了如何获取全局计算属性。

  • 示例:

在客户端配置文件中自定义 <title> 的格式:

import { defineClientConfig, resolvers } from "@vuepress/client";
+
+export default defineClientConfig({
+  enhance({ app, router, siteData }) {
+    resolvers.resolvePageHeadTitle = (page, siteLocale) =>
+      \`\${siteLocale.title} > \${page.title}\`;
+  },
+});
+

警告

resolvers 会直接影响 VuePress 的基础功能,在修改前请确保你已充分了解其用途。

`,4);function U(T,$){const i=o("NpmBadge"),p=o("ExternalLinkIcon"),s=o("RouterLink"),c=o("Badge");return d(),r("div",null,[_,a(i,{package:"@vuepress/client"}),e("p",null,[n("客户端 API 是由 "),e("a",f,[n("@vuepress/client"),a(p)]),n(" Package 提供的,用于开发客户端文件。")]),k,g,e("ul",null,[v,e("li",null,[m,e("ul",null,[e("li",null,[a(s,{to:"/zh/reference/node-api.html#data"},{default:t(()=>[n("Node API > Page 属性 > data")]),_:1})]),e("li",null,[a(s,{to:"/zh/reference/plugin-api.html#extendspage"},{default:t(()=>[n("插件 API > extendsPage")]),_:1})])])])]),b,x,P,e("ul",null,[e("li",null,[R,S,e("p",null,[n("它的值是合并 "),a(s,{to:"/zh/reference/frontmatter.html#head"},{default:t(()=>[n("head")]),_:1}),n(" Frontmatter 和 "),a(s,{to:"/zh/reference/config.html#head"},{default:t(()=>[n("head")]),_:1}),n(" 配置,并进行去重后得到的。")])])]),w,e("ul",null,[e("li",null,[E,C,e("p",null,[n("它的值是 "),a(s,{to:"/zh/reference/config.html#locales"},{default:t(()=>[n("locales")]),_:1}),n(" 配置的键之一。")])])]),V,e("ul",null,[e("li",null,[y,e("p",null,[n("帮助你创建 "),a(s,{to:"/zh/reference/plugin-api.html#clientconfigfile"},{default:t(()=>[n("clientConfigFile")]),_:1}),n(" 的工具函数。")])]),e("li",null,[z,e("ul",null,[e("li",null,[a(s,{to:"/zh/advanced/cookbook/usage-of-client-config.html"},{default:t(()=>[n("深入 > Cookbook > 客户端配置的使用方法")]),_:1})])])])]),B,e("ul",null,[e("li",null,[L,e("p",null,[n("在 URL 前添加站点 "),a(s,{to:"/zh/reference/config.html#base"},{default:t(()=>[n("base")]),_:1}),n(" 前缀。")])]),e("li",null,[q,e("ul",null,[e("li",null,[a(s,{to:"/zh/guide/assets.html#base-helper"},{default:t(()=>[n("指南 > 静态资源 > Base Helper")]),_:1})])])])]),I,e("ul",null,[N,e("li",null,[A,e("p",null,[n("配置中的 "),a(s,{to:"/zh/reference/config.html#base"},{default:t(()=>[n("base")]),_:1}),n(" 字段。")])])]),D,e("h3",H,[j,n(" resolvers "),a(c,{text:"实验性能力"})]),F])}const W=u(h,[["render",U],["__file","client-api.html.vue"]]);export{W as default}; diff --git a/assets/components.html-2cd38e14.js b/assets/components.html-2cd38e14.js new file mode 100644 index 00000000..8cfdfcaf --- /dev/null +++ b/assets/components.html-2cd38e14.js @@ -0,0 +1,32 @@ +import{_ as k,W as m,X as v,Y as s,$ as n,a0 as a,Z as t,a1 as u,D as o}from"./framework-46b0e263.js";const g={},b=n("h1",{id:"built-in-components",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#built-in-components","aria-hidden":"true"},"#"),a(" Built-in Components")],-1),h={id:"badge",tabindex:"-1"},_=n("a",{class:"header-anchor",href:"#badge","aria-hidden":"true"},"#",-1),f=u(`
  • Props:

    • type
      • Type: 'tip' | 'warning' | 'danger'
      • Default: 'tip'
    • text
      • Type: string
      • Default: ''
    • vertical
      • Type: 'top' | 'middle' | 'bottom' | undefined
      • Default: undefined
  • Example:

Input

- VuePress - <Badge type="tip" text="v2" vertical="top" />
+- VuePress - <Badge type="warning" text="v2" vertical="middle" />
+- VuePress - <Badge type="danger" text="v2" vertical="bottom" />
+

Output

`,4),q=u(`

CodeGroup

CodeGroupItem

  • Props:

    • title
      • Type: string
      • Required: true
    • active
      • Type: boolean
      • Default: false
  • Details:

    This component must be placed inside a CodeGroup component.

    Use the active prop to set the initial active item, or the first item will be activated by default.

  • Example:

Input

<CodeGroup>
+  <CodeGroupItem title="PNPM">
+
+\`\`\`bash:no-line-numbers
+pnpm install
+\`\`\`
+
+  </CodeGroupItem>
+
+  <CodeGroupItem title="YARN">
+
+\`\`\`bash:no-line-numbers
+yarn install
+\`\`\`
+
+  </CodeGroupItem>
+
+  <CodeGroupItem title="NPM" active>
+
+\`\`\`bash:no-line-numbers
+npm install
+\`\`\`
+
+  </CodeGroupItem>
+</CodeGroup>
+

Output

`,7),x=n("div",{class:"language-bash","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token function"},"pnpm"),a(),n("span",{class:"token function"},"install"),a(` +`)])])],-1),C=n("div",{class:"language-bash","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token function"},"yarn"),a(),n("span",{class:"token function"},"install"),a(` +`)])])],-1),y=n("div",{class:"language-bash","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token function"},"npm"),a(),n("span",{class:"token function"},"install"),a(` +`)])])],-1),w={class:"hint-container warning"},P=n("p",{class:"hint-container-title"},"Note",-1),G=n("p",null,[a("You must add an empty line between the starting tag of "),n("code",null,""),a(" and the code fence, otherwise the code fence will not be parsed correctly by Markdown.")],-1),N=n("p",null,"All content must be valid Markdown first, and then a Vue SFC.",-1);function B(V,I){const d=o("NpmBadge"),e=o("Badge"),r=o("CodeTabs"),p=o("RouterLink");return m(),v("div",null,[b,s(d,{package:"@vuepress/theme-default"}),n("h2",h,[_,a(" Badge "),s(e,{text:"badge"})]),f,n("ul",null,[n("li",null,[a("VuePress - "),s(e,{type:"tip",text:"v2",vertical:"top"})]),n("li",null,[a("VuePress - "),s(e,{type:"warning",text:"v2",vertical:"middle"})]),n("li",null,[a("VuePress - "),s(e,{type:"danger",text:"v2",vertical:"bottom"})])]),q,s(r,{id:"179",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:2},{tab0:t(({title:l,value:c,isActive:i})=>[x]),tab1:t(({title:l,value:c,isActive:i})=>[C]),tab2:t(({title:l,value:c,isActive:i})=>[y]),_:1}),n("div",w,[P,G,N,n("p",null,[a("Learn more: "),s(p,{to:"/advanced/cookbook/markdown-and-vue-sfc.html"},{default:t(()=>[a("Cookbook > Markdown and Vue SFC")]),_:1})]),n("p",null,[a("Alternatively, you can use the "),s(p,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:t(()=>[a("custom containers")]),_:1}),a(".")])])])}const A=k(g,[["render",B],["__file","components.html.vue"]]);export{A as default}; diff --git a/assets/components.html-45ddf801.js b/assets/components.html-45ddf801.js new file mode 100644 index 00000000..ca4a0757 --- /dev/null +++ b/assets/components.html-45ddf801.js @@ -0,0 +1,5 @@ +import{_ as i,W as c,X as p,Y as a,$ as n,a0 as e,Z as r,a1 as d,D as t}from"./framework-46b0e263.js";const u={},h=n("h1",{id:"built-in-components",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#built-in-components","aria-hidden":"true"},"#"),e(" Built-in Components")],-1),m=d(`

ClientOnly

  • Usage:
<ClientOnly>
+  <NonSsrFriendlyComponent />
+</ClientOnly>
+
  • Details:

    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>.

Content

  • Props:

    • pageKey
      • Type: string
      • Required: false
  • Usage:

<Content page-key="v-xxxxxx" />
+
`,7),g=n("p",null,"Details:",-1),k=n("p",null,"This component will render the Markdown content of a page.",-1),_={href:"https://router.vuejs.org/api/#name-2",target:"_blank",rel:"noopener noreferrer"},v=n("code",null,"pageKey",-1),f=n("p",null,"This component is mainly for developing themes. You won't need it in most cases.",-1),y=n("p",null,"Also see:",-1);function b(x,w){const s=t("NpmBadge"),o=t("ExternalLinkIcon"),l=t("RouterLink");return c(),p("div",null,[h,a(s,{package:"@vuepress/client"}),m,n("ul",null,[n("li",null,[g,k,n("p",null,[e("The page key is the "),n("a",_,[e("name"),a(o)]),e(" of the page route. If the "),v,e(" prop is not provided, it will render the page of current route.")]),f]),n("li",null,[y,n("ul",null,[n("li",null,[a(l,{to:"/reference/node-api.html#key"},{default:r(()=>[e("Node API > Page Properties > key")]),_:1})])])])])])}const B=i(u,[["render",b],["__file","components.html.vue"]]);export{B as default}; diff --git a/assets/components.html-478c036d.js b/assets/components.html-478c036d.js new file mode 100644 index 00000000..e3341d8b --- /dev/null +++ b/assets/components.html-478c036d.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-55453034","path":"/reference/components.html","title":"Built-in Components","lang":"en-US","frontmatter":{"icon":"fa6-solid:puzzle-piece","description":"ClientOnly Usage:; Details:; 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...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/components.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/components.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Built-in Components"}],["meta",{"property":"og:description","content":"ClientOnly Usage:; Details:; 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..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Built-in Components\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"ClientOnly","slug":"clientonly","link":"#clientonly","children":[]},{"level":2,"title":"Content","slug":"content","link":"#content","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.6,"words":180},"filePathRelative":"reference/components.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/components.html-47cc2388.js b/assets/components.html-47cc2388.js new file mode 100644 index 00000000..f09f722f --- /dev/null +++ b/assets/components.html-47cc2388.js @@ -0,0 +1 @@ +const e=JSON.parse(`{"key":"v-551922c5","path":"/zh/reference/default-theme/components.html","title":"内置组件","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:puzzle-piece","description":"Badge Props:; type; 类型: 'tip' 'warning' 'danger'; 默认值: 'tip'; text; 类型: string; 默认值: ''; vertical; 类型: 'top' 'middle' 'bottom' | undefined; 默认值: undefined; 示例:; 输入 输出 VuePress -...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/default-theme/components.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/default-theme/components.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"内置组件"}],["meta",{"property":"og:description","content":"Badge Props:; type; 类型: 'tip' 'warning' 'danger'; 默认值: 'tip'; text; 类型: string; 默认值: ''; vertical; 类型: 'top' 'middle' 'bottom' | undefined; 默认值: undefined; 示例:; 输入 输出 VuePress -..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"内置组件\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Badge","slug":"badge","link":"#badge","children":[]},{"level":2,"title":"CodeGroup","slug":"codegroup","link":"#codegroup","children":[]},{"level":2,"title":"CodeGroupItem","slug":"codegroupitem","link":"#codegroupitem","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.13,"words":340},"filePathRelative":"zh/reference/default-theme/components.md","localizedDate":"2023年2月22日","autoDesc":true}`);export{e as data}; diff --git a/assets/components.html-6dbfa22c.js b/assets/components.html-6dbfa22c.js new file mode 100644 index 00000000..b1354a4a --- /dev/null +++ b/assets/components.html-6dbfa22c.js @@ -0,0 +1,32 @@ +import{_ as k,W as v,X as g,Y as s,$ as n,a0 as a,Z as t,a1 as i,D as o}from"./framework-46b0e263.js";const m={},b=n("h1",{id:"内置组件",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#内置组件","aria-hidden":"true"},"#"),a(" 内置组件")],-1),h={id:"badge",tabindex:"-1"},_=n("a",{class:"header-anchor",href:"#badge","aria-hidden":"true"},"#",-1),q=i(`
  • Props:

    • type
      • 类型: 'tip' | 'warning' | 'danger'
      • 默认值: 'tip'
    • text
      • 类型: string
      • 默认值: ''
    • vertical
      • 类型: 'top' | 'middle' | 'bottom' | undefined
      • 默认值: undefined
  • 示例:

输入

- VuePress - <Badge type="tip" text="v2" vertical="top" />
+- VuePress - <Badge type="warning" text="v2" vertical="middle" />
+- VuePress - <Badge type="danger" text="v2" vertical="bottom" />
+

输出

`,4),f=i(`

CodeGroup

CodeGroupItem

  • Props:

    • title
      • 类型: string
      • 是否必需: true
    • active
      • 类型: boolean
      • 默认值: false
  • 详情:

    该组件必须放置在 CodeGroup 组件的内部。

    可以通过 active Prop 来设置初始激活的元素。如果不设置,默认激活第一个元素。

  • 示例:

输入

<CodeGroup>
+  <CodeGroupItem title="PNPM">
+
+\`\`\`bash:no-line-numbers
+pnpm install
+\`\`\`
+
+  </CodeGroupItem>
+
+  <CodeGroupItem title="YARN">
+
+\`\`\`bash:no-line-numbers
+yarn install
+\`\`\`
+
+  </CodeGroupItem>
+
+  <CodeGroupItem title="NPM" active>
+
+\`\`\`bash:no-line-numbers
+npm install
+\`\`\`
+
+  </CodeGroupItem>
+</CodeGroup>
+

输出

`,7),x=n("div",{class:"language-bash","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token function"},"pnpm"),a(),n("span",{class:"token function"},"install"),a(` +`)])])],-1),C=n("div",{class:"language-bash","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token function"},"yarn"),a(),n("span",{class:"token function"},"install"),a(` +`)])])],-1),P=n("div",{class:"language-bash","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token function"},"npm"),a(),n("span",{class:"token function"},"install"),a(` +`)])])],-1),w={class:"hint-container warning"},B=n("p",{class:"hint-container-title"},"注意",-1),G=n("p",null,[a("你必须在 "),n("code",null,""),a(" 的开始标签和代码块之间添加一个空行,否则代码块无法被 Markdown 正确解析。")],-1),N=n("p",null,"所有内容首先都必须是合法的 Markdown ,然后才是一个 Vue SFC 。",-1);function V(A,y){const d=o("NpmBadge"),e=o("Badge"),r=o("CodeTabs"),p=o("RouterLink");return v(),g("div",null,[b,s(d,{package:"@vuepress/theme-default"}),n("h2",h,[_,a(" Badge "),s(e,{text:"badge"})]),q,n("ul",null,[n("li",null,[a("VuePress - "),s(e,{type:"tip",text:"v2",vertical:"top"})]),n("li",null,[a("VuePress - "),s(e,{type:"warning",text:"v2",vertical:"middle"})]),n("li",null,[a("VuePress - "),s(e,{type:"danger",text:"v2",vertical:"bottom"})])]),f,s(r,{id:"179",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:2},{tab0:t(({title:l,value:c,isActive:u})=>[x]),tab1:t(({title:l,value:c,isActive:u})=>[C]),tab2:t(({title:l,value:c,isActive:u})=>[P]),_:1}),n("div",w,[B,G,N,n("p",null,[a("了解更多: "),s(p,{to:"/zh/advanced/cookbook/markdown-and-vue-sfc.html"},{default:t(()=>[a("Cookbook > Markdown 与 Vue SFC")]),_:1})]),n("p",null,[a("或者你可以选择使用 "),s(p,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:t(()=>[a("自定义容器")]),_:1}),a(" 。")])])])}const E=k(m,[["render",V],["__file","components.html.vue"]]);export{E as default}; diff --git a/assets/components.html-d0e3e42b.js b/assets/components.html-d0e3e42b.js new file mode 100644 index 00000000..cf89778f --- /dev/null +++ b/assets/components.html-d0e3e42b.js @@ -0,0 +1,5 @@ +import{_ as c,W as i,X as p,Y as a,$ as n,a0 as e,Z as d,a1 as u,D as s}from"./framework-46b0e263.js";const r={},k=n("h1",{id:"内置组件",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#内置组件","aria-hidden":"true"},"#"),e(" 内置组件")],-1),h=u(`

ClientOnly

  • 使用:
<ClientOnly>
+  <NonSsrFriendlyComponent />
+</ClientOnly>
+
  • 详情:

    该组件和它的子元素只会在客户端被渲染。也就是说,它不会在构建 (SSR) 过程中被渲染到 HTML 内。

    如果一个组件在 setup() 中直接使用 浏览器 / DOM API ,它会导致构建过程报错,因为这些 API 在 Node.js 的环境中是无法使用的。在这种情况下,你可以选择一种方式:

    • 修改这个组件,只在 onBeforeMount()onMounted() Hook 中使用 浏览器 / DOM API 。
    • 使用 <ClientOnly> 包裹这个组件。

Content

  • Props:

    • pageKey
      • 类型: string
      • 是否必须: false
  • 使用:

<Content page-key="v-xxxxxx" />
+
`,7),_=n("p",null,"详情:",-1),m=n("p",null,"该组件会渲染页面的 Markdown 内容。",-1),g={href:"https://router.vuejs.org/zh/api/#name-2",target:"_blank",rel:"noopener noreferrer"},v=n("code",null,"pageKey",-1),x=n("p",null,"该组件主要是为了开发主题时使用。在绝大多数情况下你不会用到它。",-1),f=n("p",null,"参考:",-1);function y(b,C){const t=s("NpmBadge"),l=s("ExternalLinkIcon"),o=s("RouterLink");return i(),p("div",null,[k,a(t,{package:"@vuepress/client"}),h,n("ul",null,[n("li",null,[_,m,n("p",null,[e("页面 Key 是页面路由的 "),n("a",g,[e("name"),a(l)]),e(" 。如果没有传入 "),v,e(" Prop ,它会渲染当前路由下的页面。")]),x]),n("li",null,[f,n("ul",null,[n("li",null,[a(o,{to:"/zh/reference/node-api.html#key"},{default:d(()=>[e("Node API > Page 属性 > key")]),_:1})])])])])])}const P=c(r,[["render",y],["__file","components.html.vue"]]);export{P as default}; diff --git a/assets/components.html-da84c67b.js b/assets/components.html-da84c67b.js new file mode 100644 index 00000000..b510c31d --- /dev/null +++ b/assets/components.html-da84c67b.js @@ -0,0 +1 @@ +const e=JSON.parse(`{"key":"v-2e97e858","path":"/reference/default-theme/components.html","title":"Built-in Components","lang":"en-US","frontmatter":{"icon":"fa6-solid:puzzle-piece","description":"Badge Props:; type; Type: 'tip' 'warning' 'danger'; Default: 'tip'; text; Type: string; Default: ''; vertical; Type: 'top' 'middle' 'bottom' | undefined; Default: undefined; Exa...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/default-theme/components.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/default-theme/components.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Built-in Components"}],["meta",{"property":"og:description","content":"Badge Props:; type; Type: 'tip' 'warning' 'danger'; Default: 'tip'; text; Type: string; Default: ''; vertical; Type: 'top' 'middle' 'bottom' | undefined; Default: undefined; Exa..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Built-in Components\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Badge","slug":"badge","link":"#badge","children":[]},{"level":2,"title":"CodeGroup","slug":"codegroup","link":"#codegroup","children":[]},{"level":2,"title":"CodeGroupItem","slug":"codegroupitem","link":"#codegroupitem","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.9,"words":270},"filePathRelative":"reference/default-theme/components.md","localizedDate":"February 22, 2023","autoDesc":true}`);export{e as data}; diff --git a/assets/components.html-ef948022.js b/assets/components.html-ef948022.js new file mode 100644 index 00000000..0d77cdc3 --- /dev/null +++ b/assets/components.html-ef948022.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5ca60897","path":"/zh/reference/components.html","title":"内置组件","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:puzzle-piece","description":"ClientOnly 使用:; 详情:; 该组件和它的子元素只会在客户端被渲染。也就是说,它不会在构建 (SSR) 过程中被渲染到 HTML 内。 如果一个组件在 setup() 中直接使用 浏览器 / DOM API ,它会导致构建过程报错,因为这些 API 在 Node.js 的环境中是无法使用的。在这种情况下,你可以选择一种方式: 修改这个组件,...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/components.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/components.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"内置组件"}],["meta",{"property":"og:description","content":"ClientOnly 使用:; 详情:; 该组件和它的子元素只会在客户端被渲染。也就是说,它不会在构建 (SSR) 过程中被渲染到 HTML 内。 如果一个组件在 setup() 中直接使用 浏览器 / DOM API ,它会导致构建过程报错,因为这些 API 在 Node.js 的环境中是无法使用的。在这种情况下,你可以选择一种方式: 修改这个组件,..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"内置组件\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"ClientOnly","slug":"clientonly","link":"#clientonly","children":[]},{"level":2,"title":"Content","slug":"content","link":"#content","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.86,"words":259},"filePathRelative":"zh/reference/components.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/config.html-432c6100.js b/assets/config.html-432c6100.js new file mode 100644 index 00000000..6f3cfa4c --- /dev/null +++ b/assets/config.html-432c6100.js @@ -0,0 +1,173 @@ +import{_ as c,W as u,X as d,Y as a,$ as n,a0 as s,Z as t,a1 as l,D as o}from"./framework-46b0e263.js";const r={},h=n("h1",{id:"配置",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#配置","aria-hidden":"true"},"#"),s(" 配置")],-1),k=l(`
import { defaultTheme } from "@vuepress/theme-default";
+
+export default {
+  theme: defaultTheme({
+    // 在这里进行配置
+  }),
+};
+

基础配置

locales

`,3),m=n("li",null,[n("p",null,[s("类型: "),n("code",null,"{ [path: string]: Partial }")])],-1),v=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"{}")])],-1),b=n("p",null,"详情:",-1),g=n("p",null,"多语言支持的各个语言 locales 。",-1),_=n("p",null,[s("所有在 "),n("a",{href:"#locale-%E9%85%8D%E7%BD%AE"},"Locale 配置"),s(" 章节内的配置项都可以在 locales 中使用。")],-1),f=n("code",null,"locales",-1),x=n("p",null,"参考:",-1),q=l('

Locale 配置

该章节内的配置项可以作为一般配置使用,也可以使用在 locales 内。

colorMode

',3),y=n("li",null,[n("p",null,[s("类型: "),n("code",null,"'auto' | 'light' | 'dark'")])],-1),w=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"'auto'")])],-1),E=n("p",null,"详情:",-1),L=n("p",null,"默认颜色模式。",-1),A=n("code",null,"'auto'",-1),z={href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme",target:"_blank",rel:"noopener noreferrer"},N=n("li",null,[n("p",null,"参考:"),n("ul",null,[n("li",null,[n("a",{href:"#colormodeswitch"},"默认主题 > 配置 > colorModeSwitch")])])],-1),T=l(`

colorModeSwitch

home

  • 类型: string

  • 默认值: /

  • 详情:

    首页的路径。

    它将被用于:

    • 导航栏中 Logo 的链接
    • 404 页面的 返回首页 链接
  • 类型: false | (NavbarItem | NavbarGroup | string)[]

  • 默认值: []

  • 详情:

    导航栏配置。

    设置为 false 可以禁用导航栏。

    为了配置导航栏元素,你可以将其设置为 导航栏数组 ,其中的每个元素是 NavbarItem 对象、 NavbarGroup 对象、或者字符串:

    • NavbarItem 对象应该有一个 text 字段和一个 link 字段,还有一个可选的 activeMatch 字段。
    • NavbarGroup 对象应该有一个 text 字段和一个 children 字段。 children 字段同样是一个 导航栏数组
    • 字符串应为目标页面文件的路径。它将会被转换为 NavbarItem 对象,将页面标题作为 text ,将页面路由路径作为 link
  • 示例 1:

export default {
+  theme: defaultTheme({
+    navbar: [
+      // NavbarItem
+      {
+        text: "Foo",
+        link: "/foo/",
+      },
+      // NavbarGroup
+      {
+        text: "Group",
+        children: ["/group/foo.md", "/group/bar.md"],
+      },
+      // 字符串 - 页面文件路径
+      "/bar/README.md",
+    ],
+  }),
+};
+
  • 示例 2:
export default {
+  theme: defaultTheme({
+    navbar: [
+      // 嵌套 Group - 最大深度为 2
+      {
+        text: "Group",
+        children: [
+          {
+            text: "SubGroup",
+            children: ["/group/sub/foo.md", "/group/sub/bar.md"],
+          },
+        ],
+      },
+      // 控制元素何时被激活
+      {
+        text: "Group 2",
+        children: [
+          {
+            text: "Always active",
+            link: "/",
+            // 该元素将一直处于激活状态
+            activeMatch: "/",
+          },
+          {
+            text: "Active on /foo/",
+            link: "/not-foo/",
+            // 该元素在当前路由路径是 /foo/ 开头时激活
+            // 支持正则表达式
+            activeMatch: "^/foo/",
+          },
+        ],
+      },
+    ],
+  }),
+};
+
  • 类型: null | string

  • 详情:

    Logo 图片的 URL。

    Logo 图片将会显示在导航栏的左端。

    设置为 null 可以禁用 Logo 。

  • 示例:

export default {
+  theme: defaultTheme({
+    // Public 文件路径
+    logo: "/images/hero.png",
+    // URL
+    logo: "https://vuejs.org/images/logo.png",
+  }),
+};
+
`,12),B=l(`

logoDark

  • 类型: null | string

  • 详情:

    在夜间模式中使用的 Logo 图片的 URL。

    如果你想在夜间模式中使用不同的 Logo 图片,就可以使用该配置项。

    设置为 null 可以在夜间模式下禁用 Logo 。忽略该配置项将会在夜间模式中使用 logo 配置。

  • 参考:

repo

  • 类型: string

  • 详情:

    项目仓库的 URL。

    它将被用作 仓库链接 的链接。仓库链接 将会显示为导航栏的最后一个元素。

export default {
+  theme: defaultTheme({
+    // 如果你按照 \`organization/repository\` 的格式设置它
+    // 我们会将它作为一个 GitHub 仓库
+    repo: "vuejs/vuepress",
+    // 你也可以直接将它设置为一个 URL
+    repo: "https://gitlab.com/foo/bar",
+  }),
+};
+

repoLabel

  • 类型: string

  • 详情:

    项目仓库的标签。

    它将被用作 仓库链接 的文字。仓库链接 将会显示为导航栏的最后一个元素。

    如果你不明确指定该配置项,它将会根据 repo 配置项自动推断。

selectLanguageText

`,8),R=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),I=n("p",null,"详情:",-1),P=n("p",null,[n("em",null,"选择语言菜单"),s(" 的文字。")],-1),G=n("em",null,"选择语言菜单",-1),D=l(`

selectLanguageAriaLabel

  • 类型: string

  • 详情:

    选择语言菜单aria-label 属性。

    它主要是为了站点的可访问性 (a11y) 。

selectLanguageName

  • 类型: string

  • 详情:

    Locale 的语言名称。

    该配置项 仅能在主题配置的 locales 的内部生效 。它将被用作 locale 的语言名称,展示在 选择语言菜单 内。

  • 示例:

export default {
+  locales: {
+    "/": {
+      lang: "en-US",
+    },
+    "/zh/": {
+      lang: "zh-CN",
+    },
+  },
+  theme: defaultTheme({
+    locales: {
+      "/": {
+        selectLanguageName: "English",
+      },
+      "/zh/": {
+        selectLanguageName: "简体中文",
+      },
+    },
+  }),
+};
+
`,6),S=n("li",null,[n("p",null,[s("类型: "),n("code",null,"false | 'auto' | SidebarConfigArray | SidebarConfigObject")])],-1),M=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"'auto'")])],-1),U=n("p",null,"详情:",-1),C=n("p",null,"侧边栏配置。",-1),V=l("

设置为 false 可以禁用侧边栏。

如果你设置为 'auto',侧边栏会根据页面标题自动生成。

为了手动配置侧边栏元素,你可以将其设置为 侧边栏数组 ,其中的每个元素是一个 SidebarItem 对象或者一个字符串:

  • SidebarItem 对象应该有一个 text 字段,有一个可选的 link 字段、一个可选的 children 字段和一个可选的 collapsible 字段。 children 字段同样是一个 侧边栏数组collapsible 字段来控制它是否可折叠。
  • 字符串应为目标页面文件的路径。它将会被转换为 SidebarItem 对象,将页面标题作为 text ,将页面路由路径作为 link ,并根据页面小标题自动生成 children

如果你想在不同子路径中使用不同的侧边栏,你可以将该配置项设置为 侧边栏对象

  • Key 为路径前缀。
  • Value 为 侧边栏数组
",6),W=n("li",null,[n("p",null,"示例 1:")],-1),F=l(`
export default {
+  theme: defaultTheme({
+    // 侧边栏数组
+    // 所有页面会使用相同的侧边栏
+    sidebar: [
+      // SidebarItem
+      {
+        text: "Foo",
+        link: "/foo/",
+        children: [
+          // SidebarItem
+          {
+            text: "github",
+            link: "https://github.com",
+            children: [],
+          },
+          // 字符串 - 页面文件路径
+          "/foo/bar.md",
+        ],
+      },
+      // 字符串 - 页面文件路径
+      "/bar/README.md",
+    ],
+  }),
+};
+
  • 示例 2:
export default {
+  theme: defaultTheme({
+    // 侧边栏对象
+    // 不同子路径下的页面会使用不同的侧边栏
+    sidebar: {
+      "/guide/": [
+        {
+          text: "Guide",
+          children: ["/guide/README.md", "/guide/getting-started.md"],
+        },
+      ],
+      "/reference/": [
+        {
+          text: "Reference",
+          children: ["/reference/cli.md", "/reference/config.md"],
+        },
+      ],
+    },
+  }),
+};
+
  • 示例 3:
export default {
+  theme: defaultTheme({
+    // 可折叠的侧边栏
+    sidebar: {
+      "/reference/": [
+        {
+          text: "VuePress Reference",
+          collapsible: true,
+          children: ["/reference/cli.md", "/reference/config.md"],
+        },
+        {
+          text: "Bundlers Reference",
+          collapsible: true,
+          children: [
+            "/reference/bundler/vite.md",
+            "/reference/bundler/webpack.md",
+          ],
+        },
+      ],
+    },
+  }),
+};
+

sidebarDepth

`,6),H=n("li",null,[n("p",null,[s("类型: "),n("code",null,"number")])],-1),j=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"2")])],-1),Z=l("

详情:

设置根据页面标题自动生成的侧边栏的最大深度。

  • 设为 0 来禁用所有级别的页面标题。
  • 设为 1 来包含 <h2> 标题。
  • 设为 2 来包含 <h2><h3> 标题。
  • ...
",3),K=n("p",null,[s("由于 "),n("code",null,"markdown.headers.level"),s(" 的默认值是 "),n("code",null,"[2, 3]"),s(" ,因此 "),n("code",null,"sidebarDepth"),s(" 的默认最大值是 "),n("code",null,"2"),s(" 。")],-1),O=n("h3",{id:"editlink",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#editlink","aria-hidden":"true"},"#"),s(" editLink")],-1),X=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),Y=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"true")])],-1),$=n("p",null,"详情:",-1),J=n("p",null,[s("是否启用 "),n("em",null,"编辑此页"),s(" 链接。")],-1),Q=l(`

editLinkText

  • 类型: string

  • 默认值: 'Edit this page'

  • 详情:

    编辑此页 链接的文字。

editLinkPattern

  • 类型: string

  • 详情:

    编辑此页 链接的 Pattern 。

    它将会用于生成 编辑此页 的链接。

    如果你不设置该选项,则会根据 docsRepo 配置项来推断 Pattern 。但是如果你的文档仓库没有托管在常用的平台上,比如 GitHub 、 GitLab 、 Bitbucket 、 Gitee 等,那么你必须设置该选项才能使 编辑此页 链接正常工作。

  • 用法:

    Pattern描述
    :repo文档仓库 URL ,即 docsRepo
    :branch文档仓库分支 ,即 docsBranch
    :path页面源文件的路径,即 docsDir 拼接上页面文件的相对路径
  • 示例:

export default {
+  theme: defaultTheme({
+    docsRepo: "https://gitlab.com/owner/name",
+    docsBranch: "master",
+    docsDir: "docs",
+    editLinkPattern: ":repo/-/edit/:branch/:path",
+  }),
+};
+

则会生成类似于 'https://gitlab.com/owner/name/-/edit/master/docs/path/to/file.md' 的链接。

docsRepo

  • 类型: string

  • 详情:

    文档源文件的仓库 URL 。

    它将会用于生成 编辑此页 的链接。

    如果你不设置该选项,则默认会使用 repo 配置项。但是如果你的文档源文件是在一个不同的仓库内,你就需要设置该配置项了。

docsBranch

  • 类型: string

  • 默认值: 'main'

  • 详情:

    文档源文件的仓库分支。

    它将会用于生成 编辑此页 的链接。

docsDir

  • 类型: string

  • 默认值: ''

  • 详情:

    文档源文件存放在仓库中的目录名。

    它将会用于生成 编辑此页 的链接。

lastUpdated

`,13),nn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),sn=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"true")])],-1),an=n("p",null,"详情:",-1),en=n("p",null,[s("是否启用 "),n("em",null,"最近更新时间戳"),s(" 。")],-1),tn=n("code",null,"false",-1),ln=l('

lastUpdatedText

  • 类型: string

  • 默认值: 'Last Updated'

  • 详情:

    最近更新时间戳 标签的文字。

contributors

',3),on=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),pn=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"true")])],-1),cn=n("p",null,"详情:",-1),un=n("p",null,[s("是否启用 "),n("em",null,"贡献者列表"),s(" 。")],-1),dn=n("code",null,"false",-1),rn=l('

contributorsText

  • 类型: string

  • 默认值: 'Contributors'

  • 详情:

    贡献者列表 标签的文字。

tip

',3),hn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),kn=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"'TIP'")])],-1),mn=n("p",null,"详情:",-1),vn=n("h3",{id:"warning",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#warning","aria-hidden":"true"},"#"),s(" warning")],-1),bn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),gn=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"'WARNING'")])],-1),_n=n("p",null,"详情:",-1),fn=n("h3",{id:"danger",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#danger","aria-hidden":"true"},"#"),s(" danger")],-1),xn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),qn=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"'DANGER'")])],-1),yn=n("p",null,"详情:",-1),wn=l('

notFound

  • 类型: string[]

  • 默认值: ['Not Found']

  • 详情:

    404 页面的提示信息。

    当用户进入 404 页面时,会从数组中随机选取一条信息进行展示。

backToHome

  • 类型: string

  • 默认值: 'Back to home'

  • 详情:

    404 页面中 返回首页 链接的文字。

openInNewWindow

',5),En=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),Ln=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"'open in new window'")])],-1),An=n("p",null,"详情:",-1),zn=n("code",null,"sr-only",-1),Nn=n("p",null,"它主要是为了站点的可访问性 (a11y) 。",-1),Tn=n("li",null,[n("p",null,"参考:"),n("ul",null,[n("li",null,[n("a",{href:"#themeplugins-externallinkicon"},"默认主题 > 配置 > themePlugins.externalLinkIcon")])])],-1),Bn=l('

toggleColorMode

  • 类型: string

  • 默认值: 'toggle color mode'

  • 详情:

    切换颜色模式按钮的标题文字。

    它主要是为了站点的可访问性 (a11y) 。

  • 参考:

toggleSidebar

  • 类型: string

  • 默认值: 'toggle sidebar'

  • 详情:

    切换侧边栏按钮的标题文字。

    它主要是为了站点的可访问性 (a11y) 。

插件配置

themePlugins

  • 详情:

    设置默认主题使用的插件。

    默认主题使用了一些插件,如果你确实不需要该插件,你可以选择禁用它。在禁用插件之前,请确保你已了解它的用途。

',8),Rn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),In=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"true")])],-1),Pn=n("p",null,"详情:",-1),Gn=n("h4",{id:"themeplugins-backtotop",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-backtotop","aria-hidden":"true"},"#"),s(" themePlugins.backToTop")],-1),Dn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),Sn=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"true")])],-1),Mn=n("p",null,"详情:",-1),Un=n("h3",{id:"themeplugins-container",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-container","aria-hidden":"true"},"#"),s(" themePlugins.container")],-1),Cn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"Record")])],-1),Vn=n("p",null,"详情:",-1),Wn=l("

ContainerType 类型为:

  • tip
  • warning
  • danger
  • details
  • codeGroup
  • codeGroupItem
",2),Fn=n("p",null,"参考:",-1),Hn=n("h3",{id:"themeplugins-externallinkicon",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-externallinkicon","aria-hidden":"true"},"#"),s(" themePlugins.externalLinkIcon")],-1),jn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),Zn=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"true")])],-1),Kn=n("p",null,"详情:",-1),On=n("h3",{id:"themeplugins-git",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-git","aria-hidden":"true"},"#"),s(" themePlugins.git")],-1),Xn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),Yn=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"true")])],-1),$n=n("p",null,"详情:",-1),Jn=n("h3",{id:"themeplugins-mediumzoom",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-mediumzoom","aria-hidden":"true"},"#"),s(" themePlugins.mediumZoom")],-1),Qn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),ns=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"true")])],-1),ss=n("p",null,"详情:",-1),as=n("h3",{id:"themeplugins-nprogress",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-nprogress","aria-hidden":"true"},"#"),s(" themePlugins.nprogress")],-1),es=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),ts=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"true")])],-1),ls=n("p",null,"详情:",-1);function os(is,ps){const i=o("NpmBadge"),e=o("RouterLink"),p=o("ExternalLinkIcon");return u(),d("div",null,[h,a(i,{package:"@vuepress/theme-default"}),k,n("ul",null,[m,v,n("li",null,[b,g,_,n("p",null,[s("该配置项仅能在默认主题内生效,注意不要和 "),a(e,{to:"/zh/reference/config.html#locales"},{default:t(()=>[s("站点配置")]),_:1}),s(" 中的 "),f,s(" 混淆。")])]),n("li",null,[x,n("ul",null,[n("li",null,[a(e,{to:"/zh/guide/i18n.html"},{default:t(()=>[s("指南 > 多语言支持")]),_:1})])])])]),q,n("ul",null,[y,w,n("li",null,[E,L,n("p",null,[s("如果设置为 "),A,s(" ,则会根据 "),n("a",z,[s("prefers-color-scheme"),a(p)]),s(" 自动设置初始颜色模式。")])]),N]),T,n("ul",null,[n("li",null,[s("参考: "),n("ul",null,[n("li",null,[a(e,{to:"/zh/guide/assets.html#public-%E6%96%87%E4%BB%B6"},{default:t(()=>[s("指南 > 静态资源 > Public 文件")]),_:1})])])])]),B,n("ul",null,[R,n("li",null,[I,P,n("p",null,[s("如果你在站点配置中设置了多个 "),a(e,{to:"/zh/reference/config.html#locales"},{default:t(()=>[s("locales")]),_:1}),s(" ,那么 "),G,s(" 就会显示在导航栏中仓库按钮的旁边。")])])]),D,n("ul",null,[S,M,n("li",null,[U,C,n("p",null,[s("你可以通过页面的 "),a(e,{to:"/zh/reference/default-theme/frontmatter.html#sidebar"},{default:t(()=>[s("sidebar")]),_:1}),s(" frontmatter 来覆盖这个全局配置。")]),V]),W]),F,n("ul",null,[H,j,n("li",null,[Z,n("p",null,[s("最大值取决于你通过 "),a(e,{to:"/zh/reference/config.html#markdown-headers"},{default:t(()=>[s("markdown.headers.level")]),_:1}),s(" 提取了哪些级别的标题。")]),K,n("p",null,[s("你可以通过页面的 "),a(e,{to:"/zh/reference/default-theme/frontmatter.html#sidebardepth"},{default:t(()=>[s("sidebarDepth")]),_:1}),s(" frontmatter 来覆盖这个全局配置。")])])]),O,n("ul",null,[X,Y,n("li",null,[$,J,n("p",null,[s("你可以通过页面的 "),a(e,{to:"/zh/reference/default-theme/frontmatter.html#editlink"},{default:t(()=>[s("editLink")]),_:1}),s(" frontmatter 来覆盖这个全局配置。")])])]),Q,n("ul",null,[nn,sn,n("li",null,[an,en,n("p",null,[s("你可以通过页面的 "),a(e,{to:"/zh/reference/default-theme/frontmatter.html#lastupdated"},{default:t(()=>[s("lastUpdated")]),_:1}),s(" frontmatter 来覆盖这个全局配置。要注意的是,如果你已经将该选项设为了 "),tn,s(" ,那么这个功能会被完全禁用,并且无法在 locales 或页面 frontmatter 中启用。")])])]),ln,n("ul",null,[on,pn,n("li",null,[cn,un,n("p",null,[s("你可以通过页面的 "),a(e,{to:"/zh/reference/default-theme/frontmatter.html#contributors"},{default:t(()=>[s("contributors")]),_:1}),s(" frontmatter 来覆盖这个全局配置。要注意的是,如果你已经将该选项设为了 "),dn,s(" ,那么这个功能会被完全禁用,并且无法在 locales 或页面 frontmatter 中启用。")])])]),rn,n("ul",null,[hn,kn,n("li",null,[mn,n("p",null,[s("Tip "),a(e,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:t(()=>[s("自定义容器")]),_:1}),s(" 的默认标题。")])])]),vn,n("ul",null,[bn,gn,n("li",null,[_n,n("p",null,[s("Warning "),a(e,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:t(()=>[s("自定义容器")]),_:1}),s(" 的默认标题。")])])]),fn,n("ul",null,[xn,qn,n("li",null,[yn,n("p",null,[s("Danger "),a(e,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:t(()=>[s("自定义容器")]),_:1}),s(" 的默认标题。")])])]),wn,n("ul",null,[En,Ln,n("li",null,[An,n("p",null,[a(e,{to:"/zh/reference/plugin/external-link-icon.html#externallinkicon"},{default:t(()=>[s("ExternalLinkIcon")]),_:1}),s(". 链接内的 "),zn,s(" 文字。")]),Nn]),Tn]),Bn,n("ul",null,[Rn,In,n("li",null,[Pn,n("p",null,[s("是否启用 "),a(e,{to:"/zh/reference/plugin/active-header-links.html"},{default:t(()=>[s("@vuepress/plugin-active-header-links")]),_:1}),s(" 。")])])]),Gn,n("ul",null,[Dn,Sn,n("li",null,[Mn,n("p",null,[s("是否启用 "),a(e,{to:"/zh/reference/plugin/back-to-top.html"},{default:t(()=>[s("@vuepress/plugin-back-to-top")]),_:1}),s(" 。")])])]),Un,n("ul",null,[Cn,n("li",null,[Vn,n("p",null,[s("是否启用由 "),a(e,{to:"/zh/reference/plugin/container.html"},{default:t(()=>[s("@vuepress/plugin-container")]),_:1}),s(" 支持的自定义容器。")]),Wn]),n("li",null,[Fn,n("ul",null,[n("li",null,[a(e,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:t(()=>[s("默认主题 > Markdown > 自定义容器")]),_:1})])])])]),Hn,n("ul",null,[jn,Zn,n("li",null,[Kn,n("p",null,[s("是否启用 "),a(e,{to:"/zh/reference/plugin/external-link-icon.html"},{default:t(()=>[s("@vuepress/plugin-external-link-icon")]),_:1}),s(" 。")])])]),On,n("ul",null,[Xn,Yn,n("li",null,[$n,n("p",null,[s("是否启用 "),a(e,{to:"/zh/reference/plugin/git.html"},{default:t(()=>[s("@vuepress/plugin-git")]),_:1}),s(" 。")])])]),Jn,n("ul",null,[Qn,ns,n("li",null,[ss,n("p",null,[s("是否启用 "),a(e,{to:"/zh/reference/plugin/medium-zoom.html"},{default:t(()=>[s("@vuepress/plugin-medium-zoom")]),_:1}),s(" 。")])])]),as,n("ul",null,[es,ts,n("li",null,[ls,n("p",null,[s("是否启用 "),a(e,{to:"/zh/reference/plugin/nprogress.html"},{default:t(()=>[s("@vuepress/plugin-nprogress")]),_:1}),s(" 。")])])])])}const us=c(r,[["render",os],["__file","config.html.vue"]]);export{us as default}; diff --git a/assets/config.html-58974c3b.js b/assets/config.html-58974c3b.js new file mode 100644 index 00000000..521731f0 --- /dev/null +++ b/assets/config.html-58974c3b.js @@ -0,0 +1,22 @@ +import{_ as r,W as p,X as u,Y as l,$ as e,Z as a,a0 as n,a1 as o,D as s}from"./framework-46b0e263.js";const c={},h=e("h1",{id:"config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#config","aria-hidden":"true"},"#"),n(" Config")],-1),f=e("h2",{id:"site-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#site-config","aria-hidden":"true"},"#"),n(" Site Config")],-1),m=e("h3",{id:"base",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#base","aria-hidden":"true"},"#"),n(" base")],-1),g=o("
  • Type: string

  • Default: /

  • Details:

    The base URL the site will be deployed at.

    You will need to set this if you plan to deploy your site under a sub path. It should always start and end with a slash. For example, if you plan to deploy your site to GitHub pages at https://foo.github.io/bar/, then you should set base to "/bar/".

    The base is automatically prepended to all the URLs that start with / in other options, so you only need to specify it once.

    Notice that base should be an absolute URL pathname starting and ending with / .

  • ",3),_=e("p",null,"Also see:",-1),k=e("h3",{id:"lang",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#lang","aria-hidden":"true"},"#"),n(" lang")],-1),b=o("
  • Type: string

  • Default: en-US

  • Details:

    Language for the site.

    This will be the lang attribute of the <html> tag in the rendered HTML.

    This can be specified in different locales.

  • ",3),w=e("p",null,"Also see:",-1),v=e("li",null,[e("a",{href:"#locales"},"Config > locales")],-1),y=o('

    title

    • Type: string

    • Default: ''

    • Details:

      Title for the site.

      This will be the suffix for all page titles, and displayed in the navbar in the default theme.

      This can be specified in different locales.

    • Also see:

    description

    ',3),x=o("
  • Type: string

  • Default: ''

  • Details:

    Description for the site.

    This will be the content attribute of <meta name="description" /> tag in the rendered HTML, which will be overrode by the description field of page frontmatter.

    This can be specified in different locales.

  • ",3),D=e("p",null,"Also see:",-1),T=e("li",null,[e("a",{href:"#locales"},"Config > locales")],-1),P=o(`
    • Type: HeadConfig[]

    • Default: []

    • Details:

      Extra tags to inject into the <head> tag in the rendered HTML.

      You can specify each tag in the form of [tagName, { attrName: attrValue }, innerHTML?].

      This can be specified in different locales.

    • Example:

      To add a custom favicon:

    export default {
    +  head: [["link", { rel: "icon", href: "/images/logo.png" }]],
    +};
    +

    Rendered as:

    <head>
    +  <link rel="icon" href="/images/logo.png" />
    +</head>
    +
    `,5),A=e("li",null,[e("a",{href:"#locales"},"Config > locales")],-1),S=e("h3",{id:"locales",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#locales","aria-hidden":"true"},"#"),n(" locales")],-1),C=o('
  • Type: { [path: string]: Partial<SiteLocaleData> }

  • Default: {}

  • Details:

    Specify locales for i18n support.

    Acceptable fields:

  • ',3),q=e("p",null,"Also see:",-1),L=e("h2",{id:"theme-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#theme-config","aria-hidden":"true"},"#"),n(" Theme Config")],-1),O=e("h3",{id:"theme",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#theme","aria-hidden":"true"},"#"),n(" theme")],-1),B=e("li",null,[e("p",null,[n("Type: "),e("code",null,"Theme")])],-1),E=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),G=e("p",null,"Also see:",-1),M=e("h2",{id:"bundler-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#bundler-config","aria-hidden":"true"},"#"),n(" Bundler Config")],-1),I=e("h3",{id:"bundler",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#bundler","aria-hidden":"true"},"#"),n(" bundler")],-1),N=o("
  • 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.
  • ",2),j=e("p",null,"Also see:",-1),H=o('

    Common Config

    dest

    • Type: string

    • Default: `${sourceDir}/.vuepress/dist`

    • Details:

      Specify the output directory for vuepress build command.

    temp

    • Type: string

    • Default: `${sourceDir}/.vuepress/.temp`

    • Details:

      Specify the directory for temporary files.

    Note

    Since VuePress will load temp files during dev and build, the temp directory should be inside project root to resolve dependencies correctly.

    cache

    • Type: string

    • Default: `${sourceDir}/.vuepress/.cache`

    • Details:

      Specify the directory for cache files.

    public

    ',9),V=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string")])],-1),W=e("li",null,[e("p",null,[n("Default: "),e("code",null,"`${sourceDir}/.vuepress/public`")])],-1),R=e("li",null,[e("p",null,"Details:"),e("p",null,"Specify the directory for public files.")],-1),F=e("p",null,"Also see:",-1),Y=e("h3",{id:"debug",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#debug","aria-hidden":"true"},"#"),n(" debug")],-1),U=e("li",null,[e("p",null,[n("Type: "),e("code",null,"boolean")])],-1),$=e("li",null,[e("p",null,[n("Default: "),e("code",null,"false")])],-1),X=e("p",null,"Details:",-1),Z=e("p",null,"Enable debug mode or not.",-1),z={href:"https://github.com/visionmedia/debug",target:"_blank",rel:"noopener noreferrer"},J=e("code",null,"DEBUG=vuepress*",-1),K=o('

    pagePatterns

    • Type: string[]

    • Default: ['**/*.md', '!.vuepress', '!node_modules']

    • Details:

      Specify the patterns of files you want to be resolved as pages. The patterns are relative to the source directory.

    permalinkPattern

    ',3),Q=o("
  • Type: string | null

  • Default: null

  • Details:

    Specify the pattern to generate permalink.

    This will be overrode by the permalinkPattern field of page frontmatter.

  • ",3),ee=e("p",null,"Also see:",-1),ne=o('

    Dev Config

    host

    • Type: string

    • Default: '0.0.0.0'

    • Details:

      Specify the host to use for the dev server.

    port

    • Type: number

    • Default: 8080

    • Details:

      Specify the port to use for the dev server.

    open

    • Type: boolean

    • Default: false

    • Details:

      Whether to open the browser after dev-server had been started.

    templateDev

    • Type: string

    • Default: '@vuepress/client/templates/dev.html'

    • Details:

      Specify the path of the HTML template to be used for dev.

    Build Config

    shouldPreload

    • Type: ((file: string, type: string) => boolean)) | boolean

    • Default: true

    • Details:

      A function to control what files should have <link rel="preload"> resource hints generated. Set to true or false to enable or disable totally.

      By default, only those files that are required by current page will be preloaded. So you can keep it true in most cases.

    shouldPrefetch

    • Type: ((file: string, type: string) => boolean)) | boolean

    • Default: true

    • Details:

      A function to control what files should have <link rel="prefetch"> resource hints generated. Set 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.

    templateBuild

    • Type: string

    • Default: '@vuepress/client/templates/build.html'

    • Details:

      Specify the path of the HTML template to be used for build.

    Markdown Config

    markdown

    ',18),le=e("li",null,[e("p",null,[n("Type: "),e("code",null,"MarkdownOptions")])],-1),te=e("li",null,[e("p",null,[n("Default: "),e("code",null,"{}")])],-1),ae=e("p",null,"Details:",-1),oe=e("p",null,"Configure VuePress built-in Markdown syntax extensions.",-1),ie={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},se=e("p",null,"Also see:",-1),de={href:"https://github.com/markdown-it/markdown-it#init-with-presets-and-options",target:"_blank",rel:"noopener noreferrer"},re=o(`

    markdown.anchor

    • Type: AnchorPluginOptions | false

    • Default:

    const defaultOptions = {
    +  level: [1, 2, 3, 4, 5, 6],
    +  permalink: anchorPlugin.permalink.ariaHidden({
    +    class: "header-anchor",
    +    symbol: "#",
    +    space: true,
    +    placement: "before",
    +  }),
    +};
    +
    `,3),pe=e("p",null,"Details:",-1),ue={href:"https://github.com/valeriangalliat/markdown-it-anchor",target:"_blank",rel:"noopener noreferrer"},ce=e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")],-1),he=e("p",null,"Also see:",-1),fe=o('

    markdown.assets

    • Type: AssetsPluginOptions | false

    • Details:

      Options for VuePress built-in markdown-it assets plugin.

      Set to false to disable this plugin.

    Warning

    You should not configure it unless you understand what it is for.

    markdown.code

    ',4),me=e("li",null,[e("p",null,[n("Type: "),e("code",null,"CodePluginOptions | false")])],-1),ge=e("li",null,[e("p",null,"Details:"),e("p",null,"Options for VuePress built-in markdown-it code plugin."),e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")])],-1),_e=e("p",null,"Also see:",-1),ke=e("h4",{id:"markdown-code-highlightlines",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-highlightlines","aria-hidden":"true"},"#"),n(" markdown.code.highlightLines")],-1),be=e("li",null,[e("p",null,[n("Type: "),e("code",null,"boolean")])],-1),we=e("li",null,[e("p",null,[n("Default: "),e("code",null,"true")])],-1),ve=e("li",null,[e("p",null,"Details:"),e("p",null,"Enable code line highlighting or not.")],-1),ye=e("p",null,"Also see:",-1),xe=e("h4",{id:"markdown-code-linenumbers",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-linenumbers","aria-hidden":"true"},"#"),n(" markdown.code.lineNumbers")],-1),De=o("
  • Type: boolean | number

  • Default: true

  • Details:

    Configure code line numbers.

    • A boolean value is to enable line numbers or not.
    • A number value is the minimum number of lines to enable line numbers. For example, if you set it to 4, line numbers will only be enabled when your code block has at least 4 lines of code.
  • ",3),Te=e("p",null,"Also see:",-1),Pe=o('

    markdown.code.preWrapper

    • Type: boolean

    • Default: true

    • Details:

      Enable the extra wrapper of the <pre> tag or not.

      The wrapper is required by the highlightLines and lineNumbers. That means, if you disable preWrapper, the line highlighting and line numbers will also be disabled.

    ',2),Ae={class:"hint-container tip"},Se=e("p",{class:"hint-container-title"},"Tips",-1),Ce={href:"https://prismjs.com/plugins/line-highlight/",target:"_blank",rel:"noopener noreferrer"},qe={href:"https://prismjs.com/plugins/line-numbers/",target:"_blank",rel:"noopener noreferrer"},Le=e("h4",{id:"markdown-code-vpre-block",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-vpre-block","aria-hidden":"true"},"#"),n(" markdown.code.vPre.block")],-1),Oe=o("
  • Type: boolean

  • Default: true

  • Details:

    Add v-pre directive to <pre> tag of code block or not.

  • ",3),Be=e("p",null,"Also see:",-1),Ee=e("h4",{id:"markdown-code-vpre-inline",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-vpre-inline","aria-hidden":"true"},"#"),n(" markdown.code.vPre.inline")],-1),Ge=o("
  • Type: boolean

  • Default: true

  • Details:

    Add v-pre directive to <code> tag of inline code or not.

  • ",3),Me=e("p",null,"Also see:",-1),Ie=e("h3",{id:"markdown-component",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-component","aria-hidden":"true"},"#"),n(" markdown.component")],-1),Ne=e("li",null,[e("p",null,[n("Type: "),e("code",null,"undefined | false")])],-1),je=e("p",null,"Details:",-1),He={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-component",target:"_blank",rel:"noopener noreferrer"},Ve=e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")],-1),We=e("div",{class:"hint-container danger"},[e("p",{class:"hint-container-title"},"Warning"),e("p",null,"You should not configure it unless you understand what it is for.")],-1),Re=e("h3",{id:"markdown-emoji",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-emoji","aria-hidden":"true"},"#"),n(" markdown.emoji")],-1),Fe=e("li",null,[e("p",null,[n("Type: "),e("code",null,"EmojiPluginOptions | false")])],-1),Ye=e("p",null,"Details:",-1),Ue={href:"https://github.com/markdown-it/markdown-it-emoji",target:"_blank",rel:"noopener noreferrer"},$e=e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")],-1),Xe=e("p",null,"Also see:",-1),Ze=e("h3",{id:"markdown-frontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-frontmatter","aria-hidden":"true"},"#"),n(" markdown.frontmatter")],-1),ze=e("li",null,[e("p",null,[n("Type: "),e("code",null,"FrontmatterPluginOptions | false")])],-1),Je=e("p",null,"Details:",-1),Ke={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-frontmatter",target:"_blank",rel:"noopener noreferrer"},Qe=e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")],-1),en=e("p",null,"Also see:",-1),nn=o(`

    Warning

    You should not configure it unless you understand what it is for.

    markdown.headers

    • Type: HeadersPluginOptions | false

    • Default:

    const defaultOptions = {
    +  level: [2, 3],
    +};
    +
    `,4),ln=e("p",null,"Details:",-1),tn={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-headers",target:"_blank",rel:"noopener noreferrer"},an=e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")],-1),on=e("p",null,"Also see:",-1),sn=e("h3",{id:"markdown-importcode",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-importcode","aria-hidden":"true"},"#"),n(" markdown.importCode")],-1),dn=e("li",null,[e("p",null,[n("Type: "),e("code",null,"ImportCodePluginOptions | false")])],-1),rn=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),pn=e("p",null,"Also see:",-1),un=o('

    markdown.importCode.handleImportPath

    • Type: (str: string) => string

    • Default: (str) => str

    • Details:

      A function to handle the import path of the import code syntax.

    ',3),cn=o("
  • Type: LinksPluginOptions | false

  • Details:

    Options for VuePress built-in markdown-it links plugin.

    It will convert internal links to <RouterLink>, and add extra attributes and icon to external links.

    Set to false to disable this plugin.

  • ",2),hn=e("p",null,"Also see:",-1),fn=o('
    • Type: 'a' | 'RouterLink'

    • Default: 'RouterLink'

    • Details:

      Tag for internal links.

      By default, this plugin will transform internal links to <RouterLink>. You can set this option to 'a' to disable this feature.

    • Type: Record<string, string>

    • Default: { target: '_blank', rel: 'noopener noreferrer' }

    • Details:

      Additional attributes for external links.

    markdown.sfc

    ',5),mn=e("li",null,[e("p",null,[n("Type: "),e("code",null,"SfcPluginOptions | false")])],-1),gn=e("p",null,"Details:",-1),_n={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-sfc",target:"_blank",rel:"noopener noreferrer"},kn=e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")],-1),bn=e("p",null,"Also see:",-1),wn=e("h3",{id:"markdown-slugify",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-slugify","aria-hidden":"true"},"#"),n(" markdown.slugify")],-1),vn=e("ul",null,[e("li",null,[e("p",null,[n("Type: "),e("code",null,"(str: string) => string")])]),e("li",null,[e("p",null,"Details:"),e("p",null,"The default slugify function.")])],-1),yn=e("h3",{id:"markdown-title",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-title","aria-hidden":"true"},"#"),n(" markdown.title")],-1),xn=e("li",null,[e("p",null,[n("Type: "),e("code",null,"undefined | false")])],-1),Dn=e("p",null,"Details:",-1),Tn={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-title",target:"_blank",rel:"noopener noreferrer"},Pn=e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")],-1),An=o(`

    Warning

    You should not configure it unless you understand what it is for.

    markdown.toc

    • Type: TocPluginOptions | false

    • Default:

    const defaultOptions = {
    +  level: [2, 3],
    +};
    +
    `,4),Sn=e("p",null,"Details:",-1),Cn={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc",target:"_blank",rel:"noopener noreferrer"},qn=e("p",null,[n("Set to "),e("code",null,"false"),n(" to disable this plugin.")],-1),Ln=e("p",null,"Also see:",-1),On=e("h2",{id:"plugin-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugin-config","aria-hidden":"true"},"#"),n(" Plugin Config")],-1),Bn=e("h3",{id:"plugins",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugins","aria-hidden":"true"},"#"),n(" plugins")],-1),En=e("li",null,[e("p",null,[n("Type: "),e("code",null,"(Plugin | Plugin[])[]")])],-1),Gn=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),Mn=e("p",null,"Also see:",-1),In=e("h2",{id:"plugin-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugin-api","aria-hidden":"true"},"#"),n(" Plugin API")],-1),Nn=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);function jn(Hn,Vn){const d=s("NpmBadge"),t=s("RouterLink"),i=s("ExternalLinkIcon");return p(),u("div",null,[h,l(d,{package:"@vuepress/cli"}),l(d,{package:"@vuepress/core"}),f,m,e("ul",null,[g,e("li",null,[_,e("ul",null,[e("li",null,[l(t,{to:"/guide/assets.html#base-helper"},{default:a(()=>[n("Guide > Assets > Base Helper")]),_:1})]),e("li",null,[l(t,{to:"/guide/deployment.html"},{default:a(()=>[n("Guide > Deployment")]),_:1})])])])]),k,e("ul",null,[b,e("li",null,[w,e("ul",null,[v,e("li",null,[l(t,{to:"/reference/frontmatter.html#lang"},{default:a(()=>[n("Frontmatter > lang")]),_:1})])])])]),y,e("ul",null,[x,e("li",null,[D,e("ul",null,[T,e("li",null,[l(t,{to:"/reference/frontmatter.html#description"},{default:a(()=>[n("Frontmatter > description")]),_:1})])])])]),P,e("ul",null,[e("li",null,[n("Also see: "),e("ul",null,[A,e("li",null,[l(t,{to:"/reference/frontmatter.html#head"},{default:a(()=>[n("Frontmatter > head")]),_:1})])])])]),S,e("ul",null,[C,e("li",null,[q,e("ul",null,[e("li",null,[l(t,{to:"/guide/i18n.html"},{default:a(()=>[n("Guide > I18n")]),_:1})])])])]),L,O,e("ul",null,[B,E,e("li",null,[G,e("ul",null,[e("li",null,[l(t,{to:"/guide/theme.html"},{default:a(()=>[n("Guide > Theme")]),_:1})]),e("li",null,[l(t,{to:"/reference/default-theme/config.html"},{default:a(()=>[n("Default Theme > Config")]),_:1})])])])]),M,I,e("ul",null,[N,e("li",null,[j,e("ul",null,[e("li",null,[l(t,{to:"/guide/bundler.html"},{default:a(()=>[n("Guide > Bundler")]),_:1})]),e("li",null,[l(t,{to:"/reference/bundler/vite.html"},{default:a(()=>[n("Bundlers > Vite")]),_:1})]),e("li",null,[l(t,{to:"/reference/bundler/webpack.html"},{default:a(()=>[n("Bundlers > Webpack")]),_:1})])])])]),H,e("ul",null,[V,W,R,e("li",null,[F,e("ul",null,[e("li",null,[l(t,{to:"/guide/assets.html#public-files"},{default:a(()=>[n("Guide > Assets > Public Files")]),_:1})])])])]),Y,e("ul",null,[U,$,e("li",null,[X,Z,e("p",null,[n("This would be helpful for developers. Also, we are using "),e("a",z,[n("debug"),l(i)]),n(" package for debug logging, which can be enabled via "),J,n(" environment variable.")])])]),K,e("ul",null,[Q,e("li",null,[ee,e("ul",null,[e("li",null,[l(t,{to:"/reference/frontmatter.html#permalinkpattern"},{default:a(()=>[n("Frontmatter > permalinkPattern")]),_:1})])])])]),ne,e("ul",null,[le,te,e("li",null,[ae,oe,e("p",null,[n("It accepts all options of "),e("a",ie,[n("markdown-it"),l(i)]),n(", and the following additional options.")])]),e("li",null,[se,e("ul",null,[e("li",null,[e("a",de,[n("markdown-it > Init with presets and options"),l(i)])]),e("li",null,[l(t,{to:"/guide/markdown.html#syntax-extensions"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions")]),_:1})])])])]),re,e("ul",null,[e("li",null,[pe,e("p",null,[n("Options for "),e("a",ue,[n("markdown-it-anchor"),l(i)]),n(".")]),ce]),e("li",null,[he,e("ul",null,[e("li",null,[l(t,{to:"/guide/markdown.html#header-anchors"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions > Header Anchors")]),_:1})])])])]),fe,e("ul",null,[me,ge,e("li",null,[_e,e("ul",null,[e("li",null,[l(t,{to:"/guide/markdown.html#code-blocks"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions > Code Blocks")]),_:1})])])])]),ke,e("ul",null,[be,we,ve,e("li",null,[ye,e("ul",null,[e("li",null,[l(t,{to:"/guide/markdown.html#line-highlighting"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions > Code Blocks > Line Highlighting")]),_:1})])])])]),xe,e("ul",null,[De,e("li",null,[Te,e("ul",null,[e("li",null,[l(t,{to:"/guide/markdown.html#line-numbers"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions > Code Blocks > Line Numbers")]),_:1})])])])]),Pe,e("div",Ae,[Se,e("p",null,[n("You can disable it if you want to implement them in client side. For example, "),e("a",Ce,[n("Prismjs Line Highlight"),l(i)]),n(" or "),e("a",qe,[n("Prismjs Line Numbers"),l(i)]),n(".")])]),Le,e("ul",null,[Oe,e("li",null,[Be,e("ul",null,[e("li",null,[l(t,{to:"/guide/markdown.html#wrap-with-v-pre"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions > Code Blocks > Wrap with v-pre")]),_:1})])])])]),Ee,e("ul",null,[Ge,e("li",null,[Me,e("ul",null,[e("li",null,[l(t,{to:"/guide/markdown.html#wrap-with-v-pre"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions > Code Blocks > Wrap with v-pre")]),_:1})])])])]),Ie,e("ul",null,[Ne,e("li",null,[je,e("p",null,[n("Options for "),e("a",He,[n("@mdit-vue/plugin-component"),l(i)]),n(".")]),Ve])]),We,Re,e("ul",null,[Fe,e("li",null,[Ye,e("p",null,[n("Options for "),e("a",Ue,[n("markdown-it-emoji"),l(i)]),n(".")]),$e]),e("li",null,[Xe,e("ul",null,[e("li",null,[l(t,{to:"/guide/markdown.html#emoji"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions > Emoji")]),_:1})])])])]),Ze,e("ul",null,[ze,e("li",null,[Je,e("p",null,[n("Options for "),e("a",Ke,[n("@mdit-vue/plugin-frontmatter"),l(i)]),n(".")]),Qe]),e("li",null,[en,e("ul",null,[e("li",null,[l(t,{to:"/guide/page.html#frontmatter"},{default:a(()=>[n("Guide > Page > Frontmatter")]),_:1})]),e("li",null,[l(t,{to:"/reference/node-api.html#frontmatter"},{default:a(()=>[n("Node API > Page Properties > frontmatter")]),_:1})])])])]),nn,e("ul",null,[e("li",null,[ln,e("p",null,[n("Options for "),e("a",tn,[n("@mdit-vue/plugin-headers"),l(i)]),n(".")]),an]),e("li",null,[on,e("ul",null,[e("li",null,[l(t,{to:"/reference/node-api.html#headers"},{default:a(()=>[n("Node API > Page Properties > headers")]),_:1})])])])]),sn,e("ul",null,[dn,rn,e("li",null,[pn,e("ul",null,[e("li",null,[l(t,{to:"/guide/markdown.html#import-code-blocks"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions > Import Code Blocks")]),_:1})])])])]),un,e("ul",null,[cn,e("li",null,[hn,e("ul",null,[e("li",null,[l(t,{to:"/guide/markdown.html#links"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions > Links")]),_:1})])])])]),fn,e("ul",null,[mn,e("li",null,[gn,e("p",null,[n("Options for "),e("a",_n,[n("@mdit-vue/plugin-sfc"),l(i)]),n(".")]),kn]),e("li",null,[bn,e("ul",null,[e("li",null,[l(t,{to:"/advanced/cookbook/markdown-and-vue-sfc.html"},{default:a(()=>[n("Cookbook > Markdown and Vue SFC")]),_:1})]),e("li",null,[l(t,{to:"/reference/node-api.html#sfcblocks"},{default:a(()=>[n("Node API > Page Properties > sfcBlocks")]),_:1})])])])]),wn,vn,yn,e("ul",null,[xn,e("li",null,[Dn,e("p",null,[n("Options for "),e("a",Tn,[n("@mdit-vue/plugin-title"),l(i)]),n(".")]),Pn])]),An,e("ul",null,[e("li",null,[Sn,e("p",null,[n("Options for "),e("a",Cn,[n("@mdit-vue/plugin-toc"),l(i)]),n(".")]),qn]),e("li",null,[Ln,e("ul",null,[e("li",null,[l(t,{to:"/guide/markdown.html#table-of-contents"},{default:a(()=>[n("Guide > Markdown > Syntax Extensions > Table of Contents")]),_:1})])])])]),On,Bn,e("ul",null,[En,Gn,e("li",null,[Mn,e("ul",null,[e("li",null,[l(t,{to:"/guide/plugin.html"},{default:a(()=>[n("Guide > Plugin")]),_:1})])])])]),In,Nn,e("p",null,[n("Please check out "),l(t,{to:"/reference/plugin-api.html"},{default:a(()=>[n("Plugin API Reference")]),_:1}),n(" for a full list of Plugin APIs.")])])}const Rn=r(c,[["render",jn],["__file","config.html.vue"]]);export{Rn as default}; diff --git a/assets/config.html-66333531.js b/assets/config.html-66333531.js new file mode 100644 index 00000000..3af9ed03 --- /dev/null +++ b/assets/config.html-66333531.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-03a561ce","path":"/zh/reference/default-theme/config.html","title":"配置","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:gear","description":"基础配置 locales 类型: { [path: string]: Partial }; 默认值: {}; 详情:; 多语言支持的各个语言 locales 。 所有在 Locale 配置 (#locale-配置) 章节内的配置项都可以在 locales 中使用。 该配置项仅能在默认主题内生效,注意不要和 站点配置 (../config.md#loca...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/default-theme/config.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/default-theme/config.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"配置"}],["meta",{"property":"og:description","content":"基础配置 locales 类型: { [path: string]: Partial }; 默认值: {}; 详情:; 多语言支持的各个语言 locales 。 所有在 Locale 配置 (#locale-配置) 章节内的配置项都可以在 locales 中使用。 该配置项仅能在默认主题内生效,注意不要和 站点配置 (../config.md#loca..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"配置\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"基础配置","slug":"基础配置","link":"#基础配置","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Locale 配置","slug":"locale-配置","link":"#locale-配置","children":[{"level":3,"title":"colorMode","slug":"colormode","link":"#colormode","children":[]},{"level":3,"title":"colorModeSwitch","slug":"colormodeswitch","link":"#colormodeswitch","children":[]},{"level":3,"title":"home","slug":"home","link":"#home","children":[]},{"level":3,"title":"navbar","slug":"navbar","link":"#navbar","children":[]},{"level":3,"title":"logo","slug":"logo","link":"#logo","children":[]},{"level":3,"title":"logoDark","slug":"logodark","link":"#logodark","children":[]},{"level":3,"title":"repo","slug":"repo","link":"#repo","children":[]},{"level":3,"title":"repoLabel","slug":"repolabel","link":"#repolabel","children":[]},{"level":3,"title":"selectLanguageText","slug":"selectlanguagetext","link":"#selectlanguagetext","children":[]},{"level":3,"title":"selectLanguageAriaLabel","slug":"selectlanguagearialabel","link":"#selectlanguagearialabel","children":[]},{"level":3,"title":"selectLanguageName","slug":"selectlanguagename","link":"#selectlanguagename","children":[]},{"level":3,"title":"sidebar","slug":"sidebar","link":"#sidebar","children":[]},{"level":3,"title":"sidebarDepth","slug":"sidebardepth","link":"#sidebardepth","children":[]},{"level":3,"title":"editLink","slug":"editlink","link":"#editlink","children":[]},{"level":3,"title":"editLinkText","slug":"editlinktext","link":"#editlinktext","children":[]},{"level":3,"title":"editLinkPattern","slug":"editlinkpattern","link":"#editlinkpattern","children":[]},{"level":3,"title":"docsRepo","slug":"docsrepo","link":"#docsrepo","children":[]},{"level":3,"title":"docsBranch","slug":"docsbranch","link":"#docsbranch","children":[]},{"level":3,"title":"docsDir","slug":"docsdir","link":"#docsdir","children":[]},{"level":3,"title":"lastUpdated","slug":"lastupdated","link":"#lastupdated","children":[]},{"level":3,"title":"lastUpdatedText","slug":"lastupdatedtext","link":"#lastupdatedtext","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]},{"level":3,"title":"contributorsText","slug":"contributorstext","link":"#contributorstext","children":[]},{"level":3,"title":"tip","slug":"tip","link":"#tip","children":[]},{"level":3,"title":"warning","slug":"warning","link":"#warning","children":[]},{"level":3,"title":"danger","slug":"danger","link":"#danger","children":[]},{"level":3,"title":"notFound","slug":"notfound","link":"#notfound","children":[]},{"level":3,"title":"backToHome","slug":"backtohome","link":"#backtohome","children":[]},{"level":3,"title":"openInNewWindow","slug":"openinnewwindow","link":"#openinnewwindow","children":[]},{"level":3,"title":"toggleColorMode","slug":"togglecolormode","link":"#togglecolormode","children":[]},{"level":3,"title":"toggleSidebar","slug":"togglesidebar","link":"#togglesidebar","children":[]}]},{"level":2,"title":"插件配置","slug":"插件配置","link":"#插件配置","children":[{"level":3,"title":"themePlugins","slug":"themeplugins","link":"#themeplugins","children":[]},{"level":3,"title":"themePlugins.activeHeaderLinks","slug":"themeplugins-activeheaderlinks","link":"#themeplugins-activeheaderlinks","children":[]},{"level":3,"title":"themePlugins.container","slug":"themeplugins-container","link":"#themeplugins-container","children":[]},{"level":3,"title":"themePlugins.externalLinkIcon","slug":"themeplugins-externallinkicon","link":"#themeplugins-externallinkicon","children":[]},{"level":3,"title":"themePlugins.git","slug":"themeplugins-git","link":"#themeplugins-git","children":[]},{"level":3,"title":"themePlugins.mediumZoom","slug":"themeplugins-mediumzoom","link":"#themeplugins-mediumzoom","children":[]},{"level":3,"title":"themePlugins.nprogress","slug":"themeplugins-nprogress","link":"#themeplugins-nprogress","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":9.99,"words":2996},"filePathRelative":"zh/reference/default-theme/config.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/config.html-8c5b48e3.js b/assets/config.html-8c5b48e3.js new file mode 100644 index 00000000..056955ef --- /dev/null +++ b/assets/config.html-8c5b48e3.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-65a9edeb","path":"/zh/reference/config.html","title":"配置","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:gear","description":"站点配置 base 类型: string; 默认值: /; 详情:; 部署站点的基础路径。 如果你想让你的网站部署到一个子路径下,你将需要设置它。它的值应当总是以斜杠开始,并以斜杠结束。举例来说,如果你想将你的网站部署到 https://foo.github.io/bar/,那么 base 应该被设置成 \\"/bar/\\"。 base 将会作为前缀自动地插...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/config.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/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":"2023-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"配置\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":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.code","slug":"markdown-code","link":"#markdown-code","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.title","slug":"markdown-title","link":"#markdown-title","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.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":9.34,"words":2801},"filePathRelative":"zh/reference/config.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/config.html-9875b777.js b/assets/config.html-9875b777.js new file mode 100644 index 00000000..6d1a4766 --- /dev/null +++ b/assets/config.html-9875b777.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0f0d17a8","path":"/reference/default-theme/config.html","title":"Config","lang":"en-US","frontmatter":{"icon":"fa6-solid:gear","description":"Basic Config locales Type: { [path: string]: Partial }; Default: {}; Details:; Specify locales for i18n support. All the options inside the Locale Config (#locale-config) sectio...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/default-theme/config.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/default-theme/config.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Config"}],["meta",{"property":"og:description","content":"Basic Config locales Type: { [path: string]: Partial }; Default: {}; Details:; Specify locales for i18n support. All the options inside the Locale Config (#locale-config) sectio..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Config\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Basic Config","slug":"basic-config","link":"#basic-config","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Locale Config","slug":"locale-config","link":"#locale-config","children":[{"level":3,"title":"colorMode","slug":"colormode","link":"#colormode","children":[]},{"level":3,"title":"colorModeSwitch","slug":"colormodeswitch","link":"#colormodeswitch","children":[]},{"level":3,"title":"home","slug":"home","link":"#home","children":[]},{"level":3,"title":"navbar","slug":"navbar","link":"#navbar","children":[]},{"level":3,"title":"logo","slug":"logo","link":"#logo","children":[]},{"level":3,"title":"logoDark","slug":"logodark","link":"#logodark","children":[]},{"level":3,"title":"repo","slug":"repo","link":"#repo","children":[]},{"level":3,"title":"repoLabel","slug":"repolabel","link":"#repolabel","children":[]},{"level":3,"title":"selectLanguageText","slug":"selectlanguagetext","link":"#selectlanguagetext","children":[]},{"level":3,"title":"selectLanguageAriaLabel","slug":"selectlanguagearialabel","link":"#selectlanguagearialabel","children":[]},{"level":3,"title":"selectLanguageName","slug":"selectlanguagename","link":"#selectlanguagename","children":[]},{"level":3,"title":"sidebar","slug":"sidebar","link":"#sidebar","children":[]},{"level":3,"title":"sidebarDepth","slug":"sidebardepth","link":"#sidebardepth","children":[]},{"level":3,"title":"editLink","slug":"editlink","link":"#editlink","children":[]},{"level":3,"title":"editLinkText","slug":"editlinktext","link":"#editlinktext","children":[]},{"level":3,"title":"editLinkPattern","slug":"editlinkpattern","link":"#editlinkpattern","children":[]},{"level":3,"title":"docsRepo","slug":"docsrepo","link":"#docsrepo","children":[]},{"level":3,"title":"docsBranch","slug":"docsbranch","link":"#docsbranch","children":[]},{"level":3,"title":"docsDir","slug":"docsdir","link":"#docsdir","children":[]},{"level":3,"title":"lastUpdated","slug":"lastupdated","link":"#lastupdated","children":[]},{"level":3,"title":"lastUpdatedText","slug":"lastupdatedtext","link":"#lastupdatedtext","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]},{"level":3,"title":"contributorsText","slug":"contributorstext","link":"#contributorstext","children":[]},{"level":3,"title":"tip","slug":"tip","link":"#tip","children":[]},{"level":3,"title":"warning","slug":"warning","link":"#warning","children":[]},{"level":3,"title":"danger","slug":"danger","link":"#danger","children":[]},{"level":3,"title":"notFound","slug":"notfound","link":"#notfound","children":[]},{"level":3,"title":"backToHome","slug":"backtohome","link":"#backtohome","children":[]},{"level":3,"title":"openInNewWindow","slug":"openinnewwindow","link":"#openinnewwindow","children":[]},{"level":3,"title":"toggleColorMode","slug":"togglecolormode","link":"#togglecolormode","children":[]},{"level":3,"title":"toggleSidebar","slug":"togglesidebar","link":"#togglesidebar","children":[]}]},{"level":2,"title":"Plugins Config","slug":"plugins-config","link":"#plugins-config","children":[{"level":3,"title":"themePlugins","slug":"themeplugins","link":"#themeplugins","children":[]},{"level":3,"title":"themePlugins.activeHeaderLinks","slug":"themeplugins-activeheaderlinks","link":"#themeplugins-activeheaderlinks","children":[]},{"level":3,"title":"themePlugins.backToTop","slug":"themeplugins-backtotop","link":"#themeplugins-backtotop","children":[]},{"level":3,"title":"themePlugins.container","slug":"themeplugins-container","link":"#themeplugins-container","children":[]},{"level":3,"title":"themePlugins.externalLinkIcon","slug":"themeplugins-externallinkicon","link":"#themeplugins-externallinkicon","children":[]},{"level":3,"title":"themePlugins.git","slug":"themeplugins-git","link":"#themeplugins-git","children":[]},{"level":3,"title":"themePlugins.mediumZoom","slug":"themeplugins-mediumzoom","link":"#themeplugins-mediumzoom","children":[]},{"level":3,"title":"themePlugins.nprogress","slug":"themeplugins-nprogress","link":"#themeplugins-nprogress","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":7.16,"words":2148},"filePathRelative":"reference/default-theme/config.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/config.html-d093ed05.js b/assets/config.html-d093ed05.js new file mode 100644 index 00000000..b922f5d2 --- /dev/null +++ b/assets/config.html-d093ed05.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-b249668c","path":"/reference/config.html","title":"Config","lang":"en-US","frontmatter":{"icon":"fa6-solid:gear","description":"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. It sh...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/config.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/config.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Config"}],["meta",{"property":"og:description","content":"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. It sh..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Config\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":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.code","slug":"markdown-code","link":"#markdown-code","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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":6.43,"words":1930},"filePathRelative":"reference/config.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/config.html-e71cb202.js b/assets/config.html-e71cb202.js new file mode 100644 index 00000000..bc46e12c --- /dev/null +++ b/assets/config.html-e71cb202.js @@ -0,0 +1,22 @@ +import{_ as r,W as p,X as c,Y as l,$ as e,Z as t,a0 as n,a1 as o,D as i}from"./framework-46b0e263.js";const u={},h=e("h1",{id:"配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#配置","aria-hidden":"true"},"#"),n(" 配置")],-1),m=e("h2",{id:"站点配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#站点配置","aria-hidden":"true"},"#"),n(" 站点配置")],-1),_=e("h3",{id:"base",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#base","aria-hidden":"true"},"#"),n(" base")],-1),k=o("
  • 类型: string

  • 默认值: /

  • 详情:

    部署站点的基础路径。

    如果你想让你的网站部署到一个子路径下,你将需要设置它。它的值应当总是以斜杠开始,并以斜杠结束。举例来说,如果你想将你的网站部署到 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/"

    base 将会作为前缀自动地插入到所有以 / 开始的其他选项的链接中,所以你只需要指定一次。

    需要注意的是, base 应该是一个以 / 开始和结束的绝对路径名。

  • ",3),g=e("p",null,"参考:",-1),f=o('

    lang

    • 类型: string

    • 默认值: en-US

    • 详情:

      站点的语言。

      它将会在最终渲染出的 HTML 中作为 <html> 标签的 lang 属性。

      它可以设置在不同语言的 locales 中。

    • 参考:

    title

    • 类型: string

    • 默认值: ''

    • 详情:

      站点的标题。

      它将会作为所有页面标题的后缀,并且在默认主题的导航栏中显示。

      它可以设置在不同语言的 locales 中。

    • 参考:

    description

    ',5),b=o("
  • 类型: string

  • 默认值: ''

  • 详情:

    站点的描述。

    它将会在最终渲染出的 HTML 中作为 <meta name="description" /> 标签的 content 属性。它会被每个页面的 Frontmatter 中的 description 字段覆盖。

    它可以设置在不同语言的 locales 中。

  • ",3),v=e("p",null,"参考:",-1),w=e("li",null,[e("a",{href:"#locales"},"配置 > locales")],-1),x=o(`
    • 类型: HeadConfig[]

    • 默认值: []

    • 详情:

      在最终渲染出的 HTML 的 <head> 标签内加入的额外标签。

      你可以通过 [tagName, { attrName: attrValue }, innerHTML?] 的格式来添加标签。

      它可以设置在不同语言的 locales 中。

    • 示例:

      增加一个自定义的 favicon :

    export default {
    +  head: [["link", { rel: "icon", href: "/images/logo.png" }]],
    +};
    +

    渲染为:

    <head>
    +  <link rel="icon" href="/images/logo.png" />
    +</head>
    +
    `,5),P=e("li",null,[e("a",{href:"#locales"},"配置 > locales")],-1),E=e("h3",{id:"locales",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#locales","aria-hidden":"true"},"#"),n(" locales")],-1),B=o('
  • 类型: { [path: string]: Partial<SiteLocaleData> }

  • 默认值: {}

  • 详情:

    多语言支持的各个语言 locales 。

    可以使用的字段有:

  • ',3),A=e("p",null,"参考:",-1),z=e("h2",{id:"主题配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#主题配置","aria-hidden":"true"},"#"),n(" 主题配置")],-1),q=e("h3",{id:"theme",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#theme","aria-hidden":"true"},"#"),n(" theme")],-1),y=e("li",null,[e("p",null,[n("类型: "),e("code",null,"Theme")])],-1),M=e("li",null,[e("p",null,"详情:"),e("p",null,"设置站点要使用的主题。"),e("p",null,"如果不设置该选项,将会使用默认主题。")],-1),L=e("p",null,"参考:",-1),D=e("h2",{id:"打包工具配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#打包工具配置","aria-hidden":"true"},"#"),n(" 打包工具配置")],-1),V=e("h3",{id:"bundler",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#bundler","aria-hidden":"true"},"#"),n(" bundler")],-1),N=o("
  • 类型: Bundler

  • 详情:

    设置站点要使用的打包工具。

    如果不设置该选项,将会使用默认的打包工具:

    • 使用 vuepressvuepress-vite 时,默认的打包工具是 Vite 。
    • 使用 vuepress-webpack 时,默认的打包工具是 Webpack 。
  • ",2),O=e("p",null,"参考:",-1),C=o('

    通用配置项

    dest

    • 类型: string

    • 默认值: `${sourceDir}/.vuepress/dist`

    • 详情:

      指定 vuepress build 命令的输出目录。

    temp

    • 类型: string

    • 默认值: `${sourceDir}/.vuepress/.temp`

    • 详情:

      指定临时文件目录。

    注意

    VuePress 在开发和构建时会加载临时文件,因此临时文件目录应位于项目根目录内部,以便可以正确地解析到依赖。

    cache

    • 类型: string

    • 默认值: `${sourceDir}/.vuepress/.cache`

    • 详情:

      指定缓存文件目录。

    public

    ',9),I=e("li",null,[e("p",null,[n("类型: "),e("code",null,"string")])],-1),j=e("li",null,[e("p",null,[n("默认值: "),e("code",null,"`${sourceDir}/.vuepress/public`")])],-1),F=e("li",null,[e("p",null,"详情:"),e("p",null,"指定 Public 文件目录。")],-1),H=e("p",null,"参考:",-1),T=e("h3",{id:"debug",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#debug","aria-hidden":"true"},"#"),n(" debug")],-1),R=e("li",null,[e("p",null,[n("类型: "),e("code",null,"boolean")])],-1),S=e("li",null,[e("p",null,[n("默认值: "),e("code",null,"false")])],-1),W=e("p",null,"详情:",-1),$=e("p",null,"是否启用 Debug 模式。",-1),U={href:"https://github.com/visionmedia/debug",target:"_blank",rel:"noopener noreferrer"},G=e("code",null,"DEBUG=vuepress*",-1),X=o('

    pagePatterns

    • 类型: string[]

    • 默认值: ['**/*.md', '!.vuepress', '!node_modules']

    • 详情:

      指定页面文件的 Patterns 。这些 Patterns 是相对于 Source 目录的。

    permalinkPattern

    ',3),Y=o("
  • 类型: string | null

  • 默认值: null

  • 详情:

    指定为页面生成永久链接的 Pattern 。

    它会被每个页面的 Frontmatter 中的 permalinkPattern 字段覆盖。

  • ",3),Z=e("p",null,"参考:",-1),J=o('

    Dev 配置项

    host

    • 类型: string

    • 默认值: '0.0.0.0'

    • 详情:

      指定开发服务器的主机名。

    port

    • 类型: number

    • 默认值: 8080

    • 详情:

      指定开发服务器的端口号。

    open

    • 类型: boolean

    • 默认值: false

    • 详情:

      是否在开发服务器启动后打开浏览器。

    templateDev

    • 类型: string

    • 默认值: '@vuepress/client/templates/dev.html'

    • 详情:

      指定开发时使用的 HTML 模板。

    Build 配置项

    shouldPreload

    • 类型: ((file: string, type: string) => boolean)) | boolean

    • 默认值: true

    • 详情:

      一个函数,用来控制哪些文件是需要生成对应的 <link rel="preload"> 标签的。设置为 true 或者 false 来完全启用或禁用它。

      默认情况下,只有当前页面所需的文件会被预加载。所以在绝大部分情况下,你只需要使用 true 就可以了。

    shouldPrefetch

    • 类型: ((file: string, type: string) => boolean)) | boolean

    • 默认值: true

    • 详情:

      一个函数,用来控制哪些文件是需要生成对应的 <link rel="prefetch"> 标签的。设置为 true 或者 false 来完全启用或禁用它。

      如果你将它设置为 true ,所有其它页面所需的文件都会被预拉取。这对于小型站点来说是十分有帮助的,因为它会大大提升页面切换的速度。但是在你的网站有很多页面时不建议你这么做。

    templateBuild

    • 类型: string

    • 默认值: '@vuepress/client/templates/build.html'

    • 详情:

      指定构建时使用的 HTML 模板。

    Markdown 配置

    markdown

    ',18),K=e("li",null,[e("p",null,[n("类型: "),e("code",null,"MarkdownOptions")])],-1),Q=e("li",null,[e("p",null,[n("默认值: "),e("code",null,"{}")])],-1),ee=e("p",null,"详情:",-1),ne=e("p",null,"对 VuePress 内置的 Markdown 语法扩展进行配置。",-1),le={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},ae=e("p",null,"参考:",-1),te={href:"https://github.com/markdown-it/markdown-it#init-with-presets-and-options",target:"_blank",rel:"noopener noreferrer"},oe=o(`

    markdown.anchor

    • 类型: AnchorPluginOptions | false

    • 默认值:

    const defaultOptions = {
    +  level: [1, 2, 3, 4, 5, 6],
    +  permalink: anchorPlugin.permalink.ariaHidden({
    +    class: "header-anchor",
    +    symbol: "#",
    +    space: true,
    +    placement: "before",
    +  }),
    +};
    +
    `,3),se=e("p",null,"详情:",-1),ie={href:"https://github.com/valeriangalliat/markdown-it-anchor",target:"_blank",rel:"noopener noreferrer"},de=e("p",null,[n("设置为 "),e("code",null,"false"),n(" 可以禁用该插件。")],-1),re=e("p",null,"参考:",-1),pe=o('

    markdown.assets

    • 类型: AssetsPluginOptions | false

    • 详情:

      VuePress 内置的 markdown-it assets 插件的配置项。

      设置为 false 可以禁用该插件。

    警告

    除非你了解它的用途,否则你不应该设置该配置项。

    markdown.code

    ',4),ce=e("li",null,[e("p",null,[n("类型: "),e("code",null,"CodePluginOptions | false")])],-1),ue=e("li",null,[e("p",null,"详情:"),e("p",null,"VuePress 内置的 markdown-it code 插件的配置项。"),e("p",null,[n("设置为 "),e("code",null,"false"),n(" 可以禁用该插件。")])],-1),he=e("p",null,"参考:",-1),me=e("h4",{id:"markdown-code-highlightlines",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-highlightlines","aria-hidden":"true"},"#"),n(" markdown.code.highlightLines")],-1),_e=e("li",null,[e("p",null,[n("类型: "),e("code",null,"boolean")])],-1),ke=e("li",null,[e("p",null,[n("默认值: "),e("code",null,"true")])],-1),ge=e("li",null,[e("p",null,"详情:"),e("p",null,"是否启用代码块行高亮。")],-1),fe=e("p",null,"参考:",-1),be=e("h4",{id:"markdown-code-linenumbers",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-linenumbers","aria-hidden":"true"},"#"),n(" markdown.code.lineNumbers")],-1),ve=o("
  • 类型: boolean | number

  • 默认值: true

  • 详情:

    配置代码块行号。

    • 布尔值 boolean 代表是否启用代码块行号。
    • 数字 number 代表显示行号所需的最少行数。例如,如果你将它设置为 4 ,那么只有在你的代码块包含至少 4 行代码时才会启用行号。
  • ",3),we=e("p",null,"参考:",-1),xe=o('

    markdown.code.preWrapper

    • 类型: boolean

    • 默认值: true

    • 详情:

      是否在 <pre> 标签外额外包裹一层。

      highlightLineslineNumbers 依赖于这个额外的包裹层。这换句话说,如果你禁用了 preWrapper ,那么行高亮和行号也会被同时禁用。

    ',2),Pe={class:"hint-container tip"},Ee=e("p",{class:"hint-container-title"},"提示",-1),Be={href:"https://prismjs.com/plugins/line-highlight/",target:"_blank",rel:"noopener noreferrer"},Ae={href:"https://prismjs.com/plugins/line-numbers/",target:"_blank",rel:"noopener noreferrer"},ze=e("h4",{id:"markdown-code-vpre-block",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-vpre-block","aria-hidden":"true"},"#"),n(" markdown.code.vPre.block")],-1),qe=o("
  • 类型: boolean

  • 默认值: true

  • 详情:

    是否在代码块的 <pre> 标签上添加 v-pre 指令。

  • ",3),ye=e("p",null,"参考:",-1),Me=e("h4",{id:"markdown-code-vpre-inline",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-vpre-inline","aria-hidden":"true"},"#"),n(" markdown.code.vPre.inline")],-1),Le=o("
  • 类型: boolean

  • 默认值: true

  • 详情:

    是否在行内代码的 <code> 标签上添加 v-pre 指令。

  • ",3),De=e("p",null,"参考:",-1),Ve=e("h3",{id:"markdown-component",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-component","aria-hidden":"true"},"#"),n(" markdown.component")],-1),Ne=e("li",null,[e("p",null,[n("类型: "),e("code",null,"undefined | false")])],-1),Oe=e("p",null,"详情:",-1),Ce={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-component",target:"_blank",rel:"noopener noreferrer"},Ie=e("p",null,[n("设置为 "),e("code",null,"false"),n(" 可以禁用该插件。")],-1),je=e("div",{class:"hint-container danger"},[e("p",{class:"hint-container-title"},"警告"),e("p",null,"除非你了解它的用途,否则你不应该设置该配置项。")],-1),Fe=e("h3",{id:"markdown-emoji",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-emoji","aria-hidden":"true"},"#"),n(" markdown.emoji")],-1),He=e("li",null,[e("p",null,[n("类型: "),e("code",null,"EmojiPluginOptions | false")])],-1),Te=e("p",null,"详情:",-1),Re={href:"https://github.com/markdown-it/markdown-it-emoji",target:"_blank",rel:"noopener noreferrer"},Se=e("p",null,[n("设置为 "),e("code",null,"false"),n(" 可以禁用该插件。")],-1),We=e("p",null,"参考:",-1),$e=e("h3",{id:"markdown-frontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-frontmatter","aria-hidden":"true"},"#"),n(" markdown.frontmatter")],-1),Ue=e("li",null,[e("p",null,[n("类型: "),e("code",null,"FrontmatterPluginOptions | false")])],-1),Ge=e("p",null,"详情:",-1),Xe={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-frontmatter",target:"_blank",rel:"noopener noreferrer"},Ye=e("p",null,[n("设置为 "),e("code",null,"false"),n(" 可以禁用该插件。")],-1),Ze=e("p",null,"参考:",-1),Je=o(`

    警告

    除非你了解它的用途,否则你不应该设置该配置项。

    markdown.headers

    • 类型: HeadersPluginOptions | false

    • 默认值:

    const defaultOptions = {
    +  level: [2, 3],
    +};
    +
    `,4),Ke=e("p",null,"详情:",-1),Qe={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-headers",target:"_blank",rel:"noopener noreferrer"},en=e("p",null,[n("设置为 "),e("code",null,"false"),n(" 可以禁用该插件。")],-1),nn=e("p",null,"参考:",-1),ln=e("h3",{id:"markdown-title",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-title","aria-hidden":"true"},"#"),n(" markdown.title")],-1),an=e("li",null,[e("p",null,[n("类型: "),e("code",null,"undefined | false")])],-1),tn=e("p",null,"详情:",-1),on={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-title",target:"_blank",rel:"noopener noreferrer"},sn=e("p",null,[n("设置为 "),e("code",null,"false"),n(" 可以禁用该插件。")],-1),dn=e("div",{class:"hint-container danger"},[e("p",{class:"hint-container-title"},"警告"),e("p",null,"除非你了解它的用途,否则你不应该设置该配置项。")],-1),rn=e("h3",{id:"markdown-importcode",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-importcode","aria-hidden":"true"},"#"),n(" markdown.importCode")],-1),pn=e("li",null,[e("p",null,[n("类型: "),e("code",null,"ImportCodePluginOptions | false")])],-1),cn=e("li",null,[e("p",null,"详情:"),e("p",null,"VuePress 内置的 markdown-it 导入代码插件的配置项。"),e("p",null,[n("设置为 "),e("code",null,"false"),n(" 可以禁用该插件。")])],-1),un=e("p",null,"参考:",-1),hn=o('

    markdown.importCode.handleImportPath

    • 类型: (str: string) => string

    • 默认值: (str) => str

    • 详情:

      一个函数,用于处理导入代码语法中的文件导入路径。

    ',3),mn=o("
  • 类型: LinkPluginOptions | false

  • 详情:

    VuePress 内置的 markdown-it 链接插件的配置项。

    它可以把站内链接转换为 <RouterLink> ,并且可以在站外链接上添加额外的属性和图标。

    设置为 false 可以禁用该插件。

  • ",2),_n=e("p",null,"参考:",-1),kn=o('
    • 类型: string

    • 默认值: 'RouterLink'

    • 详情:

      内部链接所使用的标签。

      默认情况下,该插件会把内部链接转换为 <RouterLink> 。你可以把该选项设置为 'a' 来禁用这个功能。

    • 类型: Record<string, string>

    • 默认值: { target: '_blank', rel: 'noopener noreferrer' }

    • 详情:

      为外部链接添加额外的属性。

    markdown.sfc

    ',5),gn=e("li",null,[e("p",null,[n("类型: "),e("code",null,"SfcPluginOptions | false")])],-1),fn=e("p",null,"详情:",-1),bn={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-sfc",target:"_blank",rel:"noopener noreferrer"},vn=e("p",null,[n("设置为 "),e("code",null,"false"),n(" 可以禁用该插件。")],-1),wn=e("p",null,"参考:",-1),xn=o(`

    markdown.slugify

    • 类型: (str: string) => string

    • 详情:

      默认使用的 slugify 函数。

    markdown.toc

    • 类型: TocPluginOptions | false

    • 默认值:

    const defaultOptions = {
    +  level: [2, 3],
    +};
    +
    `,5),Pn=e("p",null,"详情:",-1),En={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc",target:"_blank",rel:"noopener noreferrer"},Bn=e("p",null,[n("设置为 "),e("code",null,"false"),n(" 可以禁用该插件。")],-1),An=e("p",null,"参考:",-1),zn=e("h2",{id:"插件配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#插件配置","aria-hidden":"true"},"#"),n(" 插件配置")],-1),qn=e("h3",{id:"plugins",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugins","aria-hidden":"true"},"#"),n(" plugins")],-1),yn=e("li",null,[e("p",null,[n("类型: "),e("code",null,"PluginConfig[]")])],-1),Mn=e("li",null,[e("p",null,"详情:"),e("p",null,"要使用的插件。"),e("p",null,"该配置项接收一个数组,其中的每一个数组项是一个或一组插件。")],-1),Ln=e("p",null,"参考:",-1),Dn=e("h2",{id:"插件-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#插件-api","aria-hidden":"true"},"#"),n(" 插件 API")],-1),Vn=e("p",null,[n("用户配置文件同样可以作为一个 VuePress 插件,所以除了 "),e("code",null,"name"),n(" 和 "),e("code",null,"multiple"),n(" 配置项以外的所有插件 API 都可以在配置文件中使用。")],-1);function Nn(On,Cn){const d=i("NpmBadge"),a=i("RouterLink"),s=i("ExternalLinkIcon");return p(),c("div",null,[h,l(d,{package:"@vuepress/cli"}),l(d,{package:"@vuepress/core"}),m,_,e("ul",null,[k,e("li",null,[g,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/assets.html#base-helper"},{default:t(()=>[n("指南 > 静态资源 > Base Helper")]),_:1})]),e("li",null,[l(a,{to:"/zh/guide/deployment.html"},{default:t(()=>[n("指南 > 部署")]),_:1})])])])]),f,e("ul",null,[b,e("li",null,[v,e("ul",null,[w,e("li",null,[l(a,{to:"/zh/reference/frontmatter.html#description"},{default:t(()=>[n("Frontmatter > description")]),_:1})])])])]),x,e("ul",null,[e("li",null,[n("参考: "),e("ul",null,[P,e("li",null,[l(a,{to:"/zh/reference/frontmatter.html#head"},{default:t(()=>[n("Frontmatter > head")]),_:1})])])])]),E,e("ul",null,[B,e("li",null,[A,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/i18n.html"},{default:t(()=>[n("指南 > I18n")]),_:1})])])])]),z,q,e("ul",null,[y,M,e("li",null,[L,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/theme.html"},{default:t(()=>[n("指南 > 主题")]),_:1})]),e("li",null,[l(a,{to:"/zh/reference/default-theme/config.html"},{default:t(()=>[n("默认主题 > 配置")]),_:1})])])])]),D,V,e("ul",null,[N,e("li",null,[O,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/bundler.html"},{default:t(()=>[n("指南 > 打包工具")]),_:1})]),e("li",null,[l(a,{to:"/zh/reference/bundler/vite.html"},{default:t(()=>[n("打包工具 > Vite")]),_:1})]),e("li",null,[l(a,{to:"/zh/reference/bundler/webpack.html"},{default:t(()=>[n("打包工具 > Webpack")]),_:1})])])])]),C,e("ul",null,[I,j,F,e("li",null,[H,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/assets.html#public-%E6%96%87%E4%BB%B6"},{default:t(()=>[n("指南 > 静态资源 > Public 文件")]),_:1})])])])]),T,e("ul",null,[R,S,e("li",null,[W,$,e("p",null,[n("该配置项主要提供给开发者使用。同时,我们使用了 "),e("a",U,[n("debug"),l(s)]),n(" 模块打印 Debug 日志,可以通过 "),G,n(" 环境变量来启用。")])])]),X,e("ul",null,[Y,e("li",null,[Z,e("ul",null,[e("li",null,[l(a,{to:"/zh/reference/frontmatter.html#permalinkpattern"},{default:t(()=>[n("Frontmatter > permalinkPattern")]),_:1})])])])]),J,e("ul",null,[K,Q,e("li",null,[ee,ne,e("p",null,[n("它可以接收 "),e("a",le,[n("markdown-it"),l(s)]),n(" 的所有配置项,以及下列额外的配置项。")])]),e("li",null,[ae,e("ul",null,[e("li",null,[e("a",te,[n("markdown-it > Init with presets and options"),l(s)])]),e("li",null,[l(a,{to:"/zh/guide/markdown.html#%E8%AF%AD%E6%B3%95%E6%89%A9%E5%B1%95"},{default:t(()=>[n("指南 > Markdown > 语法扩展")]),_:1})])])])]),oe,e("ul",null,[e("li",null,[se,e("p",null,[e("a",ie,[n("markdown-it-anchor"),l(s)]),n(" 的配置项。")]),de]),e("li",null,[re,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/markdown.html#%E6%A0%87%E9%A2%98%E9%94%9A%E7%82%B9"},{default:t(()=>[n("指南 > Markdown > 语法扩展 > 标题锚点")]),_:1})])])])]),pe,e("ul",null,[ce,ue,e("li",null,[he,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/markdown.html#%E4%BB%A3%E7%A0%81%E5%9D%97"},{default:t(()=>[n("指南 > Markdown > 语法扩展 > 代码块")]),_:1})])])])]),me,e("ul",null,[_e,ke,ge,e("li",null,[fe,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/markdown.html#%E8%A1%8C%E9%AB%98%E4%BA%AE"},{default:t(()=>[n("指南 > Markdown > 语法扩展 > 代码块 > 行高亮")]),_:1})])])])]),be,e("ul",null,[ve,e("li",null,[we,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/markdown.html#%E8%A1%8C%E5%8F%B7"},{default:t(()=>[n("指南 > Markdown > 语法扩展 > 代码块 > 行号")]),_:1})])])])]),xe,e("div",Pe,[Ee,e("p",null,[n("如果你想要在客户端来实现这些功能时,可以禁用该配置项。比如使用 "),e("a",Be,[n("Prismjs Line Highlight"),l(s)]),n(" 或者 "),e("a",Ae,[n("Prismjs Line Numbers"),l(s)]),n("。")])]),ze,e("ul",null,[qe,e("li",null,[ye,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/markdown.html#%E6%B7%BB%E5%8A%A0-v-pre"},{default:t(()=>[n("指南 > Markdown > 语法扩展 > 代码块 > 添加 v-pre")]),_:1})])])])]),Me,e("ul",null,[Le,e("li",null,[De,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/markdown.html#%E6%B7%BB%E5%8A%A0-v-pre"},{default:t(()=>[n("指南 > Markdown > 语法扩展 > 代码块 > 添加 v-pre")]),_:1})])])])]),Ve,e("ul",null,[Ne,e("li",null,[Oe,e("p",null,[e("a",Ce,[n("@mdit-vue/plugin-component"),l(s)]),n(" 插件的配置项。")]),Ie])]),je,Fe,e("ul",null,[He,e("li",null,[Te,e("p",null,[e("a",Re,[n("markdown-it-emoji"),l(s)]),n(" 的配置项。")]),Se]),e("li",null,[We,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/markdown.html#emoji"},{default:t(()=>[n("指南 > Markdown > 语法扩展 > Emoji")]),_:1})])])])]),$e,e("ul",null,[Ue,e("li",null,[Ge,e("p",null,[e("a",Xe,[n("@mdit-vue/plugin-frontmatter"),l(s)]),n(" 插件的配置项。")]),Ye]),e("li",null,[Ze,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/page.html#frontmatter"},{default:t(()=>[n("指南 > 页面 > Frontmatter")]),_:1})]),e("li",null,[l(a,{to:"/zh/reference/node-api.html#frontmatter"},{default:t(()=>[n("Node API > Page 属性 > frontmatter")]),_:1})])])])]),Je,e("ul",null,[e("li",null,[Ke,e("p",null,[e("a",Qe,[n("@mdit-vue/plugin-headers"),l(s)]),n(" 插件的配置项。")]),en]),e("li",null,[nn,e("ul",null,[e("li",null,[l(a,{to:"/zh/reference/node-api.html#headers"},{default:t(()=>[n("Node API > Page 属性 > headers")]),_:1})])])])]),ln,e("ul",null,[an,e("li",null,[tn,e("p",null,[e("a",on,[n("@mdit-vue/plugin-title"),l(s)]),n(" 插件的配置项。")]),sn])]),dn,rn,e("ul",null,[pn,cn,e("li",null,[un,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/markdown.html#%E5%AF%BC%E5%85%A5%E4%BB%A3%E7%A0%81%E5%9D%97"},{default:t(()=>[n("指南 > Markdown > 语法扩展 > 导入代码块")]),_:1})])])])]),hn,e("ul",null,[mn,e("li",null,[_n,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/markdown.html#%E9%93%BE%E6%8E%A5"},{default:t(()=>[n("指南 > Markdown > 语法扩展 > 链接")]),_:1})])])])]),kn,e("ul",null,[gn,e("li",null,[fn,e("p",null,[e("a",bn,[n("@mdit-vue/plugin-sfc"),l(s)]),n(" 插件的配置项。")]),vn]),e("li",null,[wn,e("ul",null,[e("li",null,[l(a,{to:"/zh/advanced/cookbook/markdown-and-vue-sfc.html"},{default:t(()=>[n("Cookbook > Markdown 与 Vue SFC")]),_:1})]),e("li",null,[l(a,{to:"/zh/reference/node-api.html#sfcblocks"},{default:t(()=>[n("Node API > Page 属性 > sfcBlocks")]),_:1})])])])]),xn,e("ul",null,[e("li",null,[Pn,e("p",null,[e("a",En,[n("@mdit-vue/plugin-toc"),l(s)]),n(" 插件的配置项。")]),Bn]),e("li",null,[An,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/markdown.html#%E7%9B%AE%E5%BD%95"},{default:t(()=>[n("指南 > Markdown > 语法扩展 > 目录")]),_:1})])])])]),zn,qn,e("ul",null,[yn,Mn,e("li",null,[Ln,e("ul",null,[e("li",null,[l(a,{to:"/zh/guide/plugin.html"},{default:t(()=>[n("指南 > 插件")]),_:1})])])])]),Dn,Vn,e("p",null,[n("前往 "),l(a,{to:"/zh/reference/plugin-api.html"},{default:t(()=>[n("插件 API 参考")]),_:1}),n(" 查看所有插件 API 。")])])}const jn=r(u,[["render",Nn],["__file","config.html.vue"]]);export{jn as default}; diff --git a/assets/config.html-e743ca54.js b/assets/config.html-e743ca54.js new file mode 100644 index 00000000..9715330e --- /dev/null +++ b/assets/config.html-e743ca54.js @@ -0,0 +1,173 @@ +import{_ as c,W as u,X as d,Y as a,$ as n,a0 as e,Z as t,a1 as l,D as o}from"./framework-46b0e263.js";const r={},h=n("h1",{id:"config",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#config","aria-hidden":"true"},"#"),e(" Config")],-1),m=l(`
    import { defaultTheme } from "@vuepress/theme-default";
    +
    +export default {
    +  theme: defaultTheme({
    +    // set config here
    +  }),
    +};
    +

    Basic Config

    locales

    `,3),k=n("li",null,[n("p",null,[e("Type: "),n("code",null,"{ [path: string]: Partial }")])],-1),b=n("li",null,[n("p",null,[e("Default: "),n("code",null,"{}")])],-1),v=n("p",null,"Details:",-1),f=n("p",null,"Specify locales for i18n support.",-1),g=n("p",null,[e("All the options inside the "),n("a",{href:"#locale-config"},"Locale Config"),e(" section can be used in locales.")],-1),_=n("code",null,"locales",-1),y=n("p",null,"Also see:",-1),x=l('

    Locale Config

    Config of this section can be used as normal config, and can also be used in the locales option.

    colorMode

    ',3),w=n("li",null,[n("p",null,[e("Type: "),n("code",null,"'auto' | 'light' | 'dark'")])],-1),q=n("li",null,[n("p",null,[e("Default: "),n("code",null,"'auto'")])],-1),T=n("p",null,"Details:",-1),D=n("p",null,"Default color mode.",-1),S=n("code",null,"'auto'",-1),E={href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme",target:"_blank",rel:"noopener noreferrer"},I=n("li",null,[n("p",null,"Also see:"),n("ul",null,[n("li",null,[n("a",{href:"#colormodeswitch"},"Default Theme > Config > colorModeSwitch")])])],-1),C=l(`

    colorModeSwitch

    home

    • Type: string

    • Default: /

    • Details:

      Specify the path of the homepage.

      This will be used for:

      • the logo link of the navbar
      • the back to home link of the 404 page
    • Type: false | (NavbarItem | NavbarGroup | string)[]

    • Default: []

    • Details:

      Configuration of navbar.

      Set to false to disable navbar.

      To configure the navbar items, you can set it to a navbar array, each item of which could be a NavbarItem object, a NavbarGroup object, or a string:

      • A NavbarItem object should have a text field and a link field, could have an optional activeMatch field.
      • A NavbarGroup object should have a text field and a children field. The children field should be a navbar array, too.
      • A string should be the path to the target page file. It will be converted to a NavbarItem object, using the page title as text, and the page route path as link.
    • Example 1:

    export default {
    +  theme: defaultTheme({
    +    navbar: [
    +      // NavbarItem
    +      {
    +        text: "Foo",
    +        link: "/foo/",
    +      },
    +      // NavbarGroup
    +      {
    +        text: "Group",
    +        children: ["/group/foo.md", "/group/bar.md"],
    +      },
    +      // string - page file path
    +      "/bar/README.md",
    +    ],
    +  }),
    +};
    +
    • Example 2:
    export default {
    +  theme: defaultTheme({
    +    navbar: [
    +      // nested group - max depth is 2
    +      {
    +        text: "Group",
    +        children: [
    +          {
    +            text: "SubGroup",
    +            children: ["/group/sub/foo.md", "/group/sub/bar.md"],
    +          },
    +        ],
    +      },
    +      // control when should the item be active
    +      {
    +        text: "Group 2",
    +        children: [
    +          {
    +            text: "Always active",
    +            link: "/",
    +            // this item will always be active
    +            activeMatch: "/",
    +          },
    +          {
    +            text: "Active on /foo/",
    +            link: "/not-foo/",
    +            // this item will be active when current route path starts with /foo/
    +            // regular expression is supported
    +            activeMatch: "^/foo/",
    +          },
    +        ],
    +      },
    +    ],
    +  }),
    +};
    +
    • Type: null | string

    • Details:

      Specify the url of logo image.

      The logo image will be displayed at the left end of the navbar.

      Set to null to disable logo.

    • Example:

    export default {
    +  theme: defaultTheme({
    +    // public file path
    +    logo: "/hero.png",
    +    // url
    +    logo: "https://vuejs.org/images/logo.png",
    +  }),
    +};
    +
    `,12),L=l(`

    logoDark

    repo

    • Type: string

    • Details:

      Specify the repository url of your project.

      This will be used as the link of the repository link, which will be displayed as the last item of the navbar.

    export default {
    +  theme: defaultTheme({
    +    // If you set it in the form of \`organization/repository\`
    +    // we will take it as a GitHub repo
    +    repo: "vuejs/vuepress",
    +    // You can also set it to a URL directly
    +    repo: "https://gitlab.com/foo/bar",
    +  }),
    +};
    +

    repoLabel

    • Type: string

    • Details:

      Specify the repository label of your project.

      This will be used as the text of the repository link, which will be displayed as the last item of the navbar.

      If you don't set this option explicitly, it will be automatically inferred from the repo option.

    selectLanguageText

    `,8),N=n("li",null,[n("p",null,[e("Type: "),n("code",null,"string")])],-1),A=n("p",null,"Details:",-1),G=n("p",null,[e("Specify the text of the "),n("em",null,"select language menu"),e(".")],-1),P=n("em",null,"select language menu",-1),R=l(`

    selectLanguageAriaLabel

    • Type: string

    • Details:

      Specify the aria-label attribute of the select language menu.

      This is mainly for a11y purpose.

    selectLanguageName

    • Type: string

    • Details:

      Specify the name of the language of a locale.

      This option will only take effect inside the locales of your theme config. It will be used as the language name of the locale, which will be displayed in the select language menu.

    • Example:

    export default {
    +  locales: {
    +    "/": {
    +      lang: "en-US",
    +    },
    +    "/zh/": {
    +      lang: "zh-CN",
    +    },
    +  },
    +  theme: defaultTheme({
    +    locales: {
    +      "/": {
    +        selectLanguageName: "English",
    +      },
    +      "/zh/": {
    +        selectLanguageName: "简体中文",
    +      },
    +    },
    +  }),
    +};
    +
    `,6),j=n("li",null,[n("p",null,[e("Type: "),n("code",null,"false | 'auto' | SidebarConfigArray | SidebarConfigObject")])],-1),M=n("li",null,[n("p",null,[e("Default: "),n("code",null,"'auto'")])],-1),B=n("p",null,"Details:",-1),z=n("p",null,"Configuration of sidebar.",-1),Y=l("

    Set to false to disable sidebar.

    If you set it to 'auto', the sidebar will be automatically generated from the page headers.

    To configure the sidebar items manually, you can set this option to a sidebar array, each item of which could be a SidebarItem object or a string:

    • A SidebarItem object should have a text field, could have an optional link field, an optional children field and an optional collapsible field. The children field should be a sidebar array. The collapsible field controls whether the item is collapsible.
    • A string should be the path to the target page file. It will be converted to a SidebarItem object, whose text is the page title, link is the page route path, and children is automatically generated from the page headers.

    If you want to set different sidebar for different sub paths, you can set this option to a sidebar object:

    • The key should be the path prefix.
    • The value should be a sidebar array.
    ",6),U=n("li",null,[n("p",null,"Example 1:")],-1),F=l(`
    export default {
    +  theme: defaultTheme({
    +    // sidebar array
    +    // all pages will use the same sidebar
    +    sidebar: [
    +      // SidebarItem
    +      {
    +        text: "Foo",
    +        link: "/foo/",
    +        children: [
    +          // SidebarItem
    +          {
    +            text: "github",
    +            link: "https://github.com",
    +            children: [],
    +          },
    +          // string - page file path
    +          "/foo/bar.md",
    +        ],
    +      },
    +      // string - page file path
    +      "/bar/README.md",
    +    ],
    +  }),
    +};
    +
    • Example 2:
    export default {
    +  theme: defaultTheme({
    +    // sidebar object
    +    // pages under different sub paths will use different sidebar
    +    sidebar: {
    +      "/guide/": [
    +        {
    +          text: "Guide",
    +          children: ["/guide/README.md", "/guide/getting-started.md"],
    +        },
    +      ],
    +      "/reference/": [
    +        {
    +          text: "Reference",
    +          children: ["/reference/cli.md", "/reference/config.md"],
    +        },
    +      ],
    +    },
    +  }),
    +};
    +
    • Example 3:
    export default {
    +  theme: defaultTheme({
    +    // collapsible sidebar
    +    sidebar: {
    +      "/reference/": [
    +        {
    +          text: "VuePress Reference",
    +          collapsible: true,
    +          children: ["/reference/cli.md", "/reference/config.md"],
    +        },
    +        {
    +          text: "Bundlers Reference",
    +          collapsible: true,
    +          children: [
    +            "/reference/bundler/vite.md",
    +            "/reference/bundler/webpack.md",
    +          ],
    +        },
    +      ],
    +    },
    +  }),
    +};
    +

    sidebarDepth

    `,6),V=n("li",null,[n("p",null,[e("Type: "),n("code",null,"number")])],-1),H=n("li",null,[n("p",null,[e("Default: "),n("code",null,"2")])],-1),W=l("

    Details:

    Set the maximum depth of the sidebar children which are automatically generated from the page headers.

    • Set to 0 to disable all levels of headers.
    • Set to 1 to include <h2> headers.
    • Set to 2 to include <h2> and <h3> headers.
    • ...
    ",3),O=n("p",null,[e("The default value of "),n("code",null,"markdown.headers.level"),e(" is "),n("code",null,"[2, 3]"),e(", so the default max value of "),n("code",null,"sidebarDepth"),e(" is "),n("code",null,"2"),e(".")],-1),Z=n("h3",{id:"editlink",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#editlink","aria-hidden":"true"},"#"),e(" editLink")],-1),X=n("li",null,[n("p",null,[e("Type: "),n("code",null,"boolean")])],-1),$=n("li",null,[n("p",null,[e("Default: "),n("code",null,"true")])],-1),J=n("p",null,"Details:",-1),K=n("p",null,[e("Enable the "),n("em",null,"edit this page"),e(" link or not.")],-1),Q=l(`

    editLinkText

    • Type: string

    • Default: 'Edit this page'

    • Details:

      Specify the text of the edit this page link.

    editLinkPattern

    • Type: string

    • Details:

      Specify the pattern of the edit this page link.

      This will be used for generating the edit this page link.

      If you don't set this option, the pattern will be inferred from the docsRepo option. But if your documentation repository is not hosted on a common platform, for example, GitHub, GitLab, Bitbucket, Gitee, etc., you have to set this option explicitly to make the edit this page link work.

    • Usage:

      PatternDescription
      :repoThe docs repo url, i.e. docsRepo
      :branchThe docs repo branch, i.e. docsBranch
      :pathThe path of the page source file, i.e. docsDir joins the relative path of the page file
    • Example:

    export default {
    +  theme: defaultTheme({
    +    docsRepo: "https://gitlab.com/owner/name",
    +    docsBranch: "master",
    +    docsDir: "docs",
    +    editLinkPattern: ":repo/-/edit/:branch/:path",
    +  }),
    +};
    +

    The generated link will look like 'https://gitlab.com/owner/name/-/edit/master/docs/path/to/file.md'.

    docsRepo

    • Type: string

    • Details:

      Specify the repository url of your documentation source files.

      This will be used for generating the edit this page link.

      If you don't set this option, it will use the repo option by default. But if your documentation source files are in a different repository, you will need to set this option.

    docsBranch

    • Type: string

    • Default: 'main'

    • Details:

      Specify the repository branch of your documentation source files.

      This will be used for generating the edit this page link.

    docsDir

    • Type: string

    • Default: ''

    • Details:

      Specify the directory of your documentation source files in the repository.

      This will be used for generating the edit this page link.

    lastUpdated

    `,13),nn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"boolean")])],-1),en=n("li",null,[n("p",null,[e("Default: "),n("code",null,"true")])],-1),an=n("p",null,"Details:",-1),sn=n("p",null,[e("Enable the "),n("em",null,"last updated timestamp"),e(" or not.")],-1),tn=n("code",null,"false",-1),ln=l('

    lastUpdatedText

    • Type: string

    • Default: 'Last Updated'

    • Details:

      Specify the text of the last updated timestamp label.

    contributors

    ',3),on=n("li",null,[n("p",null,[e("Type: "),n("code",null,"boolean")])],-1),pn=n("li",null,[n("p",null,[e("Default: "),n("code",null,"true")])],-1),cn=n("p",null,"Details:",-1),un=n("p",null,[e("Enable the "),n("em",null,"contributors list"),e(" or not.")],-1),dn=n("code",null,"false",-1),rn=l('

    contributorsText

    • Type: string

    • Default: 'Contributors'

    • Details:

      Specify the text of the contributors list label.

    tip

    ',3),hn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"string")])],-1),mn=n("li",null,[n("p",null,[e("Default: "),n("code",null,"'TIP'")])],-1),kn=n("p",null,"Details:",-1),bn=n("h3",{id:"warning",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#warning","aria-hidden":"true"},"#"),e(" warning")],-1),vn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"string")])],-1),fn=n("li",null,[n("p",null,[e("Default: "),n("code",null,"'WARNING'")])],-1),gn=n("p",null,"Details:",-1),_n=n("h3",{id:"danger",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#danger","aria-hidden":"true"},"#"),e(" danger")],-1),yn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"string")])],-1),xn=n("li",null,[n("p",null,[e("Default: "),n("code",null,"'DANGER'")])],-1),wn=n("p",null,"Details:",-1),qn=l('

    notFound

    • Type: string[]

    • Default: ['Not Found']

    • Details:

      Specify the messages of the 404 page.

      The message will be randomly picked from the array when users enter the 404 page.

    backToHome

    • Type: string

    • Default: 'Back to home'

    • Details:

      Specify the text of the back to home link in the 404 page.

    openInNewWindow

    ',5),Tn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"string")])],-1),Dn=n("li",null,[n("p",null,[e("Default: "),n("code",null,"'open in new window'")])],-1),Sn=n("p",null,"Details:",-1),En=n("code",null,"sr-only",-1),In=n("p",null,"This is mainly for a11y purpose.",-1),Cn=n("li",null,[n("p",null,"Also see:"),n("ul",null,[n("li",null,[n("a",{href:"#themeplugins-externallinkicon"},"Default Theme > Config Reference > themePlugins.externalLinkIcon")])])],-1),Ln=l('

    toggleColorMode

    toggleSidebar

    • Type: string

    • Default: 'toggle sidebar'

    • Details:

      Title text for sidebar toggle button.

      This is mainly for a11y purpose.

    Plugins Config

    themePlugins

    • Details:

      Configure the plugins that used by default theme.

      Default theme is using some plugins by default. You can disable a plugin if you really do not want to use it. Make sure you understand what the plugin is for before disabling it.

    ',8),Nn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"boolean")])],-1),An=n("li",null,[n("p",null,[e("Default: "),n("code",null,"true")])],-1),Gn=n("p",null,"Details:",-1),Pn=n("h3",{id:"themeplugins-backtotop",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-backtotop","aria-hidden":"true"},"#"),e(" themePlugins.backToTop")],-1),Rn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"boolean")])],-1),jn=n("li",null,[n("p",null,[e("Default: "),n("code",null,"true")])],-1),Mn=n("p",null,"Details:",-1),Bn=n("h3",{id:"themeplugins-container",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-container","aria-hidden":"true"},"#"),e(" themePlugins.container")],-1),zn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"Record")])],-1),Yn=n("p",null,"Details:",-1),Un=l("

    ContainerType type is:

    • tip
    • warning
    • danger
    • details
    • codeGroup
    • codeGroupItem
    ",2),Fn=n("p",null,"Also see:",-1),Vn=n("h3",{id:"themeplugins-externallinkicon",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-externallinkicon","aria-hidden":"true"},"#"),e(" themePlugins.externalLinkIcon")],-1),Hn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"boolean")])],-1),Wn=n("li",null,[n("p",null,[e("Default: "),n("code",null,"true")])],-1),On=n("p",null,"Details:",-1),Zn=n("h3",{id:"themeplugins-git",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-git","aria-hidden":"true"},"#"),e(" themePlugins.git")],-1),Xn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"boolean")])],-1),$n=n("li",null,[n("p",null,[e("Default: "),n("code",null,"true")])],-1),Jn=n("p",null,"Details:",-1),Kn=n("h3",{id:"themeplugins-mediumzoom",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-mediumzoom","aria-hidden":"true"},"#"),e(" themePlugins.mediumZoom")],-1),Qn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"boolean")])],-1),ne=n("li",null,[n("p",null,[e("Default: "),n("code",null,"true")])],-1),ee=n("p",null,"Details:",-1),ae=n("h3",{id:"themeplugins-nprogress",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#themeplugins-nprogress","aria-hidden":"true"},"#"),e(" themePlugins.nprogress")],-1),se=n("li",null,[n("p",null,[e("Type: "),n("code",null,"boolean")])],-1),te=n("li",null,[n("p",null,[e("Default: "),n("code",null,"true")])],-1),le=n("p",null,"Details:",-1);function oe(ie,pe){const i=o("NpmBadge"),s=o("RouterLink"),p=o("ExternalLinkIcon");return u(),d("div",null,[h,a(i,{package:"@vuepress/theme-default"}),m,n("ul",null,[k,b,n("li",null,[v,f,g,n("p",null,[e("This option will only take effect in default theme, so don't confuse with "),_,e(" in "),a(s,{to:"/reference/config.html#locales"},{default:t(()=>[e("Site Config")]),_:1}),e(".")])]),n("li",null,[y,n("ul",null,[n("li",null,[a(s,{to:"/guide/i18n.html"},{default:t(()=>[e("Guide > I18n")]),_:1})])])])]),x,n("ul",null,[w,q,n("li",null,[T,D,n("p",null,[e("If set to "),S,e(", the initial color mode will be automatically set according to "),n("a",E,[e("prefers-color-scheme"),a(p)]),e(".")])]),I]),C,n("ul",null,[n("li",null,[e("Also see: "),n("ul",null,[n("li",null,[a(s,{to:"/guide/assets.html#public-files"},{default:t(()=>[e("Guide > Assets > Public Files")]),_:1})])])])]),L,n("ul",null,[N,n("li",null,[A,G,n("p",null,[e("The "),P,e(" will appear next to the repository button in the navbar when you set multiple "),a(s,{to:"/reference/config.html#locales"},{default:t(()=>[e("locales")]),_:1}),e(" in your site config.")])])]),R,n("ul",null,[j,M,n("li",null,[B,z,n("p",null,[e("You can override this global option via "),a(s,{to:"/reference/default-theme/frontmatter.html#sidebar"},{default:t(()=>[e("sidebar")]),_:1}),e(" frontmatter in your pages.")]),Y]),U]),F,n("ul",null,[V,H,n("li",null,[W,n("p",null,[e("The max value depends on which levels of headers you have extracted via "),a(s,{to:"/reference/config.html#markdown-headers"},{default:t(()=>[e("markdown.headers.level")]),_:1}),e(".")]),O,n("p",null,[e("You can override this global option via "),a(s,{to:"/reference/default-theme/frontmatter.html#sidebardepth"},{default:t(()=>[e("sidebarDepth")]),_:1}),e(" frontmatter in your pages.")])])]),Z,n("ul",null,[X,$,n("li",null,[J,K,n("p",null,[e("You can override this global option via "),a(s,{to:"/reference/default-theme/frontmatter.html#editlink"},{default:t(()=>[e("editLink")]),_:1}),e(" frontmatter in your pages.")])])]),Q,n("ul",null,[nn,en,n("li",null,[an,sn,n("p",null,[e("You can override this global option via "),a(s,{to:"/reference/default-theme/frontmatter.html#lastupdated"},{default:t(()=>[e("lastUpdated")]),_:1}),e(" frontmatter in your pages. Notice that if you have already set this option to "),tn,e(", this feature will be disabled totally and could not be enabled in locales nor page frontmatter.")])])]),ln,n("ul",null,[on,pn,n("li",null,[cn,un,n("p",null,[e("You can override this global option via "),a(s,{to:"/reference/default-theme/frontmatter.html#contributors"},{default:t(()=>[e("contributors")]),_:1}),e(" frontmatter in your pages. Notice that if you have already set this option to "),dn,e(", this feature will be disabled totally and could not be enabled in locales nor page frontmatter.")])])]),rn,n("ul",null,[hn,mn,n("li",null,[kn,n("p",null,[e("Specify the default title of the tip "),a(s,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:t(()=>[e("custom containers")]),_:1}),e(".")])])]),bn,n("ul",null,[vn,fn,n("li",null,[gn,n("p",null,[e("Specify the default title of the warning "),a(s,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:t(()=>[e("custom containers")]),_:1}),e(".")])])]),_n,n("ul",null,[yn,xn,n("li",null,[wn,n("p",null,[e("Specify the default title of the danger "),a(s,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:t(()=>[e("custom containers")]),_:1}),e(".")])])]),qn,n("ul",null,[Tn,Dn,n("li",null,[Sn,n("p",null,[e("Specify the "),En,e(" text of the "),a(s,{to:"/reference/plugin/external-link-icon.html#externallinkicon"},{default:t(()=>[e("ExternalLinkIcon")]),_:1}),e(".")]),In]),Cn]),Ln,n("ul",null,[Nn,An,n("li",null,[Gn,n("p",null,[e("Enable "),a(s,{to:"/reference/plugin/active-header-links.html"},{default:t(()=>[e("@vuepress/plugin-active-header-links")]),_:1}),e(" or not.")])])]),Pn,n("ul",null,[Rn,jn,n("li",null,[Mn,n("p",null,[e("Enable "),a(s,{to:"/reference/plugin/back-to-top.html"},{default:t(()=>[e("@vuepress/plugin-back-to-top")]),_:1}),e(" or not.")])])]),Bn,n("ul",null,[zn,n("li",null,[Yn,n("p",null,[e("Enable custom containers that powered by "),a(s,{to:"/reference/plugin/container.html"},{default:t(()=>[e("@vuepress/plugin-container")]),_:1}),e(" or not.")]),Un]),n("li",null,[Fn,n("ul",null,[n("li",null,[a(s,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:t(()=>[e("Default Theme > Markdown > Custom Containers")]),_:1})])])])]),Vn,n("ul",null,[Hn,Wn,n("li",null,[On,n("p",null,[e("Enable "),a(s,{to:"/reference/plugin/external-link-icon.html"},{default:t(()=>[e("@vuepress/plugin-external-link-icon")]),_:1}),e(" or not.")])])]),Zn,n("ul",null,[Xn,$n,n("li",null,[Jn,n("p",null,[e("Enable "),a(s,{to:"/reference/plugin/git.html"},{default:t(()=>[e("@vuepress/plugin-git")]),_:1}),e(" or not.")])])]),Kn,n("ul",null,[Qn,ne,n("li",null,[ee,n("p",null,[e("Enable "),a(s,{to:"/reference/plugin/medium-zoom.html"},{default:t(()=>[e("@vuepress/plugin-medium-zoom")]),_:1}),e(" or not.")])])]),ae,n("ul",null,[se,te,n("li",null,[le,n("p",null,[e("Enable "),a(s,{to:"/reference/plugin/nprogress.html"},{default:t(()=>[e("@vuepress/plugin-nprogress")]),_:1}),e(" or not.")])])])])}const ue=c(r,[["render",oe],["__file","config.html.vue"]]);export{ue as default}; diff --git a/assets/configuration.html-0d5a74e7.js b/assets/configuration.html-0d5a74e7.js new file mode 100644 index 00000000..a85c743d --- /dev/null +++ b/assets/configuration.html-0d5a74e7.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-81f65e84","path":"/zh/guide/configuration.html","title":"配置","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:gear","description":"配置文件 如果没有任何配置,你的 VuePress 站点仅有一些最基础的功能。为了更好地自定义你的网站,让我们首先在你的文档目录下创建一个 .vuepress 目录,所有 VuePress 相关的文件都将会被放在这里。你的项目结构可能是这样: VuePress 站点的基本配置文件是 .vuepress/config.js ,但也同样支持 TypeScr...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/guide/configuration.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/guide/configuration.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"配置"}],["meta",{"property":"og:description","content":"配置文件 如果没有任何配置,你的 VuePress 站点仅有一些最基础的功能。为了更好地自定义你的网站,让我们首先在你的文档目录下创建一个 .vuepress 目录,所有 VuePress 相关的文件都将会被放在这里。你的项目结构可能是这样: VuePress 站点的基本配置文件是 .vuepress/config.js ,但也同样支持 TypeScr..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"配置\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"配置文件","slug":"配置文件","link":"#配置文件","children":[]},{"level":2,"title":"客户端配置文件","slug":"客户端配置文件","link":"#客户端配置文件","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.72,"words":517},"filePathRelative":"zh/guide/configuration.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/configuration.html-59431c6a.js b/assets/configuration.html-59431c6a.js new file mode 100644 index 00000000..84c16d2b --- /dev/null +++ b/assets/configuration.html-59431c6a.js @@ -0,0 +1,29 @@ +import{_ as t,W as c,X as l,$ as e,a0 as n,Y as i,Z as a,a1 as o,D as p}from"./framework-46b0e263.js";const r={},u=o(`

    Configuration

    Config File

    Without any configuration, the VuePress site is pretty minimal. To customize your site, let’s first create a .vuepress directory inside your docs directory. This is where all VuePress-specific files will be placed. Your project structure is probably like this:

    ├─ docs
    +│  ├─ .vuepress
    +│  │  └─ config.js
    +│  └─ README.md
    +├─ .gitignore
    +└─ package.json
    +

    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
    `,7),d=e("code",null,"--config",-1),f=o(`
    vuepress dev docs --config my-config.js
    +

    A basic config file looks like this:

    import { defineUserConfig } from "vuepress";
    +
    +export default defineUserConfig({
    +  lang: "en-US",
    +  title: "Hello VuePress",
    +  description: "Just playing around",
    +});
    +
    `,3),v={class:"hint-container tip"},g=e("p",{class:"hint-container-title"},"Tips",-1),k=o(`

    Client Config File

    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:

    ├─ docs
    +│  ├─ .vuepress
    +│  │  ├─ client.js   <--- client config file
    +│  │  └─ config.js   <--- config file
    +│  └─ README.md
    +├─ .gitignore
    +└─ package.json
    +

    Similarly, we also have a convention for client config file paths (in order of precedence):

    • In current working directory cwd:
      • vuepress.client.ts
      • vuepress.client.js
      • vuepress.client.mjs
    • In source directory sourceDir:
      • .vuepress/client.ts
      • .vuepress/client.js
      • .vuepress/client.mjs

    A basic client config file looks like this:

    import { defineClientConfig } from "@vuepress/client";
    +
    +export default defineClientConfig({
    +  enhance({ app, router, siteData }) {},
    +  setup() {},
    +  rootComponents: [],
    +});
    +
    `,7),m={class:"hint-container tip"},h=e("p",{class:"hint-container-title"},"Tips",-1),b=e("p",null,"Unlike config file, client config file could not be specified via CLI options.",-1);function _(y,w){const s=p("RouterLink");return c(),l("div",null,[u,e("p",null,[n("You can also specify the config file via "),d,n(" option of "),i(s,{to:"/reference/cli.html"},{default:a(()=>[n("CLI")]),_:1}),n(":")]),f,e("div",v,[g,e("p",null,[n("Check out the "),i(s,{to:"/reference/config.html"},{default:a(()=>[n("Config Reference")]),_:1}),n(" for a full list of VuePress config.")])]),k,e("div",m,[h,b,e("p",null,[n("To learn more about client config file, see "),i(s,{to:"/advanced/cookbook/usage-of-client-config.html"},{default:a(()=>[n("Advanced > Cookbook > Usage of Client Config")]),_:1})])])])}const C=t(r,[["render",_],["__file","configuration.html.vue"]]);export{C as default}; diff --git a/assets/configuration.html-782c9432.js b/assets/configuration.html-782c9432.js new file mode 100644 index 00000000..a7a10394 --- /dev/null +++ b/assets/configuration.html-782c9432.js @@ -0,0 +1,29 @@ +import{_ as o,W as c,X as l,$ as s,a0 as n,Y as a,Z as t,a1 as i,D as p}from"./framework-46b0e263.js";const d={},u=i(`

    配置

    配置文件

    如果没有任何配置,你的 VuePress 站点仅有一些最基础的功能。为了更好地自定义你的网站,让我们首先在你的文档目录下创建一个 .vuepress 目录,所有 VuePress 相关的文件都将会被放在这里。你的项目结构可能是这样:

    ├─ docs
    +│  ├─ .vuepress
    +│  │  └─ config.js
    +│  └─ README.md
    +├─ .gitignore
    +└─ package.json
    +

    VuePress 站点的基本配置文件是 .vuepress/config.js ,但也同样支持 TypeScript 配置文件。你可以使用 .vuepress/config.ts 来得到更好的类型提示。

    具体而言,我们对于配置文件的路径有着约定(按照优先顺序):

    • 当前工作目录 cwd 下:
      • vuepress.config.ts
      • vuepress.config.js
      • vuepress.config.mjs
    • 源文件目录 sourceDir 下:
      • .vuepress/config.ts
      • .vuepress/config.js
      • .vuepress/config.mjs
    `,7),r=s("code",null,"--config",-1),v=i(`
    vuepress dev docs --config my-config.js
    +

    一个基础的配置文件是这样的:

    import { defineUserConfig } from "vuepress";
    +
    +export default defineUserConfig({
    +  lang: "zh-CN",
    +  title: "你好, VuePress !",
    +  description: "这是我的第一个 VuePress 站点",
    +});
    +
    `,3),k={class:"hint-container tip"},m=s("p",{class:"hint-container-title"},"提示",-1),g=i(`

    客户端配置文件

    在大多数情况下,配置文件已经足够帮助你配置好你的 VuePress 站点。不过,有些时候用户们可能希望直接添加一些客户端代码。 VuePress 通过客户端配置文件来支持这种需求:

    ├─ docs
    +│  ├─ .vuepress
    +│  │  ├─ client.js   <--- 客户端配置文件
    +│  │  └─ config.js   <--- 配置文件
    +│  └─ README.md
    +├─ .gitignore
    +└─ package.json
    +

    同样的,我们也有关于客户端配置文件的路径约定(按照优先顺序):

    • 当前工作目录 cwd 下:
      • vuepress.client.ts
      • vuepress.client.js
      • vuepress.client.mjs
    • 源文件目录 sourceDir 下:
      • .vuepress/client.ts
      • .vuepress/client.js
      • .vuepress/client.mjs

    一个基础的客户端配置文件是这样的:

    import { defineClientConfig } from "@vuepress/client";
    +
    +export default defineClientConfig({
    +  enhance({ app, router, siteData }) {},
    +  setup() {},
    +  rootComponents: [],
    +});
    +
    `,7),h={class:"hint-container tip"},f=s("p",{class:"hint-container-title"},"提示",-1),b=s("p",null,"和配置文件不同,客户端配置文件不能通过命令行接口的选项来指定。",-1);function _(x,j){const e=p("RouterLink");return c(),l("div",null,[u,s("p",null,[n("你也可以通过 "),a(e,{to:"/zh/reference/cli.html"},{default:t(()=>[n("命令行接口")]),_:1}),n(" 的 "),r,n(" 选项来指定配置文件:")]),v,s("div",k,[m,s("p",null,[n("前往 "),a(e,{to:"/zh/reference/config.html"},{default:t(()=>[n("配置参考")]),_:1}),n(" 查看所有 VuePress 配置。")])]),g,s("div",h,[f,b,s("p",null,[n("可以前往 "),a(e,{to:"/zh/advanced/cookbook/usage-of-client-config.html"},{default:t(()=>[n("深入 > Cookbook > 客户端配置的使用方法")]),_:1}),n(" 来了解更多信息。")])])])}const V=o(d,[["render",_],["__file","configuration.html.vue"]]);export{V as default}; diff --git a/assets/configuration.html-8cfe2e2f.js b/assets/configuration.html-8cfe2e2f.js new file mode 100644 index 00000000..ed67bc9c --- /dev/null +++ b/assets/configuration.html-8cfe2e2f.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4f4ccb8f","path":"/guide/configuration.html","title":"Configuration","lang":"en-US","frontmatter":{"icon":"fa6-solid:gear","description":"Config File Without any configuration, the VuePress site is pretty minimal. To customize your site, let’s first create a .vuepress directory inside your docs directory. This is ...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/guide/configuration.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/guide/configuration.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Configuration"}],["meta",{"property":"og:description","content":"Config File Without any configuration, the VuePress site is pretty minimal. To customize your site, let’s first create a .vuepress directory inside your docs directory. This is ..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Configuration\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.11,"words":332},"filePathRelative":"guide/configuration.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/container.html-343c4b32.js b/assets/container.html-343c4b32.js new file mode 100644 index 00000000..9efb445c --- /dev/null +++ b/assets/container.html-343c4b32.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3df91977","path":"/reference/plugin/container.html","title":"container","lang":"en-US","frontmatter":{"description":"Register markdown custom containers in your VuePress site. This plugin simplifies the use of markdown-it-container (https://github.com/markdown-it/markdown-it-container), but al...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/plugin/container.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/plugin/container.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"container"}],["meta",{"property":"og:description","content":"Register markdown custom containers in your VuePress site. This plugin simplifies the use of markdown-it-container (https://github.com/markdown-it/markdown-it-container), but al..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"container\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Container Syntax","slug":"container-syntax","link":"#container-syntax","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"type","slug":"type","link":"#type","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]},{"level":3,"title":"before","slug":"before","link":"#before","children":[]},{"level":3,"title":"after","slug":"after","link":"#after","children":[]},{"level":3,"title":"render","slug":"render","link":"#render","children":[]},{"level":3,"title":"validate","slug":"validate","link":"#validate","children":[]},{"level":3,"title":"marker","slug":"marker","link":"#marker","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.51,"words":452},"filePathRelative":"reference/plugin/container.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/container.html-3cbbe523.js b/assets/container.html-3cbbe523.js new file mode 100644 index 00000000..eb6edc22 --- /dev/null +++ b/assets/container.html-3cbbe523.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-b10e9d30","path":"/zh/reference/plugin/container.html","title":"container","lang":"zh-CN","frontmatter":{"description":"为你的 VuePress 站点注册自定义容器。 该插件简化了 markdown-it-container (https://github.com/markdown-it/markdown-it-container) 的使用方法,但同时也保留了其原本的能力。 默认主题的 自定义容器 (../default-theme/markdown.md#自定义容器)...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/plugin/container.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/plugin/container.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"container"}],["meta",{"property":"og:description","content":"为你的 VuePress 站点注册自定义容器。 该插件简化了 markdown-it-container (https://github.com/markdown-it/markdown-it-container) 的使用方法,但同时也保留了其原本的能力。 默认主题的 自定义容器 (../default-theme/markdown.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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"container\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"容器语法","slug":"容器语法","link":"#容器语法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"type","slug":"type","link":"#type","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]},{"level":3,"title":"before","slug":"before","link":"#before","children":[]},{"level":3,"title":"after","slug":"after","link":"#after","children":[]},{"level":3,"title":"render","slug":"render","link":"#render","children":[]},{"level":3,"title":"validate","slug":"validate","link":"#validate","children":[]},{"level":3,"title":"marker","slug":"marker","link":"#marker","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.98,"words":594},"filePathRelative":"zh/reference/plugin/container.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/container.html-78c33ddf.js b/assets/container.html-78c33ddf.js new file mode 100644 index 00000000..e716ab8b --- /dev/null +++ b/assets/container.html-78c33ddf.js @@ -0,0 +1,42 @@ +import{_ as c,W as r,X as u,Y as s,$ as n,a0 as a,Z as p,a1 as o,D as t}from"./framework-46b0e263.js";const d={},k=n("h1",{id:"container",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#container","aria-hidden":"true"},"#"),a(" container")],-1),h=n("p",null,"Register markdown custom containers in your VuePress site.",-1),m={href:"https://github.com/markdown-it/markdown-it-container",target:"_blank",rel:"noopener noreferrer"},v=o(`

    Usage

    npm i -D @vuepress/plugin-container@next
    +
    import { containerPlugin } from "@vuepress/plugin-container";
    +
    +export default {
    +  plugins: [
    +    containerPlugin({
    +      // options
    +    }),
    +  ],
    +};
    +

    Container Syntax

    ::: <type> [info]
    +[content]
    +
    +:::
    +
    • The type is required and should be specified via type option.
    • The info is optional, and the default value can be specified via defaultInfo in locales option.
    • The content can be any valid markdown content.

    Tips

    This plugin can be used multiple times to support different types of containers.

    Options

    type

    `,9),f=n("li",null,[n("p",null,[a("Type: "),n("code",null,"string")])],-1),g=n("p",null,"Details:",-1),b=n("p",null,"The type of the container.",-1),_=n("code",null,"name",-1),y={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},w=o(`

    locales

    • Type: Record<string, { defaultInfo: string }>

    • Details:

      The default info of the container in different locales.

      If this option is not specified, the default info will fallback to the uppercase of the type option.

    • Example:

    export default {
    +  plugins: [
    +    containerPlugin({
    +      type: "tip",
    +      locales: {
    +        "/": {
    +          defaultInfo: "TIP",
    +        },
    +        "/zh/": {
    +          defaultInfo: "提示",
    +        },
    +      },
    +    }),
    +  ],
    +};
    +
    `,3),x=o(`

    before

    • Type: (info: string) => string

    • Default:

    (info: string): string =>
    +  \`<div class="custom-container \${type}">\${
    +    info ? \`<p class="custom-container-title">\${info}</p>\` : ""
    +  }\\n\`;
    +
    • Details:

      A function to render the starting tag of the container.

      The first param is the info part of container syntax.

      This option will not take effect if you don't specify the after option.

    after

    • Type: (info: string) => string

    • Default:

    (): string => "</div>\\n";
    +
    • Details:

      A function to render the ending tag of the container.

      The first param is the info part of container syntax.

      This option will not take effect if you don't specify the before option.

    render

    • Type:
    type MarkdownItContainerRenderFunction = (
    +  tokens: Token[],
    +  index: number,
    +  options: any,
    +  env: MarkdownEnv,
    +  self: Renderer
    +) => string;
    +
    `,11),T=n("p",null,"Details:",-1),q=n("code",null,"render",-1),I={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},D=n("p",null,[a("This plugin uses a default "),n("code",null,"render"),a(" function. If you specify this option, the default "),n("code",null,"render"),a(" function will be replaced, and the "),n("a",{href:"#locales"},"locales"),a(", "),n("a",{href:"#before"},"before"),a(" and "),n("a",{href:"#after"},"after"),a(" options will be ignored.")],-1),C=n("h3",{id:"validate",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#validate","aria-hidden":"true"},"#"),a(" validate")],-1),N=n("li",null,[n("p",null,[a("Type: "),n("code",null,"(params: string) => boolean")])],-1),R=n("p",null,"Details:",-1),B=n("code",null,"validate",-1),E={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},P=n("h3",{id:"marker",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#marker","aria-hidden":"true"},"#"),a(" marker")],-1),V=n("li",null,[n("p",null,[a("Type: "),n("code",null,"string")])],-1),L=n("p",null,"Details:",-1),$=n("code",null,"marker",-1),A={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"};function M(S,z){const l=t("NpmBadge"),e=t("ExternalLinkIcon"),i=t("RouterLink");return r(),u("div",null,[k,s(l,{package:"@vuepress/plugin-container"}),h,n("p",null,[a("This plugin simplifies the use of "),n("a",m,[a("markdown-it-container"),s(e)]),a(", but also retains its original capabilities.")]),n("p",null,[a("The "),s(i,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:p(()=>[a("Custom Containers")]),_:1}),a(" of default theme is powered by this plugin.")]),v,n("ul",null,[f,n("li",null,[g,b,n("p",null,[a("It will be used as the "),_,a(" param of "),n("a",y,[a("markdown-it-container"),s(e)]),a(".")])])]),w,n("ul",null,[n("li",null,[a("Also see: "),n("ul",null,[n("li",null,[s(i,{to:"/guide/i18n.html"},{default:p(()=>[a("Guide > I18n")]),_:1})])])])]),x,n("ul",null,[n("li",null,[T,n("p",null,[a("The "),q,a(" option of "),n("a",I,[a("markdown-it-container"),s(e)]),a(".")]),D])]),C,n("ul",null,[N,n("li",null,[R,n("p",null,[a("The "),B,a(" option of "),n("a",E,[a("markdown-it-container"),s(e)]),a(".")])])]),P,n("ul",null,[V,n("li",null,[L,n("p",null,[a("The "),$,a(" option of "),n("a",A,[a("markdown-it-container"),s(e)]),a(".")])])])])}const G=c(d,[["render",M],["__file","container.html.vue"]]);export{G as default}; diff --git a/assets/container.html-98692cc1.js b/assets/container.html-98692cc1.js new file mode 100644 index 00000000..cb4b0dbc --- /dev/null +++ b/assets/container.html-98692cc1.js @@ -0,0 +1,42 @@ +import{_ as c,W as r,X as u,Y as s,$ as n,a0 as a,Z as p,a1 as o,D as t}from"./framework-46b0e263.js";const d={},k=n("h1",{id:"container",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#container","aria-hidden":"true"},"#"),a(" container")],-1),h=n("p",null,"为你的 VuePress 站点注册自定义容器。",-1),v={href:"https://github.com/markdown-it/markdown-it-container",target:"_blank",rel:"noopener noreferrer"},m=o(`

    使用方法

    npm i -D @vuepress/plugin-container@next
    +
    import { containerPlugin } from "@vuepress/plugin-container";
    +
    +export default {
    +  plugins: [
    +    containerPlugin({
    +      // 配置项
    +    }),
    +  ],
    +};
    +

    容器语法

    ::: <type> [info]
    +[content]
    +
    +:::
    +
    • type 是必需的,应通过 type 配置项来指定。
    • info 是可选的,其默认值可以通过 localesdefaultInfo 配置项来指定。
    • content 可是任何合法的 Markdown 内容。

    提示

    该插件可以被多次使用,以便支持不同类型的容器。

    配置项

    type

    `,9),g=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string")])],-1),b=n("p",null,"详情:",-1),f=n("p",null,"容器的类型。",-1),_={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},y=n("code",null,"name",-1),w=o(`

    locales

    • 类型: Record<string, { defaultInfo: string }>

    • 详情:

      容器在不同 locales 下的默认 info

      如果没有指定该配置项,默认 info 会使用大写的 type

    • 示例:

    export default {
    +  plugins: [
    +    containerPlugin({
    +      type: "tip",
    +      locales: {
    +        "/": {
    +          defaultInfo: "TIP",
    +        },
    +        "/zh/": {
    +          defaultInfo: "提示",
    +        },
    +      },
    +    }),
    +  ],
    +};
    +
    `,3),x=o(`

    before

    • 类型: (info: string) => string

    • 默认值:

    (info: string): string =>
    +  \`<div class="custom-container \${type}">\${
    +    info ? \`<p class="custom-container-title">\${info}</p>\` : ""
    +  }\\n\`;
    +
    • 详情:

      一个用于渲染容器起始标签的函数。

      第一个参数是 容器语法info 部分。

      如果你没有设置 after 配置项,则该配置项也不会生效。

    after

    • 类型: (info: string) => string

    • 默认值:

    (): string => "</div>\\n";
    +
    • 详情:

      一个用于渲染容器结束标签的函数。

      第一个参数是 容器语法info 部分。

      如果你没有设置 before 配置项,则该配置项也不会生效。

    render

    • 类型:
    type MarkdownItContainerRenderFunction = (
    +  tokens: Token[],
    +  index: number,
    +  options: any,
    +  env: MarkdownEnv,
    +  self: Renderer
    +) => string;
    +
    `,11),E=n("p",null,"详情:",-1),q={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},A=n("code",null,"render",-1),B=n("p",null,[a("该插件使用了一个默认的 "),n("code",null,"render"),a(" 函数。但如果你指定了该配置项,那么默认的 "),n("code",null,"render"),a(" 函数就会被替换掉,此时 "),n("a",{href:"#locales"},"locales"),a(" 、 "),n("a",{href:"#before"},"before"),a(" 和 "),n("a",{href:"#after"},"after"),a(" 配置项都会被忽略。")],-1),I=n("h3",{id:"validate",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#validate","aria-hidden":"true"},"#"),a(" validate")],-1),N=n("li",null,[n("p",null,[a("类型: "),n("code",null,"(params: string) => boolean")])],-1),P=n("p",null,"详情:",-1),R={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},V=n("code",null,"validate",-1),D=n("h3",{id:"marker",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#marker","aria-hidden":"true"},"#"),a(" marker")],-1),L=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string")])],-1),$=n("p",null,"详情:",-1),z={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},C=n("code",null,"marker",-1);function F(M,T){const l=t("NpmBadge"),e=t("ExternalLinkIcon"),i=t("RouterLink");return r(),u("div",null,[k,s(l,{package:"@vuepress/plugin-container"}),h,n("p",null,[a("该插件简化了 "),n("a",v,[a("markdown-it-container"),s(e)]),a(" 的使用方法,但同时也保留了其原本的能力。")]),n("p",null,[a("默认主题的 "),s(i,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:p(()=>[a("自定义容器")]),_:1}),a(" 就是由该插件支持的。")]),m,n("ul",null,[g,n("li",null,[b,f,n("p",null,[a("它将会被用作 "),n("a",_,[a("markdown-it-container"),s(e)]),a(" 的 "),y,a(" 参数。")])])]),w,n("ul",null,[n("li",null,[a("参考: "),n("ul",null,[n("li",null,[s(i,{to:"/zh/guide/i18n.html"},{default:p(()=>[a("指南 > 多语言支持")]),_:1})])])])]),x,n("ul",null,[n("li",null,[E,n("p",null,[n("a",q,[a("markdown-it-container"),s(e)]),a(" 的 "),A,a(" 配置项。")]),B])]),I,n("ul",null,[N,n("li",null,[P,n("p",null,[n("a",R,[a("markdown-it-container"),s(e)]),a(" 的 "),V,a(" 配置项。")])])]),D,n("ul",null,[L,n("li",null,[$,n("p",null,[n("a",z,[a("markdown-it-container"),s(e)]),a(" 的 "),C,a(" 配置项。")])])])])}const W=c(d,[["render",F],["__file","container.html.vue"]]);export{W as default}; diff --git a/assets/contributing.html-4ed8de19.js b/assets/contributing.html-4ed8de19.js new file mode 100644 index 00000000..65e3afd9 --- /dev/null +++ b/assets/contributing.html-4ed8de19.js @@ -0,0 +1,4 @@ +import{_ as d,W as r,X as i,$ as o,a0 as e,Y as s,a1 as n,D as a}from"./framework-46b0e263.js";const c={},l=o("h1",{id:"contributing-guide",tabindex:"-1"},[o("a",{class:"header-anchor",href:"#contributing-guide","aria-hidden":"true"},"#"),e(" Contributing Guide")],-1),p=o("h2",{id:"overview",tabindex:"-1"},[o("a",{class:"header-anchor",href:"#overview","aria-hidden":"true"},"#"),e(" Overview")],-1),h={href:"https://en.wikipedia.org/wiki/Monorepo",target:"_blank",rel:"noopener noreferrer"},u={href:"https://pnpm.io/workspaces",target:"_blank",rel:"noopener noreferrer"},m=n('

    In the packages directory:

    • bundler-vite: The VuePress bundler package with vite. Use vite to dev and build VuePress app that generated by @vuepress/core.
    • bundler-webpack: The VuePress bundler package with webpack. Use webpack to dev and build VuePress app that generated by @vuepress/core.
    • cli: The VuePress command line interface (CLI) package. It will resolve user config file, and create VuePress app with @vuepress/core, then execute corresponding command.
    • client: The VuePress client package. Provides the client entry, and exports types and composable utils that can be used in client side development.
    • core: The VuePress core. Provides pure Node API to generate VuePress app, including page handling, plugin system and data preparation.
    • markdown: The VuePress markdown package. Use markdown-it as the markdown parser and integrate some plugins to be used in VuePress.
    • shared: Utilities that shared between node side and client side.
    • utils: Utilities that should only be used in node side.

    In the ecosystem directory:

    • plugin-${name}: Official plugins.
    • theme-default: The default theme.
    • vuepress: A wrapper of vuepress-vite.
    • vuepress-vite: A wrapper of @vuepress/cli + @vuepress/bundler-vite + @vuepress/theme-default. If users want to use default theme with vite, they can simply install this package.
    • vuepress-webpack: A wrapper of @vuepress/cli + @vuepress/bundler-webpack + @vuepress/theme-default. If users want to use default theme with webpack, they can simply install this package.

    Development Setup

    Pre-requirement:

    ',6),b={href:"http://nodejs.org",target:"_blank",rel:"noopener noreferrer"},f=o("strong",null,"version 14.18.0+",-1),v={href:"https://pnpm.io/",target:"_blank",rel:"noopener noreferrer"},g=o("strong",null,"version 7+",-1),_=n(`

    Clone the repo, and install dependencies:

    pnpm install
    +

    Build source code:

    pnpm build
    +

    Start developing the documentation site:

    pnpm docs:dev
    +

    Main tools that used in this project:

    `,7),w={href:"https://www.typescriptlang.org/",target:"_blank",rel:"noopener noreferrer"},k={href:"https://vitest.dev/",target:"_blank",rel:"noopener noreferrer"},y={href:"https://eslint.org/",target:"_blank",rel:"noopener noreferrer"},x={href:"https://prettier.io/",target:"_blank",rel:"noopener noreferrer"},P=n('

    Scripts

    pnpm build

    The build script uses tsc and tsup to compile TypeScript source files to JavaScript dist files.

    Also, it will copy necessary resources from source directory to dist directory, because some source files (e.g. .vue, .css files) would not be processed by tsc nor tsup, but should keep the same relative path in the dist directory.

    You may need to run this script first after your clone this repository, because the dist files are ignored by .gitignore.

    pnpm clean

    The clean script runs clean script in all packages, cleaning all the dist files and caches. In other words, it will remove all the files that generated by build, copy scripts.

    It's used before you want to re-build source files from a clean / initial state.

    pnpm docs:*

    pnpm docs:build, pnpm docs:dev, pnpm docs:clean

    The docs: prefix indicates that these scripts are for documentation, i.e. the docs directory.

    VuePress is using itself to build its own documentation site.

    You need to run pnpm build to build VuePress source files first, then run these docs: scripts to develop and build our documentation.

    pnpm docs:serve

    Serve the documentation site locally.

    You need to run pnpm docs:build first to generate the documentation dist files, and then run pnpm docs:serve to serve them.

    pnpm lint

    The lint script uses ESLint to check all source files.

    pnpm test

    The test script uses Vitest to run unit testings.

    Documentation

    VuePress documentation is powered by VuePress itself, which is built from the source code of this repository.

    All the markdown source files are placed in docs directory. We are maintaining two translations:

    • English (en-US) in / path
    • Chinese (zh-CN) in /zh/ path

    We have two different deployments:

    ',25),V={href:"https://www.netlify.com",target:"_blank",rel:"noopener noreferrer"},T={href:"https://v2.vuepress.vuejs.org",target:"_blank",rel:"noopener noreferrer"},I={href:"https://pages.github.com",target:"_blank",rel:"noopener noreferrer"},S={href:"https://vuepress.github.io",target:"_blank",rel:"noopener noreferrer"};function N(A,C){const t=a("ExternalLinkIcon");return r(),i("div",null,[l,p,o("p",null,[e("This repository employs a "),o("a",h,[e("monorepo"),s(t)]),e(" setup with "),o("a",u,[e("pnpm workspaces"),s(t)]),e(", and hosts a number of associated but separated packages.")]),m,o("ul",null,[o("li",null,[o("a",b,[e("Node.js"),s(t)]),e(),f]),o("li",null,[o("a",v,[e("pnpm"),s(t)]),e(),g])]),_,o("ul",null,[o("li",null,[o("a",w,[e("TypeScript"),s(t)]),e(" as the development language")]),o("li",null,[o("a",k,[e("Vitest"),s(t)]),e(" for unit testing")]),o("li",null,[o("a",y,[e("ESLint"),s(t)]),e(" + "),o("a",x,[e("Prettier"),s(t)]),e(" for code linting and formatting")])]),P,o("ul",null,[o("li",null,[e("Release deployment powered by "),o("a",V,[e("Netlify"),s(t)]),e(". This deployment is built from the latest released version, so users will not see unreleased changes. The domain name is "),o("a",T,[e("https://v2.vuepress.vuejs.org"),s(t)]),e(".")]),o("li",null,[e("Developer deployment powered by "),o("a",I,[e("GitHub Pages"),s(t)]),e(". This deployment is built from the latest commit, so developers could preview the latest changes. The domain name is "),o("a",S,[e("https://vuepress.github.io"),s(t)]),e(".")])])])}const U=d(c,[["render",N],["__file","contributing.html.vue"]]);export{U as default}; diff --git a/assets/contributing.html-6dc0f72e.js b/assets/contributing.html-6dc0f72e.js new file mode 100644 index 00000000..2e60f250 --- /dev/null +++ b/assets/contributing.html-6dc0f72e.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-e012c1f2","path":"/zh/contributing.html","title":"贡献指南","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:signs-post","sidebar":"auto","description":"概览 项目仓库借助于 pnpm 工作空间 (https://pnpm.io/zh/workspaces) 来实现 Monorepo (https://en.wikipedia.org/wiki/Monorepo) ,存放了多个互相关联的独立 Package 。 在 packages 目录下: bundler-vite: 基于 Vite 的 Bundle...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/contributing.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/contributing.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"贡献指南"}],["meta",{"property":"og:description","content":"概览 项目仓库借助于 pnpm 工作空间 (https://pnpm.io/zh/workspaces) 来实现 Monorepo (https://en.wikipedia.org/wiki/Monorepo) ,存放了多个互相关联的独立 Package 。 在 packages 目录下: bundler-vite: 基于 Vite 的 Bundle..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"贡献指南\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"概览","slug":"概览","link":"#概览","children":[]},{"level":2,"title":"开发配置","slug":"开发配置","link":"#开发配置","children":[]},{"level":2,"title":"开发脚本","slug":"开发脚本","link":"#开发脚本","children":[{"level":3,"title":"pnpm build","slug":"pnpm-build","link":"#pnpm-build","children":[]},{"level":3,"title":"pnpm clean","slug":"pnpm-clean","link":"#pnpm-clean","children":[]},{"level":3,"title":"pnpm docs:*","slug":"pnpm-docs","link":"#pnpm-docs","children":[]},{"level":3,"title":"pnpm lint","slug":"pnpm-lint","link":"#pnpm-lint","children":[]},{"level":3,"title":"pnpm test","slug":"pnpm-test","link":"#pnpm-test","children":[]}]},{"level":2,"title":"文档","slug":"文档","link":"#文档","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":3.46,"words":1038},"filePathRelative":"zh/contributing.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/contributing.html-e03745b5.js b/assets/contributing.html-e03745b5.js new file mode 100644 index 00000000..15cb7b17 --- /dev/null +++ b/assets/contributing.html-e03745b5.js @@ -0,0 +1,4 @@ +import{_ as r,W as a,X as s,$ as o,a0 as e,Y as n,a1 as c,D as t}from"./framework-46b0e263.js";const i={},p=o("h1",{id:"贡献指南",tabindex:"-1"},[o("a",{class:"header-anchor",href:"#贡献指南","aria-hidden":"true"},"#"),e(" 贡献指南")],-1),l=o("h2",{id:"概览",tabindex:"-1"},[o("a",{class:"header-anchor",href:"#概览","aria-hidden":"true"},"#"),e(" 概览")],-1),h={href:"https://pnpm.io/zh/workspaces",target:"_blank",rel:"noopener noreferrer"},u={href:"https://en.wikipedia.org/wiki/Monorepo",target:"_blank",rel:"noopener noreferrer"},b=c('

    packages 目录下:

    • bundler-vite: 基于 Vite 的 Bundler 模块。使用 Vite 对 VuePress App 执行 devbuild 操作。
    • bundler-webpack: 基于 Webpack 的 Bundler 模块。使用 Webpack 对 VuePress App 执行 devbuild 操作。
    • cli: 命令行接口 (CLI) 模块。包含解析用户配置文件、调用 @vuepress/core 创建 VuePress App 、执行对应命令等功能。
    • client: Client 模块。包含客户端页面入口,并提供了客户端开发时可以用到的类型和工具函数。
    • core: Core 模块。提供 Node API 来创建 VuePress App ,包括页面逻辑、插件系统、数据准备等功能。
    • markdown: Markdown 模块。使用 markdown-it 作为 Markdown 解析器,并集成了一些 VuePress 中用到的插件。
    • shared: 既可以在 Node 端使用、也可以在客户端使用的工具函数模块。
    • utils: 仅可以在 Node 端使用的工具函数模块。

    ecosystem 目录下:

    • plugin-${name}: 官方插件。
    • theme-default: 默认主题。
    • vuepress: 是 vuepress-vite 的封装。
    • vuepress-vite: 是 @vuepress/cli + @vuepress/bundler-vite + @vuepress/theme-default 的封装。如果用户想使用 默认主题 + Vite ,仅安装这个 Package 就可以了。
    • vuepress-webpack: 是 @vuepress/cli + @vuepress/bundler-webpack + @vuepress/theme-default 的封装。如果用户想使用 默认主题 + Webpack ,仅安装这个 Package 就可以了。

    开发配置

    开发要求:

    ',6),m={href:"http://nodejs.org",target:"_blank",rel:"noopener noreferrer"},_=o("strong",null,"version 14.18.0+",-1),v={href:"https://pnpm.io/zh/",target:"_blank",rel:"noopener noreferrer"},f=o("strong",null,"version 7+",-1),g=c(`

    克隆代码仓库,并安装依赖:

    pnpm install
    +

    构建源代码:

    pnpm build
    +

    开始开发项目文档网站:

    pnpm docs:dev
    +

    本项目开发使用的一些主要工具:

    `,7),k={href:"https://www.typescriptlang.org/",target:"_blank",rel:"noopener noreferrer"},x={href:"https://vitest.dev/",target:"_blank",rel:"noopener noreferrer"},V={href:"https://eslint.org/",target:"_blank",rel:"noopener noreferrer"},w={href:"https://prettier.io/",target:"_blank",rel:"noopener noreferrer"},P=c('

    开发脚本

    pnpm build

    build 命令会使用 tsctsup 将 TypeScript 源文件编译为 JavaScript 文件。

    此外,它还会将必要的资源文件从源文件目录复制到输出目录。这是因为一些资源文件不会被 tsctsup 处理,但它们仍需要被放置到输出目录,并保持它们的项目对路径不变。

    你在克隆代码仓库后,可能需要先执行该命令来确保项目代码可以顺利运行,因为编译后的输出目录被 .gitignore 排除在仓库以外了。

    pnpm clean

    clean 命令会执行所有子 Package 中的 clean 命令,清除所有的输出文件目录和缓存文件。换言之,它将移除所有通过 buildcopy 命令生成的文件。

    当你想要从最初状态重新构建源代码时,你可以执行该命令。

    pnpm docs:*

    pnpm docs:build, pnpm docs:dev, pnpm docs:clean

    docs: 前缀表明,这些命令是针对文档 (documentation) 进行操作的,即 docs 目录。

    VuePress 使用它自己来构建自己的文档网站。

    你需要先执行 pnpm build 来构建 VuePress 源代码,然后再运行这些 docs: 开头的命令来开发或构建文档。

    pnpm docs:serve

    在本地启动文档网站服务器。

    你需要先运行 pnpm docs:build 来生成文档网站的输出文件,然后再通过该命令来启动文档网站。

    pnpm lint

    lint 命令使用 ESLint 来检查所有源文件。

    pnpm test

    test 命令使用 Vitest 来运行单元测试。

    文档

    VuePress 的文档是由 VuePress 自己驱动的,是由该仓库中的源码构建而来。

    所有的 Markdown 源文件都放置在 docs 目录下。我们维护了两种翻译:

    • 英语 (en-US) 在 / 路径下
    • 中文 (zh-CN) 在 /zh/ 路径下

    我们部署了两套站点:

    ',25),N={href:"https://www.netlify.com",target:"_blank",rel:"noopener noreferrer"},y={href:"https://v2.vuepress.vuejs.org",target:"_blank",rel:"noopener noreferrer"},S={href:"https://pages.github.com",target:"_blank",rel:"noopener noreferrer"},A={href:"https://vuepress.github.io",target:"_blank",rel:"noopener noreferrer"};function B(C,E){const d=t("ExternalLinkIcon");return a(),s("div",null,[p,l,o("p",null,[e("项目仓库借助于 "),o("a",h,[e("pnpm 工作空间"),n(d)]),e(" 来实现 "),o("a",u,[e("Monorepo"),n(d)]),e(" ,存放了多个互相关联的独立 Package 。")]),b,o("ul",null,[o("li",null,[o("a",m,[e("Node.js"),n(d)]),e(),_]),o("li",null,[o("a",v,[e("pnpm"),n(d)]),e(),f])]),g,o("ul",null,[o("li",null,[o("a",k,[e("TypeScript"),n(d)]),e(" 作为开发语言")]),o("li",null,[o("a",x,[e("Vitest"),n(d)]),e(" 用于单元测试")]),o("li",null,[o("a",V,[e("ESLint"),n(d)]),e(" + "),o("a",w,[e("Prettier"),n(d)]),e(" 用于代码检查和格式化")])]),P,o("ul",null,[o("li",null,[e("在 "),o("a",N,[e("Netlify"),n(d)]),e(" 部署的 Release 版本。该站点是从最新发布的版本中构建而来,因此用户不会看到未发布的改动。域名为 "),o("a",y,[e("https://v2.vuepress.vuejs.org"),n(d)]),e("。")]),o("li",null,[e("在 "),o("a",S,[e("GitHub Pages"),n(d)]),e(" 部署的 Developer 版本。该站点是从最新的提交中构建而来,因此开发者可以预览最新的改动。域名为 "),o("a",A,[e("https://vuepress.github.io"),n(d)]),e("。")])])])}const M=r(i,[["render",B],["__file","contributing.html.vue"]]);export{M as default}; diff --git a/assets/contributing.html-f20968df.js b/assets/contributing.html-f20968df.js new file mode 100644 index 00000000..aa0c809b --- /dev/null +++ b/assets/contributing.html-f20968df.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6ce48554","path":"/contributing.html","title":"Contributing Guide","lang":"en-US","frontmatter":{"icon":"fa6-solid:signs-post","sidebar":"auto","description":"Overview This repository employs a monorepo (https://en.wikipedia.org/wiki/Monorepo) setup with pnpm workspaces (https://pnpm.io/workspaces), and hosts a number of associated bu...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/contributing.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/contributing.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Contributing Guide"}],["meta",{"property":"og:description","content":"Overview This repository employs a monorepo (https://en.wikipedia.org/wiki/Monorepo) setup with pnpm workspaces (https://pnpm.io/workspaces), and hosts a number of associated bu..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Contributing Guide\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Overview","slug":"overview","link":"#overview","children":[]},{"level":2,"title":"Development Setup","slug":"development-setup","link":"#development-setup","children":[]},{"level":2,"title":"Scripts","slug":"scripts","link":"#scripts","children":[{"level":3,"title":"pnpm build","slug":"pnpm-build","link":"#pnpm-build","children":[]},{"level":3,"title":"pnpm clean","slug":"pnpm-clean","link":"#pnpm-clean","children":[]},{"level":3,"title":"pnpm docs:*","slug":"pnpm-docs","link":"#pnpm-docs","children":[]},{"level":3,"title":"pnpm lint","slug":"pnpm-lint","link":"#pnpm-lint","children":[]},{"level":3,"title":"pnpm test","slug":"pnpm-test","link":"#pnpm-test","children":[]}]},{"level":2,"title":"Documentation","slug":"documentation","link":"#documentation","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":2.34,"words":702},"filePathRelative":"contributing.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/deployment.html-24cc7f5b.js b/assets/deployment.html-24cc7f5b.js new file mode 100644 index 00000000..1e67119e --- /dev/null +++ b/assets/deployment.html-24cc7f5b.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4a7b6bf9","path":"/zh/guide/deployment.html","title":"部署","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:rocket","description":"下述的指南基于以下条件: Markdown 源文件放置在你项目的 docs 目录;; 使用的是默认的构建输出目录 (.vuepress/dist) ;; 使用 pnpm (https://pnpm.io/zh/) 作为包管理器,当然也支持使用 npm 或 yarn 。; VuePress 作为项目依赖安装,并在 package.json 中配置了如下脚...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/guide/deployment.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/guide/deployment.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"部署"}],["meta",{"property":"og:description","content":"下述的指南基于以下条件: Markdown 源文件放置在你项目的 docs 目录;; 使用的是默认的构建输出目录 (.vuepress/dist) ;; 使用 pnpm (https://pnpm.io/zh/) 作为包管理器,当然也支持使用 npm 或 yarn 。; VuePress 作为项目依赖安装,并在 package.json 中配置了如下脚..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"部署\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":[]},{"level":2,"title":"云开发 CloudBase","slug":"云开发-cloudbase","link":"#云开发-cloudbase","children":[]},{"level":2,"title":"21 云盒子","slug":"_21-云盒子","link":"#_21-云盒子","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":4.36,"words":1309},"filePathRelative":"zh/guide/deployment.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/deployment.html-355f7597.js b/assets/deployment.html-355f7597.js new file mode 100644 index 00000000..4cc71223 --- /dev/null +++ b/assets/deployment.html-355f7597.js @@ -0,0 +1,101 @@ +import{_ as c,W as p,X as u,$ as n,a0 as s,Y as e,Z as l,a1 as t,D as i}from"./framework-46b0e263.js";const r={},d=n("h1",{id:"deployment",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#deployment","aria-hidden":"true"},"#"),s(" Deployment")],-1),k=n("p",null,"The following guides are based on some shared assumptions:",-1),m=n("li",null,[s("You are placing your Markdown source files inside the "),n("code",null,"docs"),s(" directory of your project;")],-1),v=n("li",null,[s("You are using the default build output location ("),n("code",null,".vuepress/dist"),s(");")],-1),h={href:"https://pnpm.io",target:"_blank",rel:"noopener noreferrer"},b=n("li",null,[s("VuePress is installed as a local dependency in your project, and you have setup the following script in "),n("code",null,"package.json"),s(":")],-1),g=t(`
    {
    +  "scripts": {
    +    "docs:build": "vuepress build docs"
    +  }
    +}
    +

    GitHub Pages

    `,2),_=t("

    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),f={href:"https://github.com/features/actions",target:"_blank",rel:"noopener noreferrer"},y=n("p",null,[s("Create "),n("code",null,".github/workflows/docs.yml"),s(" to set up the workflow.")],-1),w=t(`
    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@v3
    +        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: 7
    +          # install deps with pnpm
    +          run_install: true
    +
    +      - name: Setup Node.js
    +        uses: actions/setup-node@v3
    +        with:
    +          # choose node.js version to use
    +          node-version: 18
    +          # 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@v2
    +        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 }}
    +
    `,1),E={class:"hint-container tip"},q=n("p",{class:"hint-container-title"},"Tips",-1),j={href:"https://pages.github.com/",target:"_blank",rel:"noopener noreferrer"},x=n("h2",{id:"gitlab-pages",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#gitlab-pages","aria-hidden":"true"},"#"),s(" GitLab Pages")],-1),R=t("

    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),P=n("code",null,".gitlab-ci.yml",-1),I={href:"https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/",target:"_blank",rel:"noopener noreferrer"},N=t(`
    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 -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7
    +    - 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
    +
    `,1),S={class:"hint-container tip"},C=n("p",{class:"hint-container-title"},"Tips",-1),O={href:"https://docs.gitlab.com/ce/user/project/pages/#getting-started",target:"_blank",rel:"noopener noreferrer"},H=n("h2",{id:"google-firebase",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#google-firebase","aria-hidden":"true"},"#"),s(" Google Firebase")],-1),G={href:"https://www.npmjs.com/package/firebase-tools",target:"_blank",rel:"noopener noreferrer"},T=n("li",null,[n("p",null,[s("Create "),n("code",null,"firebase.json"),s(" and "),n("code",null,".firebaserc"),s(" at the root of your project with the following content:")])],-1),U=t(`

    firebase.json:

    {
    +  "hosting": {
    +    "public": "./docs/.vuepress/dist",
    +    "ignore": []
    +  }
    +}
    +

    .firebaserc:

    {
    +  "projects": {
    +    "default": "<YOUR_FIREBASE_ID>"
    +  }
    +}
    +
    1. After running pnpm docs:build, deploy using the command firebase deploy.
    `,5),V={class:"hint-container tip"},A=n("p",{class:"hint-container-title"},"Tips",-1),M={href:"https://firebase.google.com/docs/cli",target:"_blank",rel:"noopener noreferrer"},L=n("h2",{id:"heroku",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#heroku","aria-hidden":"true"},"#"),s(" Heroku")],-1),B={href:"https://devcenter.heroku.com/articles/heroku-cli",target:"_blank",rel:"noopener noreferrer"},D={href:"https://signup.heroku.com",target:"_blank",rel:"noopener noreferrer"},Y=n("li",null,[n("p",null,[s("Run "),n("code",null,"heroku login"),s(" and fill in your Heroku credentials:")])],-1),F=t(`
    heroku login
    +
    1. Create a file called static.json in the root of your project with the below content:

    static.json:

    {
    +  "root": "./docs/.vuepress/dist"
    +}
    +
    `,4),K={href:"https://github.com/heroku/heroku-buildpack-static",target:"_blank",rel:"noopener noreferrer"},z=n("h2",{id:"kinsta",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#kinsta","aria-hidden":"true"},"#"),s(" Kinsta")],-1),W={href:"https://kinsta.com/docs/vuepress-application/",target:"_blank",rel:"noopener noreferrer"},$=n("h2",{id:"edgio",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#edgio","aria-hidden":"true"},"#"),s(" Edgio")],-1),X={href:"https://docs.edg.io/guides/vuepress",target:"_blank",rel:"noopener noreferrer"},Z=n("h2",{id:"netlify",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#netlify","aria-hidden":"true"},"#"),s(" Netlify")],-1),J={href:"https://netlify.com",target:"_blank",rel:"noopener noreferrer"},Q=n("ul",null,[n("li",null,[n("strong",null,"Build Command:"),s(),n("code",null,"pnpm docs:build")]),n("li",null,[n("strong",null,"Publish directory:"),s(),n("code",null,"docs/.vuepress/dist")])],-1),nn={href:"https://docs.netlify.com/configure-builds/environment-variables",target:"_blank",rel:"noopener noreferrer"},sn=n("ul",null,[n("li",null,[n("code",null,"NODE_VERSION"),s(": 14")])],-1),en=n("li",null,[n("p",null,"Hit the deploy button.")],-1),an=n("h2",{id:"vercel",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vercel","aria-hidden":"true"},"#"),s(" Vercel")],-1),tn={href:"https://vercel.com",target:"_blank",rel:"noopener noreferrer"},on=n("ul",null,[n("li",null,[n("strong",null,"FRAMEWORK PRESET:"),s(),n("code",null,"Other")]),n("li",null,[n("strong",null,"BUILD COMMAND:"),s(),n("code",null,"pnpm docs:build")]),n("li",null,[n("strong",null,"OUTPUT DIRECTORY:"),s(),n("code",null,"docs/.vuepress/dist")])],-1),ln=n("li",null,[n("p",null,"Hit the deploy button.")],-1);function cn(pn,un){const a=i("ExternalLinkIcon"),o=i("RouterLink");return p(),u("div",null,[d,k,n("ul",null,[m,v,n("li",null,[s("You are using as "),n("a",h,[s("pnpm"),e(a)]),s(" package manager, while npm and yarn are also supported;")]),b]),g,n("ol",null,[n("li",null,[n("p",null,[s("Set the correct "),e(o,{to:"/reference/config.html#base"},{default:l(()=>[s("base")]),_:1}),s(" config.")]),_]),n("li",null,[n("p",null,[s("Choose your preferred CI tools. Here we take "),n("a",f,[s("GitHub Actions"),e(a)]),s(" as an example.")]),y])]),w,n("div",E,[q,n("p",null,[s("Please refer to "),n("a",j,[s("GitHub Pages official guide"),e(a)]),s(" for more details.")])]),x,n("ol",null,[n("li",null,[n("p",null,[s("Set the correct "),e(o,{to:"/reference/config.html#base"},{default:l(()=>[s("base")]),_:1}),s(" config.")]),R]),n("li",null,[n("p",null,[s("Create "),P,s(" to set up "),n("a",I,[s("GitLab CI"),e(a)]),s(" workflow.")])])]),N,n("div",S,[C,n("p",null,[s("Please refer to "),n("a",O,[s("GitLab Pages official guide"),e(a)]),s(" for more details.")])]),H,n("ol",null,[n("li",null,[n("p",null,[s("Make sure you have "),n("a",G,[s("firebase-tools"),e(a)]),s(" installed.")])]),T]),U,n("div",V,[A,n("p",null,[s("Please refer to "),n("a",M,[s("Firebase CLI official guide"),e(a)]),s(" for more details.")])]),L,n("ol",null,[n("li",null,[n("p",null,[s("Install "),n("a",B,[s("Heroku CLI"),e(a)]),s(".")])]),n("li",null,[n("p",null,[s("Create a Heroku account by "),n("a",D,[s("signing up"),e(a)]),s(".")])]),Y]),F,n("p",null,[s("This is the configuration of your site; read more at "),n("a",K,[s("heroku-buildpack-static"),e(a)]),s(".")]),z,n("p",null,[s("See "),n("a",W,[s("Set Up VuePress on Kinsta"),e(a)]),s(".")]),$,n("p",null,[s("See "),n("a",X,[s("Edgio Documentation > Framework Guides > VuePress"),e(a)]),s(".")]),Z,n("ol",null,[n("li",null,[n("p",null,[s("On "),n("a",J,[s("Netlify"),e(a)]),s(", set up a new project from GitHub with the following settings:")]),Q]),n("li",null,[n("p",null,[s("Set "),n("a",nn,[s("Environment variables"),e(a)]),s(" to choose node version:")]),sn]),en]),an,n("ol",null,[n("li",null,[n("p",null,[s("Go to "),n("a",tn,[s("Vercel"),e(a)]),s(", set up a new project from GitHub with the following settings:")]),on]),ln])])}const dn=c(r,[["render",cn],["__file","deployment.html.vue"]]);export{dn as default}; diff --git a/assets/deployment.html-69247d56.js b/assets/deployment.html-69247d56.js new file mode 100644 index 00000000..c323f336 --- /dev/null +++ b/assets/deployment.html-69247d56.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-e8a66a70","path":"/guide/deployment.html","title":"Deployment","lang":"en-US","frontmatter":{"icon":"fa6-solid:rocket","description":"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 default build...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/guide/deployment.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/guide/deployment.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Deployment"}],["meta",{"property":"og:description","content":"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 default build..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Deployment\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":2.63,"words":788},"filePathRelative":"guide/deployment.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/deployment.html-868cba60.js b/assets/deployment.html-868cba60.js new file mode 100644 index 00000000..52f39f4e --- /dev/null +++ b/assets/deployment.html-868cba60.js @@ -0,0 +1,104 @@ +import{_ as c,W as p,X as u,$ as n,a0 as s,Y as e,Z as o,a2 as r,a1 as t,D as i}from"./framework-46b0e263.js";const d={},k=n("h1",{id:"部署",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#部署","aria-hidden":"true"},"#"),s(" 部署")],-1),v=n("p",null,"下述的指南基于以下条件:",-1),m=n("li",null,[s("Markdown 源文件放置在你项目的 "),n("code",null,"docs"),s(" 目录;")],-1),h=n("li",null,[s("使用的是默认的构建输出目录 ("),n("code",null,".vuepress/dist"),s(") ;")],-1),b={href:"https://pnpm.io/zh/",target:"_blank",rel:"noopener noreferrer"},_=n("li",null,[s("VuePress 作为项目依赖安装,并在 "),n("code",null,"package.json"),s(" 中配置了如下脚本:")],-1),g=t(`
    {
    +  "scripts": {
    +    "docs:build": "vuepress build docs"
    +  }
    +}
    +

    GitHub Pages

    `,2),f=t("

    如果你准备发布到 https://<USERNAME>.github.io/ ,你可以省略这一步,因为 base 默认就是 "/"

    如果你准备发布到 https://<USERNAME>.github.io/<REPO>/ ,也就是说你的仓库地址是 https://github.com/<USERNAME>/<REPO> ,则将 base 设置为 "/<REPO>/"

    ",2),y={href:"https://github.com/features/actions",target:"_blank",rel:"noopener noreferrer"},E=n("p",null,[s("创建 "),n("code",null,".github/workflows/docs.yml"),s(" 文件来配置工作流。")],-1),q=t(`
    点击展开配置样例
    name: docs
    +
    +on:
    +  # 每当 push 到 main 分支时触发部署
    +  push:
    +    branches: [main]
    +  # 手动触发部署
    +  workflow_dispatch:
    +
    +jobs:
    +  docs:
    +    runs-on: ubuntu-latest
    +
    +    steps:
    +      - uses: actions/checkout@v3
    +        with:
    +          # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
    +          fetch-depth: 0
    +
    +      - name: Setup pnpm
    +        uses: pnpm/action-setup@v2
    +        with:
    +          # 选择要使用的 pnpm 版本
    +          version: 7
    +          # 使用 pnpm 安装依赖
    +          run_install: true
    +
    +      - name: Setup Node.js
    +        uses: actions/setup-node@v3
    +        with:
    +          # 选择要使用的 node 版本
    +          node-version: 18
    +          # 缓存 pnpm 依赖
    +          cache: pnpm
    +
    +      # 运行构建脚本
    +      - name: Build VuePress site
    +        run: pnpm docs:build
    +
    +      # 查看 workflow 的文档来获取更多信息
    +      # @see https://github.com/crazy-max/ghaction-github-pages
    +      - name: Deploy to GitHub Pages
    +        uses: crazy-max/ghaction-github-pages@v2
    +        with:
    +          # 部署到 gh-pages 分支
    +          target_branch: gh-pages
    +          # 部署目录为 VuePress 的默认输出目录
    +          build_dir: docs/.vuepress/dist
    +        env:
    +          # @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
    +          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    +
    `,1),x={class:"hint-container tip"},w=n("p",{class:"hint-container-title"},"提示",-1),j={href:"https://pages.github.com/",target:"_blank",rel:"noopener noreferrer"},P=n("h2",{id:"gitlab-pages",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#gitlab-pages","aria-hidden":"true"},"#"),s(" GitLab Pages")],-1),R=t("

    如果你准备发布到 https://<USERNAME>.gitlab.io/ ,你可以省略这一步,因此 base 默认就是 "/"

    如果你准备发布到 https://<USERNAME>.gitlab.io/<REPO>/ ,也就是说你的仓库地址是 https://gitlab.com/<USERNAME>/<REPO> ,则将 base 设置为 "/<REPO>/"

    ",2),B=n("code",null,".gitlab-ci.yml",-1),N={href:"https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/",target:"_blank",rel:"noopener noreferrer"},C=t(`
    点击展开配置样例
    # 选择你要使用的 docker 镜像
    +image: node:18-buster
    +
    +pages:
    +  # 每当 push 到 main 分支时触发部署
    +  only:
    +    - main
    +
    +  # 缓存 node_modules
    +  cache:
    +    key:
    +      files:
    +        - pnpm-lock.yaml
    +    paths:
    +      - .pnpm-store
    +
    +  # 安装 pnpm
    +  before_script:
    +    - curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7
    +    - pnpm config set store-dir .pnpm-store
    +
    +  # 安装依赖并运行构建脚本
    +  script:
    +    - pnpm install --frozen-lockfile
    +    - pnpm docs:build --dest public
    +
    +  artifacts:
    +    paths:
    +      - public
    +
    `,1),V={class:"hint-container tip"},O=n("p",{class:"hint-container-title"},"提示",-1),S={href:"https://docs.gitlab.com/ce/user/project/pages/#getting-started",target:"_blank",rel:"noopener noreferrer"},A=n("h2",{id:"google-firebase",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#google-firebase","aria-hidden":"true"},"#"),s(" Google Firebase")],-1),G={href:"https://www.npmjs.com/package/firebase-tools",target:"_blank",rel:"noopener noreferrer"},I=n("li",null,[n("p",null,[s("在你项目的根目录下创建 "),n("code",null,"firebase.json"),s(" 和 "),n("code",null,".firebaserc"),s(",并包含以下内容:")])],-1),H=t(`

    firebase.json:

    {
    +  "hosting": {
    +    "public": "./docs/.vuepress/dist",
    +    "ignore": []
    +  }
    +}
    +

    .firebaserc:

    {
    +  "projects": {
    +    "default": "<YOUR_FIREBASE_ID>"
    +  }
    +}
    +
    1. 在执行了 pnpm docs:build 后, 使用 firebase deploy 指令来部署。
    `,5),L={class:"hint-container tip"},U=n("p",{class:"hint-container-title"},"提示",-1),M={href:"https://firebase.google.com/docs/cli",target:"_blank",rel:"noopener noreferrer"},T=n("h2",{id:"heroku",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#heroku","aria-hidden":"true"},"#"),s(" Heroku")],-1),D={href:"https://devcenter.heroku.com/articles/heroku-cli",target:"_blank",rel:"noopener noreferrer"},F={href:"https://signup.heroku.com",target:"_blank",rel:"noopener noreferrer"},z=n("li",null,[n("p",null,[s("运行 "),n("code",null,"heroku login"),s(" 并填写你的 Heroku 认证信息:")])],-1),K=t(`
    heroku login
    +
    1. 在你的项目根目录中,创建一个名为 static.json 的文件,并包含下述内容:

    static.json:

    {
    +  "root": "./docs/.vuepress/dist"
    +}
    +
    `,4),Y={href:"https://github.com/heroku/heroku-buildpack-static",target:"_blank",rel:"noopener noreferrer"},W=n("h2",{id:"kinsta",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#kinsta","aria-hidden":"true"},"#"),s(" Kinsta")],-1),$={href:"https://kinsta.com/docs/vuepress-application/",target:"_blank",rel:"noopener noreferrer"},X=n("h2",{id:"edgio",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#edgio","aria-hidden":"true"},"#"),s(" Edgio")],-1),Z={href:"https://docs.edg.io/guides/vuepress",target:"_blank",rel:"noopener noreferrer"},J=n("h2",{id:"netlify",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#netlify","aria-hidden":"true"},"#"),s(" Netlify")],-1),Q={href:"https://netlify.com",target:"_blank",rel:"noopener noreferrer"},nn=n("ul",null,[n("li",null,[n("strong",null,"Build Command:"),s(),n("code",null,"pnpm docs:build")]),n("li",null,[n("strong",null,"Publish directory:"),s(),n("code",null,"docs/.vuepress/dist")])],-1),sn={href:"https://docs.netlify.com/configure-builds/environment-variables",target:"_blank",rel:"noopener noreferrer"},en=n("ul",null,[n("li",null,[n("code",null,"NODE_VERSION"),s(": 14")])],-1),an=n("li",null,[n("p",null,"点击 deploy 按钮。")],-1),tn=n("h2",{id:"vercel",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vercel","aria-hidden":"true"},"#"),s(" Vercel")],-1),ln={href:"https://vercel.com",target:"_blank",rel:"noopener noreferrer"},on=n("ul",null,[n("li",null,[n("strong",null,"FRAMEWORK PRESET:"),s(),n("code",null,"Other")]),n("li",null,[n("strong",null,"BUILD COMMAND:"),s(),n("code",null,"pnpm docs:build")]),n("li",null,[n("strong",null,"OUTPUT DIRECTORY:"),s(),n("code",null,"docs/.vuepress/dist")])],-1),cn=n("li",null,[n("p",null,"点击 deploy 按钮。")],-1),pn=n("h2",{id:"云开发-cloudbase",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#云开发-cloudbase","aria-hidden":"true"},"#"),s(" 云开发 CloudBase")],-1),un={href:"https://cloudbase.net/?site=vuepress",target:"_blank",rel:"noopener noreferrer"},rn={href:"https://cloudbase.net/framework.html?site=vuepress",target:"_blank",rel:"noopener noreferrer"},dn=t(`
    1. 全局安装 CloudBase CLI :
    pnpm install -g @cloudbase/cli
    +
    `,2),kn={start:"2"},vn={href:"https://console.cloud.tencent.com/tcb/env/index?tdl_anchor=ad&tdl_site=vuejs",target:"_blank",rel:"noopener noreferrer"},mn=t(`
    cloudbase init --without-template
    +cloudbase framework:deploy
    +

    CloudBase CLI 首先会跳转到控制台进行登录授权,然后将会交互式进行确认。

    确认信息后会立即进行部署,部署完成后,可以获得一个自动 SSL,CDN 加速的网站应用,你也可以搭配使用 GitHub Action 来持续部署 GitHub 上的 VuePress 应用。

    也可以使用 cloudbase init --template vuepress 快速创建和部署一个新的 VuePress 应用。

    `,4),hn={class:"hint-container tip"},bn=n("p",{class:"hint-container-title"},"提示",-1),_n={href:"https://github.com/TencentCloudBase/cloudbase-framework?site=vuepress#%E9%A1%B9%E7%9B%AE%E7%A4%BA%E4%BE%8B",target:"_blank",rel:"noopener noreferrer"},gn=n("h2",{id:"_21-云盒子",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#_21-云盒子","aria-hidden":"true"},"#"),s(" 21 云盒子")],-1),fn={href:"https://www.21yunbox.com/docs/#/deploy-vuepress",target:"_blank",rel:"noopener noreferrer"};function yn(En,qn){const a=i("ExternalLinkIcon"),l=i("RouterLink");return p(),u("div",null,[k,v,n("ul",null,[m,h,n("li",null,[s("使用 "),n("a",b,[s("pnpm"),e(a)]),s(" 作为包管理器,当然也支持使用 npm 或 yarn 。")]),_]),g,n("ol",null,[n("li",null,[n("p",null,[s("设置正确的 "),e(l,{to:"/zh/reference/config.html#base"},{default:o(()=>[s("base")]),_:1}),s(" 选项。")]),f]),n("li",null,[n("p",null,[s("选择你想要使用的 CI 工具。这里我们以 "),n("a",y,[s("GitHub Actions"),e(a)]),s(" 为例。")]),E])]),q,n("div",x,[w,n("p",null,[s("请参考 "),n("a",j,[s("GitHub Pages 官方指南"),e(a)]),s(" 来获取更多信息。")])]),P,n("ol",null,[n("li",null,[n("p",null,[s("设置正确的 "),e(l,{to:"/zh/reference/config.html#base"},{default:o(()=>[s("base")]),_:1}),s(" 选项。")]),R]),n("li",null,[n("p",null,[s("创建 "),B,s(" 文件来配置 "),n("a",N,[s("GitLab CI"),e(a)]),s(" 工作流。")])])]),C,n("div",V,[O,n("p",null,[s("请参考 "),n("a",S,[s("GitLab Pages 官方指南"),e(a)]),s(" 来获取更多信息。")])]),A,n("ol",null,[n("li",null,[n("p",null,[s("请确保你已经安装了 "),n("a",G,[s("firebase-tools"),e(a)]),s("。")])]),I]),H,n("div",L,[U,n("p",null,[s("请参考 "),n("a",M,[s("Firebase CLI 官方指南"),e(a)]),s(" 来获取更多信息。")])]),T,n("ol",null,[n("li",null,[n("p",null,[s("首先安装 "),n("a",D,[s("Heroku CLI"),e(a)]),s(";")])]),n("li",null,[n("p",null,[n("a",F,[s("在这里"),e(a)]),s(" 注册一个 Heroku 账号;")])]),z]),K,n("p",null,[s("这里是你项目的配置,请参考 "),n("a",Y,[s("heroku-buildpack-static"),e(a)]),s(" 来获取更多信息。")]),W,n("p",null,[s("请查看 "),n("a",$,[s("Set Up VuePress on Kinsta"),e(a)]),s(" 。")]),X,n("p",null,[s("请查看 "),n("a",Z,[s("Edgio Documentation > Framework Guides > VuePress"),e(a)]),s(" 。")]),J,n("ol",null,[n("li",null,[n("p",null,[s("前往 "),n("a",Q,[s("Netlify"),e(a)]),s(" ,从 GitHub 创建一个新项目,并进行如下配置:")]),nn]),n("li",null,[n("p",null,[s("设置 "),n("a",sn,[s("Environment variables"),e(a)]),s(" 来选择 Node 版本:")]),en]),an]),tn,n("ol",null,[n("li",null,[n("p",null,[s("前往 "),n("a",ln,[s("Vercel"),e(a)]),s(" ,从 GitHub 创建一个新项目,并进行如下配置:")]),on]),cn]),r(" 下列平台是中文文档特有的,放在最下方 "),pn,n("p",null,[n("a",un,[s("云开发 CloudBase"),e(a)]),s(" 是一个云原生一体化的 Serverless 云平台,支持静态网站、容器等多种托管能力,并提供简便的部署工具 "),n("a",rn,[s("CloudBase Framework"),e(a)]),s(" 来一键部署应用。")]),dn,n("ol",kn,[n("li",null,[s("在项目根目录运行以下命令一键部署 VuePress 应用,在部署之前可以先 "),n("a",vn,[s("开通环境"),e(a)]),s(":")])]),mn,n("div",hn,[bn,n("p",null,[s("更多详细信息请查看 CloudBase Framework 的"),n("a",_n,[s("部署项目示例"),e(a)])])]),gn,n("p",null,[s("请查看 "),n("a",fn,[s("21 云盒子 - 部署一个 VuePress 静态网页"),e(a)]),s("。")])])}const wn=c(d,[["render",yn],["__file","deployment.html.vue"]]);export{wn as default}; diff --git a/assets/docsearch-1d421ddb.js b/assets/docsearch-1d421ddb.js new file mode 100644 index 00000000..182023d2 --- /dev/null +++ b/assets/docsearch-1d421ddb.js @@ -0,0 +1,2 @@ +const i=`@media (min-width: 751px){#docsearch-container{min-width:171.36px}}@media (max-width: 750px){.DocSearch-Container{position:fixed}#docsearch-container{min-width:52px}}@media print{#docsearch-container{display:none}} +`;export{i as default}; diff --git a/assets/docsearch.html-80a50c1e.js b/assets/docsearch.html-80a50c1e.js new file mode 100644 index 00000000..a95fd035 --- /dev/null +++ b/assets/docsearch.html-80a50c1e.js @@ -0,0 +1,205 @@ +import{_ as c,W as r,X as u,Y as a,$ as n,a0 as s,Z as o,a1 as t,D as l}from"./framework-46b0e263.js";const d={},k=n("h1",{id:"docsearch",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#docsearch","aria-hidden":"true"},"#"),s(" docsearch")],-1),h={href:"https://docsearch.algolia.com/",target:"_blank",rel:"noopener noreferrer"},v=t(`

    Tips

    Default theme will add DocSearch to the navbar once you configure this plugin correctly.

    This plugin may not be used directly in other themes, so you'd better refer to the documentation of your theme for more details.

    Usage

    npm i -D @vuepress/plugin-docsearch@next
    +
    import { docsearchPlugin } from "@vuepress/plugin-docsearch";
    +
    +export default {
    +  plugins: [
    +    docsearchPlugin({
    +      // options
    +    }),
    +  ],
    +};
    +

    Get Search Index

    `,5),m={href:"https://docsearch.algolia.com/apply/",target:"_blank",rel:"noopener noreferrer"},b=n("a",{href:"#apikey"},"apiKey",-1),g=n("a",{href:"#indexname"},"indexName",-1),y={href:"https://docsearch.algolia.com/docs/run-your-own/",target:"_blank",rel:"noopener noreferrer"},_=n("a",{href:"#appId"},"appId",-1),f=n("a",{href:"#apikey"},"apiKey",-1),x=n("a",{href:"#indexname"},"indexName",-1),w=t(`
    Official crawler config
    new Crawler({
    +  appId: 'YOUR_APP_ID',
    +  apiKey: 'YOUR_API_KEY',
    +  rateLimit: 8,
    +  startUrls: [
    +    // These are urls which algolia start to craw
    +    // If your site is divided in to mutiple parts,
    +    // you may want to set mutiple entry links
    +    'https://YOUR_WEBSITE_URL/',
    +  ],
    +  sitemaps: [
    +    // if you are using sitemap plugins (e.g.: vuepress-plugin-sitemap2), you may provide one
    +    'https://YOUR_WEBSITE_URL/sitemap.xml',
    +  ],
    +  ignoreCanonicalTo: false,
    +  exclusionPatterns: [
    +    // You can use this to stop algolia crawing some paths
    +  ],
    +  discoveryPatterns: [
    +    // These are urls which algolia looking for,
    +    'https://YOUR_WEBSITE_URL/**',
    +  ],
    +  // Crawler schedule, set it according to your docs update frequency
    +  schedule: 'at 02:00 every 1 day',
    +  actions: [
    +    // you may have mutiple actions, especially when you are deploying mutiple docs under one domain
    +    {
    +      // name the index with name you like
    +      indexName: 'YOUR_INDEX_NAME',
    +      // paths where the index take effect
    +      pathsToMatch: ['https://YOUR_WEBSITE_URL/**'],
    +      // controls how algolia extracts records from your site
    +      recordExtractor: ({ $, helpers }) => {
    +        // options for @vuepress/theme-default
    +        return helpers.docsearch({
    +          recordProps: {
    +            lvl0: {
    +              selectors: '.sidebar-heading.active',
    +              defaultValue: 'Documentation',
    +            },
    +            lvl1: '.theme-default-content h1',
    +            lvl2: '.theme-default-content h2',
    +            lvl3: '.theme-default-content h3',
    +            lvl4: '.theme-default-content h4',
    +            lvl5: '.theme-default-content h5',
    +            lvl6: '.theme-default-content h6',
    +            content: '.theme-default-content p, .theme-default-content li',
    +          },
    +          indexHeadings: true,
    +        })
    +      },
    +    },
    +  ],
    +  initialIndexSettings: {
    +    // controls how index are initialized
    +    // only has effects before index are initialize
    +    // you may need to delete your index and recraw after modification
    +    YOUR_INDEX_NAME: {
    +      attributesForFaceting: ['type', 'lang'],
    +      attributesToRetrieve: ['hierarchy', 'content', 'anchor', 'url'],
    +      attributesToHighlight: ['hierarchy', 'hierarchy_camel', 'content'],
    +      attributesToSnippet: ['content:10'],
    +      camelCaseAttributes: ['hierarchy', 'hierarchy_radio', 'content'],
    +      searchableAttributes: [
    +        'unordered(hierarchy_radio_camel.lvl0)',
    +        'unordered(hierarchy_radio.lvl0)',
    +        'unordered(hierarchy_radio_camel.lvl1)',
    +        'unordered(hierarchy_radio.lvl1)',
    +        'unordered(hierarchy_radio_camel.lvl2)',
    +        'unordered(hierarchy_radio.lvl2)',
    +        'unordered(hierarchy_radio_camel.lvl3)',
    +        'unordered(hierarchy_radio.lvl3)',
    +        'unordered(hierarchy_radio_camel.lvl4)',
    +        'unordered(hierarchy_radio.lvl4)',
    +        'unordered(hierarchy_radio_camel.lvl5)',
    +        'unordered(hierarchy_radio.lvl5)',
    +        'unordered(hierarchy_radio_camel.lvl6)',
    +        'unordered(hierarchy_radio.lvl6)',
    +        'unordered(hierarchy_camel.lvl0)',
    +        'unordered(hierarchy.lvl0)',
    +        'unordered(hierarchy_camel.lvl1)',
    +        'unordered(hierarchy.lvl1)',
    +        'unordered(hierarchy_camel.lvl2)',
    +        'unordered(hierarchy.lvl2)',
    +        'unordered(hierarchy_camel.lvl3)',
    +        'unordered(hierarchy.lvl3)',
    +        'unordered(hierarchy_camel.lvl4)',
    +        'unordered(hierarchy.lvl4)',
    +        'unordered(hierarchy_camel.lvl5)',
    +        'unordered(hierarchy.lvl5)',
    +        'unordered(hierarchy_camel.lvl6)',
    +        'unordered(hierarchy.lvl6)',
    +        'content',
    +      ],
    +      distinct: true,
    +      attributeForDistinct: 'url',
    +      customRanking: [
    +        'desc(weight.pageRank)',
    +        'desc(weight.level)',
    +        'asc(weight.position)',
    +      ],
    +      ranking: [
    +        'words',
    +        'filters',
    +        'typo',
    +        'attribute',
    +        'proximity',
    +        'exact',
    +        'custom',
    +      ],
    +      highlightPreTag: '<span class="algolia-docsearch-suggestion--highlight">',
    +      highlightPostTag: '</span>',
    +      minWordSizefor1Typo: 3,
    +      minWordSizefor2Typos: 7,
    +      allowTyposOnNumericTokens: false,
    +      minProximity: 1,
    +      ignorePlurals: true,
    +      advancedSyntax: true,
    +      attributeCriteriaComputedByMinProximity: true,
    +      removeWordsIfNoResults: 'allOptional',
    +    },
    +  },
    +})
    +


































     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     








     
































































    The above recordProps is the configuration used for the default theme. You can modify them according to the theme you are using.

    Notice that the initialIndexSettings.YOUR_INDEX_NAME.attributesForFaceting fields must include 'lang' to make this plugin work properly.

    `,1),D={class:"hint-container tip"},T=n("p",{class:"hint-container-title"},"Tips",-1),S={href:"https://crawler.algolia.com/admin/crawlers/",target:"_blank",rel:"noopener noreferrer"},I=n("h2",{id:"options",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#options","aria-hidden":"true"},"#"),s(" Options")],-1),P=n("h3",{id:"apikey",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#apikey","aria-hidden":"true"},"#"),s(" apiKey")],-1),q=n("li",null,[n("p",null,[s("Type: "),n("code",null,"string")])],-1),A=n("li",null,[n("p",null,[s("Required: "),n("code",null,"true")])],-1),E=n("li",null,[n("p",null,"Details:"),n("p",null,[s("The "),n("code",null,"apiKey"),s(" that you received from the DocSearch team, or generated by yourself.")])],-1),N=n("p",null,"Also see:",-1),R={href:"https://docsearch.algolia.com/docs/api#apikey",target:"_blank",rel:"noopener noreferrer"},O=n("h3",{id:"indexname",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#indexname","aria-hidden":"true"},"#"),s(" indexName")],-1),U=n("li",null,[n("p",null,[s("Type: "),n("code",null,"string")])],-1),Y=n("li",null,[n("p",null,[s("Required: "),n("code",null,"true")])],-1),z=n("li",null,[n("p",null,"Details:"),n("p",null,[s("The "),n("code",null,"indexName"),s(" that you received from the DocSearch team, or generated by yourself.")])],-1),B=n("p",null,"Also see:",-1),C={href:"https://docsearch.algolia.com/docs/api#indexname",target:"_blank",rel:"noopener noreferrer"},W=n("h3",{id:"appid",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#appid","aria-hidden":"true"},"#"),s(" appId")],-1),L=n("li",null,[n("p",null,[s("Type: "),n("code",null,"string")])],-1),j=n("li",null,[n("p",null,[s("Required: "),n("code",null,"true")])],-1),K=n("li",null,[n("p",null,"Details:"),n("p",null,"It defines your own application ID.")],-1),V=n("p",null,"Also see:",-1),F={href:"https://docsearch.algolia.com/docs/api#appid",target:"_blank",rel:"noopener noreferrer"},M=n("h3",{id:"searchparameters",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#searchparameters","aria-hidden":"true"},"#"),s(" searchParameters")],-1),X=n("li",null,[n("p",null,[s("Type: "),n("code",null,"SearchParameters")])],-1),H=n("li",null,[n("p",null,"Details:"),n("p",null,"Parameters of Algolia Search API.")],-1),G=n("p",null,"Also see:",-1),Q={href:"https://docsearch.algolia.com/docs/api/#searchparameters",target:"_blank",rel:"noopener noreferrer"},$={href:"https://www.algolia.com/doc/api-reference/search-api-parameters/",target:"_blank",rel:"noopener noreferrer"},Z=n("h3",{id:"placeholder",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#placeholder","aria-hidden":"true"},"#"),s(" placeholder")],-1),J=n("li",null,[n("p",null,[s("Type: "),n("code",null,"string")])],-1),nn=n("li",null,[n("p",null,[s("Default: "),n("code",null,"'Search docs'")])],-1),sn=n("li",null,[n("p",null,"Details:"),n("p",null,"The placeholder attribute of the search input.")],-1),an=n("p",null,"Also see:",-1),en={href:"https://docsearch.algolia.com/docs/api/#placeholder",target:"_blank",rel:"noopener noreferrer"},tn=n("h3",{id:"disableuserpersonalization",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#disableuserpersonalization","aria-hidden":"true"},"#"),s(" disableUserPersonalization")],-1),pn=n("li",null,[n("p",null,[s("Type: "),n("code",null,"boolean")])],-1),on=n("li",null,[n("p",null,[s("Default: "),n("code",null,"false")])],-1),ln=n("li",null,[n("p",null,"Details:"),n("p",null,"Whether to disable all personalized features: recent searches, favorite searches, etc.")],-1),cn=n("p",null,"Also see:",-1),rn={href:"https://docsearch.algolia.com/docs/api/#disableuserpersonalization",target:"_blank",rel:"noopener noreferrer"},un=n("h3",{id:"initialquery",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#initialquery","aria-hidden":"true"},"#"),s(" initialQuery")],-1),dn=n("li",null,[n("p",null,[s("Type: "),n("code",null,"string")])],-1),kn=n("li",null,[n("p",null,"Details:"),n("p",null,"The initial query when the modal opens.")],-1),hn=n("p",null,"Also see:",-1),vn={href:"https://docsearch.algolia.com/docs/api/#initialquery",target:"_blank",rel:"noopener noreferrer"},mn=n("h3",{id:"translations",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#translations","aria-hidden":"true"},"#"),s(" translations")],-1),bn=n("li",null,[n("p",null,[s("Type: "),n("code",null,"Partial")])],-1),gn=n("li",null,[n("p",null,"Details:"),n("p",null,"Allow replacing the default text in the DocSearch button or modal.")],-1),yn=n("p",null,"Also see:",-1),_n={href:"https://docsearch.algolia.com/docs/api/#translations",target:"_blank",rel:"noopener noreferrer"},fn=t(`

    locales

    • Type: Record<string, DocsearchPluginOptions>

    • Details:

      Options of this plugin in different locales.

      All other options of this plugin are acceptable in locale config.

    • Example:

    export default {
    +  plugins: [
    +    docsearchPlugin({
    +      appId: "<APP_ID>",
    +      apiKey: "<API_KEY>",
    +      indexName: "<INDEX_NAME>",
    +      locales: {
    +        "/": {
    +          placeholder: "Search Documentation",
    +          translations: {
    +            button: {
    +              buttonText: "Search Documentation",
    +            },
    +          },
    +        },
    +        "/zh/": {
    +          placeholder: "搜索文档",
    +          translations: {
    +            button: {
    +              buttonText: "搜索文档",
    +            },
    +          },
    +        },
    +      },
    +    }),
    +  ],
    +};
    +
    `,3),xn=n("h3",{id:"indexbase",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#indexbase","aria-hidden":"true"},"#"),s(" indexBase")],-1),wn=n("li",null,[n("p",null,[s("Type: "),n("code",null,"string")])],-1),Dn=n("p",null,"Details:",-1),Tn=n("p",null,"The base path of the search index.",-1),Sn=n("p",null,[s("If you are deploying your site to multiple domains, you don't need to submit all of them to DocSearch and generate search index separately. You could choose one of the domains as the "),n("em",null,"index domain"),s(", and only submit the "),n("em",null,"index domain"),s(" to Docsearch for crawling search index. Then, you could reuse the search index across all deployments.")],-1),In=n("em",null,"index domain",-1),Pn=t('

    injectStyles

    • Type: boolean

    • Default: true

    • Details:

      Whether to inject the default styles of DocSearch or not.

      If you think the default styles of DocSearch is not compatible with your site, you can try to override the default styles, or set this option to false to totally exclude the default styles.

      When this option is disabled, you need to import your own styles for DocSearch. Also notice that all styles customization in Styles section would be unavailable.

    Styles

    ',3),qn={href:"https://docsearch.algolia.com/docs/styling",target:"_blank",rel:"noopener noreferrer"},An=t(`
    :root {
    +  --docsearch-primary-color: rgb(84, 104, 255);
    +  --docsearch-text-color: rgb(28, 30, 33);
    +  --docsearch-spacing: 12px;
    +  --docsearch-icon-stroke-width: 1.4;
    +  --docsearch-highlight-color: var(--docsearch-primary-color);
    +  --docsearch-muted-color: rgb(150, 159, 175);
    +  --docsearch-container-background: rgba(101, 108, 133, 0.8);
    +  --docsearch-logo-color: rgba(84, 104, 255);
    +
    +  /* modal */
    +  --docsearch-modal-width: 560px;
    +  --docsearch-modal-height: 600px;
    +  --docsearch-modal-background: rgb(245, 246, 247);
    +  --docsearch-modal-shadow: inset 1px 1px 0 0 rgba(255, 255, 255, 0.5), 0 3px
    +      8px 0 rgba(85, 90, 100, 1);
    +
    +  /* searchbox */
    +  --docsearch-searchbox-height: 56px;
    +  --docsearch-searchbox-background: rgb(235, 237, 240);
    +  --docsearch-searchbox-focus-background: #fff;
    +  --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);
    +
    +  /* hit */
    +  --docsearch-hit-height: 56px;
    +  --docsearch-hit-color: rgb(68, 73, 80);
    +  --docsearch-hit-active-color: #fff;
    +  --docsearch-hit-background: #fff;
    +  --docsearch-hit-shadow: 0 1px 3px 0 rgb(212, 217, 225);
    +
    +  /* key */
    +  --docsearch-key-gradient: linear-gradient(
    +    -225deg,
    +    rgb(213, 219, 228) 0%,
    +    rgb(248, 248, 248) 100%
    +  );
    +  --docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230), inset 0 0 1px 1px
    +      #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4);
    +
    +  /* footer */
    +  --docsearch-footer-height: 44px;
    +  --docsearch-footer-background: #fff;
    +  --docsearch-footer-shadow: 0 -1px 0 0 rgb(224, 227, 232), 0 -3px 6px 0 rgba(69, 98, 155, 0.12);
    +}
    +

    Components

    Docsearch

    • Details:

      This plugin will register a <Docsearch /> component globally, and you can use it without any props.

      Put this component to where you want to place the docsearch button. For example, default theme puts this component to the end of the navbar.

    Tips

    This component is mainly used for theme development. You don't need to use it directly in most cases.

    `,5);function En(Nn,Rn){const i=l("NpmBadge"),e=l("ExternalLinkIcon"),p=l("RouterLink");return r(),u("div",null,[k,a(i,{package:"@vuepress/plugin-docsearch"}),n("p",null,[s("Integrate "),n("a",h,[s("Algolia DocSearch"),a(e)]),s(" into VuePress, which can provide search to your documentation site.")]),v,n("p",null,[s("You need to "),n("a",m,[s("submit the URL of your site"),a(e)]),s(" to join the DocSearch program. The DocSearch team will send "),b,s(" and "),g,s(" to your email once the index is generated. Then you can configure this plugin to enable DocSearch in VuePress.")]),n("p",null,[s("Alternatively, you can "),n("a",y,[s("run your own crawler"),a(e)]),s(" to generate the index, and then use your own "),_,s(", "),f,s(" and "),x,s(" to configure this plugin.")]),w,n("div",D,[T,n("p",null,[s("If you are not using default theme, or you meet any problems when using docsearch, you can also check the above example crawler config, and ahead to "),n("a",S,[s("Algolia Crawler"),a(e)]),s(", and edit your config with 'Editor' panel in project sidebar.")])]),I,P,n("ul",null,[q,A,E,n("li",null,[N,n("ul",null,[n("li",null,[n("a",R,[s("DocSearch > Options > apiKey"),a(e)])])])])]),O,n("ul",null,[U,Y,z,n("li",null,[B,n("ul",null,[n("li",null,[n("a",C,[s("DocSearch > Options > indexName"),a(e)])])])])]),W,n("ul",null,[L,j,K,n("li",null,[V,n("ul",null,[n("li",null,[n("a",F,[s("DocSearch > Options > appId"),a(e)])])])])]),M,n("ul",null,[X,H,n("li",null,[G,n("ul",null,[n("li",null,[n("a",Q,[s("DocSearch > Options > searchParameters"),a(e)])]),n("li",null,[n("a",$,[s("Algolia > Search API Parameters"),a(e)])])])])]),Z,n("ul",null,[J,nn,sn,n("li",null,[an,n("ul",null,[n("li",null,[n("a",en,[s("DocSearch > Options > placeholder"),a(e)])])])])]),tn,n("ul",null,[pn,on,ln,n("li",null,[cn,n("ul",null,[n("li",null,[n("a",rn,[s("DocSearch > Options > disableUserPersonalization"),a(e)])])])])]),un,n("ul",null,[dn,kn,n("li",null,[hn,n("ul",null,[n("li",null,[n("a",vn,[s("DocSearch > Options > initialQuery"),a(e)])])])])]),mn,n("ul",null,[bn,gn,n("li",null,[yn,n("ul",null,[n("li",null,[n("a",_n,[s("DocSearch > Options > translations"),a(e)])])])])]),fn,n("ul",null,[n("li",null,[s("Also see: "),n("ul",null,[n("li",null,[a(p,{to:"/guide/i18n.html"},{default:o(()=>[s("Guide > I18n")]),_:1})])])])]),xn,n("ul",null,[wn,n("li",null,[n("p",null,[s("Default: "),a(p,{to:"/reference/config.html#base"},{default:o(()=>[s("base")]),_:1})])]),n("li",null,[Dn,Tn,Sn,n("p",null,[s("However, if the "),a(p,{to:"/reference/config.html#base"},{default:o(()=>[s("base")]),_:1}),s(" of your deployments are different for different domains, you need to set the option to the "),a(p,{to:"/reference/config.html#base"},{default:o(()=>[s("base")]),_:1}),s(" of your "),In,s(", so that other deployments could reuse the search index correctly.")])])]),Pn,n("p",null,[s("You can customize styles via CSS variables that provided by "),n("a",qn,[s("@docsearch/css"),a(e)]),s(":")]),An])}const Un=c(d,[["render",En],["__file","docsearch.html.vue"]]);export{Un as default}; diff --git a/assets/docsearch.html-96cbfce9.js b/assets/docsearch.html-96cbfce9.js new file mode 100644 index 00000000..6e381d69 --- /dev/null +++ b/assets/docsearch.html-96cbfce9.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-ec0baf10","path":"/reference/plugin/docsearch.html","title":"docsearch","lang":"en-US","frontmatter":{"description":"Integrate Algolia DocSearch (https://docsearch.algolia.com/) into VuePress, which can provide search to your documentation site. Default theme will add DocSearch to the navbar o...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/plugin/docsearch.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/plugin/docsearch.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"docsearch"}],["meta",{"property":"og:description","content":"Integrate Algolia DocSearch (https://docsearch.algolia.com/) into VuePress, which can provide search to your documentation site. Default theme will add DocSearch to the navbar o..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"docsearch\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Get Search Index","slug":"get-search-index","link":"#get-search-index","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"apiKey","slug":"apikey","link":"#apikey","children":[]},{"level":3,"title":"indexName","slug":"indexname","link":"#indexname","children":[]},{"level":3,"title":"appId","slug":"appid","link":"#appid","children":[]},{"level":3,"title":"searchParameters","slug":"searchparameters","link":"#searchparameters","children":[]},{"level":3,"title":"placeholder","slug":"placeholder","link":"#placeholder","children":[]},{"level":3,"title":"disableUserPersonalization","slug":"disableuserpersonalization","link":"#disableuserpersonalization","children":[]},{"level":3,"title":"initialQuery","slug":"initialquery","link":"#initialquery","children":[]},{"level":3,"title":"translations","slug":"translations","link":"#translations","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]},{"level":3,"title":"indexBase","slug":"indexbase","link":"#indexbase","children":[]},{"level":3,"title":"injectStyles","slug":"injectstyles","link":"#injectstyles","children":[]}]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]},{"level":2,"title":"Components","slug":"components","link":"#components","children":[{"level":3,"title":"Docsearch","slug":"docsearch-1","link":"#docsearch-1","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":4.92,"words":1476},"filePathRelative":"reference/plugin/docsearch.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/docsearch.html-e0be4873.js b/assets/docsearch.html-e0be4873.js new file mode 100644 index 00000000..fe145e86 --- /dev/null +++ b/assets/docsearch.html-e0be4873.js @@ -0,0 +1,203 @@ +import{_ as i,W as r,X as u,Y as a,$ as n,a0 as s,Z as o,a1 as e,D as l}from"./framework-46b0e263.js";const d={},k=n("h1",{id:"docsearch",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#docsearch","aria-hidden":"true"},"#"),s(" docsearch")],-1),h={href:"https://docsearch.algolia.com/",target:"_blank",rel:"noopener noreferrer"},v=e(`

    提示

    当你正确配置该插件后,默认主题会把 DocSearch 按钮添加到导航栏。

    该插件不一定能在其他主题中直接使用,因此你应参考主题本身的文档来获取更多信息。

    使用方法

    npm i -D @vuepress/plugin-docsearch@next
    +
    import { docsearchPlugin } from "@vuepress/plugin-docsearch";
    +
    +export default {
    +  plugins: [
    +    docsearchPlugin({
    +      // 配置项
    +    }),
    +  ],
    +};
    +

    获取搜索索引

    `,5),b={href:"https://docsearch.algolia.com/apply/",target:"_blank",rel:"noopener noreferrer"},m=n("a",{href:"#apikey"},"apiKey",-1),g=n("a",{href:"#indexname"},"indexName",-1),_={href:"https://docsearch.algolia.com/docs/run-your-own/",target:"_blank",rel:"noopener noreferrer"},y=n("a",{href:"#appId"},"appId",-1),f=n("a",{href:"#apikey"},"apiKey",-1),x=n("a",{href:"#indexname"},"indexName",-1),S=e(`
    官方爬虫配置示例
    new Crawler({
    +  appId: 'YOUR_APP_ID',
    +  apiKey: 'YOUR_API_KEY',
    +  rateLimit: 8,
    +  startUrls: [
    +    // 这是 Algolia 开始抓取网站的初始地址
    +    // 如果你的网站被分为数个独立部分,你可能需要在此设置多个入口链接
    +    'https://YOUR_WEBSITE_URL/',
    +  ],
    +  sitemaps: [
    +    // 如果你在使用 Sitemap 插件 (如: vuepress-plugin-sitemap2),你可以提供 Sitemap 链接
    +    'https://YOUR_WEBSITE_URL/sitemap.xml',
    +  ],
    +  ignoreCanonicalTo: false,
    +  exclusionPatterns: [
    +    // 你可以通过它阻止 Algolia 抓取某些 URL
    +  ],
    +  discoveryPatterns: [
    +    // 这是 Algolia 抓取 URL 的范围
    +    'https://YOUR_WEBSITE_URL/**',
    +  ],
    +  // 爬虫执行的计划时间,可根据文档更新频率设置
    +  schedule: 'at 02:00 every 1 day',
    +  actions: [
    +    // 你可以拥有多个 action,特别是你在一个域名下部署多个文档时
    +    {
    +      // 使用适当的名称为索引命名
    +      indexName: 'YOUR_INDEX_NAME',
    +      // 索引生效的路径
    +      pathsToMatch: ['https://YOUR_WEBSITE_URL/**'],
    +      // 控制 Algolia 如何抓取你的站点
    +      recordExtractor: ({ $, helpers }) => {
    +        // @vuepress/theme-default 的选项
    +        return helpers.docsearch({
    +          recordProps: {
    +            lvl0: {
    +              selectors: '.sidebar-heading.active',
    +              defaultValue: 'Documentation',
    +            },
    +            lvl1: '.theme-default-content h1',
    +            lvl2: '.theme-default-content h2',
    +            lvl3: '.theme-default-content h3',
    +            lvl4: '.theme-default-content h4',
    +            lvl5: '.theme-default-content h5',
    +            lvl6: '.theme-default-content h6',
    +            content: '.theme-default-content p, .theme-default-content li',
    +          },
    +          indexHeadings: true,
    +        })
    +      },
    +    },
    +  ],
    +  initialIndexSettings: {
    +    // 控制索引如何被初始化,这仅当索引尚未生成时有效
    +    // 你可能需要在修改后手动删除并重新生成新的索引
    +    YOUR_INDEX_NAME: {
    +      attributesForFaceting: ['type', 'lang'],
    +      attributesToRetrieve: ['hierarchy', 'content', 'anchor', 'url'],
    +      attributesToHighlight: ['hierarchy', 'hierarchy_camel', 'content'],
    +      attributesToSnippet: ['content:10'],
    +      camelCaseAttributes: ['hierarchy', 'hierarchy_radio', 'content'],
    +      searchableAttributes: [
    +        'unordered(hierarchy_radio_camel.lvl0)',
    +        'unordered(hierarchy_radio.lvl0)',
    +        'unordered(hierarchy_radio_camel.lvl1)',
    +        'unordered(hierarchy_radio.lvl1)',
    +        'unordered(hierarchy_radio_camel.lvl2)',
    +        'unordered(hierarchy_radio.lvl2)',
    +        'unordered(hierarchy_radio_camel.lvl3)',
    +        'unordered(hierarchy_radio.lvl3)',
    +        'unordered(hierarchy_radio_camel.lvl4)',
    +        'unordered(hierarchy_radio.lvl4)',
    +        'unordered(hierarchy_radio_camel.lvl5)',
    +        'unordered(hierarchy_radio.lvl5)',
    +        'unordered(hierarchy_radio_camel.lvl6)',
    +        'unordered(hierarchy_radio.lvl6)',
    +        'unordered(hierarchy_camel.lvl0)',
    +        'unordered(hierarchy.lvl0)',
    +        'unordered(hierarchy_camel.lvl1)',
    +        'unordered(hierarchy.lvl1)',
    +        'unordered(hierarchy_camel.lvl2)',
    +        'unordered(hierarchy.lvl2)',
    +        'unordered(hierarchy_camel.lvl3)',
    +        'unordered(hierarchy.lvl3)',
    +        'unordered(hierarchy_camel.lvl4)',
    +        'unordered(hierarchy.lvl4)',
    +        'unordered(hierarchy_camel.lvl5)',
    +        'unordered(hierarchy.lvl5)',
    +        'unordered(hierarchy_camel.lvl6)',
    +        'unordered(hierarchy.lvl6)',
    +        'content',
    +      ],
    +      distinct: true,
    +      attributeForDistinct: 'url',
    +      customRanking: [
    +        'desc(weight.pageRank)',
    +        'desc(weight.level)',
    +        'asc(weight.position)',
    +      ],
    +      ranking: [
    +        'words',
    +        'filters',
    +        'typo',
    +        'attribute',
    +        'proximity',
    +        'exact',
    +        'custom',
    +      ],
    +      highlightPreTag: '<span class="algolia-docsearch-suggestion--highlight">',
    +      highlightPostTag: '</span>',
    +      minWordSizefor1Typo: 3,
    +      minWordSizefor2Typos: 7,
    +      allowTyposOnNumericTokens: false,
    +      minProximity: 1,
    +      ignorePlurals: true,
    +      advancedSyntax: true,
    +      attributeCriteriaComputedByMinProximity: true,
    +      removeWordsIfNoResults: 'allOptional',
    +    },
    +  },
    +})
    +

































     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     







     
































































    上述 recordProps 是用于默认主题的配置,你可以根据你使用的主题来修改它们。

    注意 initialIndexSettings.YOUR_INDEX_NAME.attributesForFaceting 字段必须包含 'lang',否则该插件将无法正常工作。

    `,1),D={class:"hint-container tip"},P=n("p",{class:"hint-container-title"},"提示",-1),w={href:"https://crawler.algolia.com/admin/crawlers/",target:"_blank",rel:"noopener noreferrer"},I=n("h2",{id:"配置项",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#配置项","aria-hidden":"true"},"#"),s(" 配置项")],-1),q=n("h3",{id:"apikey",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#apikey","aria-hidden":"true"},"#"),s(" apiKey")],-1),E=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),N=n("li",null,[n("p",null,[s("是否必需: "),n("code",null,"true")])],-1),R=n("li",null,[n("p",null,"详情:"),n("p",null,[s("从 DocSearch 团队收到的 "),n("code",null,"apiKey"),s(" ,或者由你自己生成。")])],-1),A=n("p",null,"参考:",-1),O={href:"https://docsearch.algolia.com/docs/api#apikey",target:"_blank",rel:"noopener noreferrer"},T=n("h3",{id:"indexname",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#indexname","aria-hidden":"true"},"#"),s(" indexName")],-1),U=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),B=n("li",null,[n("p",null,[s("是否必需: "),n("code",null,"true")])],-1),z=n("li",null,[n("p",null,"详情:"),n("p",null,[s("从 DocSearch 团队收到的 "),n("code",null,"indexName"),s(" ,或者由你自己生成。")])],-1),L=n("p",null,"参考:",-1),Y={href:"https://docsearch.algolia.com/docs/api#indexname",target:"_blank",rel:"noopener noreferrer"},C=n("h3",{id:"appid",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#appid","aria-hidden":"true"},"#"),s(" appId")],-1),K=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),W=n("li",null,[n("p",null,[s("是否必需: "),n("code",null,"true")])],-1),V=n("li",null,[n("p",null,"详情:"),n("p",null,"用于设置你的 Application ID。")],-1),j=n("p",null,"参考:",-1),F={href:"https://docsearch.algolia.com/docs/api#appid",target:"_blank",rel:"noopener noreferrer"},M=n("h3",{id:"searchparameters",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#searchparameters","aria-hidden":"true"},"#"),s(" searchParameters")],-1),X=n("li",null,[n("p",null,[s("类型: "),n("code",null,"SearchParameters")])],-1),H=n("li",null,[n("p",null,"详情:"),n("p",null,"Algolia 搜索 API 参数。")],-1),Q=n("p",null,"参考:",-1),$={href:"https://docsearch.algolia.com/docs/api/#searchparameters",target:"_blank",rel:"noopener noreferrer"},Z={href:"https://www.algolia.com/doc/api-reference/search-api-parameters/",target:"_blank",rel:"noopener noreferrer"},G=n("h3",{id:"placeholder",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#placeholder","aria-hidden":"true"},"#"),s(" placeholder")],-1),J=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),nn=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"'Search docs'")])],-1),sn=n("li",null,[n("p",null,"详情:"),n("p",null,"搜索输入框的 placeholder 属性。")],-1),an=n("p",null,"参考:",-1),tn={href:"https://docsearch.algolia.com/docs/api#placeholder",target:"_blank",rel:"noopener noreferrer"},en=n("h3",{id:"disableuserpersonalization",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#disableuserpersonalization","aria-hidden":"true"},"#"),s(" disableUserPersonalization")],-1),pn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),on=n("li",null,[n("p",null,[s("默认值: "),n("code",null,"false")])],-1),ln=n("li",null,[n("p",null,"详情:"),n("p",null,"是否禁用所有的个性化功能:最近的搜索、收藏的搜索结果等。")],-1),cn=n("p",null,"参考:",-1),rn={href:"https://docsearch.algolia.com/docs/api#disableuserpersonalization",target:"_blank",rel:"noopener noreferrer"},un=n("h3",{id:"initialquery",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#initialquery","aria-hidden":"true"},"#"),s(" initialQuery")],-1),dn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),kn=n("li",null,[n("p",null,"详情:"),n("p",null,"打开弹窗时的初始请求。")],-1),hn=n("p",null,"参考:",-1),vn={href:"https://docsearch.algolia.com/docs/api#initialquery",target:"_blank",rel:"noopener noreferrer"},bn=n("h3",{id:"translations",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#translations","aria-hidden":"true"},"#"),s(" translations")],-1),mn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"Partial")])],-1),gn=n("li",null,[n("p",null,"详情:"),n("p",null,"允许替换 DocSearch 按钮和弹窗内的默认文字。")],-1),_n=n("p",null,"参考:",-1),yn={href:"https://docsearch.algolia.com/docs/api/#translations",target:"_blank",rel:"noopener noreferrer"},fn=e(`

    locales

    • 类型: Record<string, DocsearchPluginOptions>

    • 详情:

      在不同 locales 下对该插件进行不同的配置。

      该插件的所有其他选项都可以在 locale 中进行配置。

    • 示例:

    export default {
    +  plugins: [
    +    docsearchPlugin({
    +      appId: "<APP_ID>",
    +      apiKey: "<API_KEY>",
    +      indexName: "<INDEX_NAME>",
    +      locales: {
    +        "/": {
    +          placeholder: "Search Documentation",
    +          translations: {
    +            button: {
    +              buttonText: "Search Documentation",
    +            },
    +          },
    +        },
    +        "/zh/": {
    +          placeholder: "搜索文档",
    +          translations: {
    +            button: {
    +              buttonText: "搜索文档",
    +            },
    +          },
    +        },
    +      },
    +    }),
    +  ],
    +};
    +
    `,3),xn=n("h3",{id:"indexbase",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#indexbase","aria-hidden":"true"},"#"),s(" indexBase")],-1),Sn=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),Dn=n("p",null,"详情:",-1),Pn=n("p",null,"搜索索引基础路径。",-1),wn=n("p",null,[s("如果你需要把你的站点部署到不同的域名上,你不需要把它们全都提交到 Docsearch 上来分别生成搜索索引。你可以选择其中一个域名作为 "),n("em",null,"索引域名"),s(" ,并且仅将 "),n("em",null,"索引域名"),s(" 提交到 DocSearch 上来爬去搜索索引。然后,你就可以在不同的部署域名下复用索引。")],-1),In=n("em",null,"索引域名",-1),qn=e('

    injectStyles

    • 类型: boolean

    • 默认值: true

    • 详情:

      是否注入 DocSearch 的默认样式。

      如果你认为 DocSearch 的默认样式和你的站点不兼容,你可以尝试覆盖默认样式,或者将该选项设置为 false 来完全移除默认样式。

      当该选项被禁用时,你需要为 DocSearch 引入你自己的样式。同时要注意,你也无法再使用 样式 章节中提到的样式自定义能力。

    样式

    ',3),En={href:"https://docsearch.algolia.com/docs/styling",target:"_blank",rel:"noopener noreferrer"},Nn=e(`
    :root {
    +  --docsearch-primary-color: rgb(84, 104, 255);
    +  --docsearch-text-color: rgb(28, 30, 33);
    +  --docsearch-spacing: 12px;
    +  --docsearch-icon-stroke-width: 1.4;
    +  --docsearch-highlight-color: var(--docsearch-primary-color);
    +  --docsearch-muted-color: rgb(150, 159, 175);
    +  --docsearch-container-background: rgba(101, 108, 133, 0.8);
    +  --docsearch-logo-color: rgba(84, 104, 255);
    +
    +  /* modal */
    +  --docsearch-modal-width: 560px;
    +  --docsearch-modal-height: 600px;
    +  --docsearch-modal-background: rgb(245, 246, 247);
    +  --docsearch-modal-shadow: inset 1px 1px 0 0 rgba(255, 255, 255, 0.5), 0 3px
    +      8px 0 rgba(85, 90, 100, 1);
    +
    +  /* searchbox */
    +  --docsearch-searchbox-height: 56px;
    +  --docsearch-searchbox-background: rgb(235, 237, 240);
    +  --docsearch-searchbox-focus-background: #fff;
    +  --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);
    +
    +  /* hit */
    +  --docsearch-hit-height: 56px;
    +  --docsearch-hit-color: rgb(68, 73, 80);
    +  --docsearch-hit-active-color: #fff;
    +  --docsearch-hit-background: #fff;
    +  --docsearch-hit-shadow: 0 1px 3px 0 rgb(212, 217, 225);
    +
    +  /* key */
    +  --docsearch-key-gradient: linear-gradient(
    +    -225deg,
    +    rgb(213, 219, 228) 0%,
    +    rgb(248, 248, 248) 100%
    +  );
    +  --docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230), inset 0 0 1px 1px
    +      #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4);
    +
    +  /* footer */
    +  --docsearch-footer-height: 44px;
    +  --docsearch-footer-background: #fff;
    +  --docsearch-footer-shadow: 0 -1px 0 0 rgb(224, 227, 232), 0 -3px 6px 0 rgba(69, 98, 155, 0.12);
    +}
    +

    组件

    Docsearch

    • 详情:

      该插件会全局注册一个 <Docsearch /> 组件,你可以不传入任何 Props 来使用它。

      将该组件放置在你想要显示 docsearch 按钮的地方。例如,默认主题将这个组件放在了导航栏的末尾。

    提示

    该组件主要用于主题开发。在大多数情况下你不需要直接使用该组件。

    `,5);function Rn(An,On){const c=l("NpmBadge"),t=l("ExternalLinkIcon"),p=l("RouterLink");return r(),u("div",null,[k,a(c,{package:"@vuepress/plugin-docsearch"}),n("p",null,[s("将 "),n("a",h,[s("Algolia DocSearch"),a(t)]),s(" 集成到 VuePress 中,为你的文档网站提供搜索功能。")]),v,n("p",null,[s("你需要 "),n("a",b,[s("提交你的网站 URL"),a(t)]),s(" 来加入 DocSearch 项目。当你的索引成功创建后, DocSearch 团队会将 "),m,s(" 和 "),g,s(" 发送到你的邮箱。接下来,你就可以配置该插件,在 VuePress 中启用 DocSearch 了。")]),n("p",null,[s("或者,你也可以 "),n("a",_,[s("运行你自己的爬虫"),a(t)]),s(" 来创建索引,然后使用你自己的 "),y,s(", "),f,s(" 和 "),x,s(" 来配置该插件。")]),S,n("div",D,[P,n("p",null,[s("如果你使用的不是默认主题,或者在使用 Docsearch 的时候遇到了任何问题,你也可以检查上述的爬虫配置示例,然后前往 "),n("a",w,[s("Algolia Crawler"),a(t)]),s(" 仓库,在你项目侧边栏中的 Editor 页面中修改你的配置。")])]),I,q,n("ul",null,[E,N,R,n("li",null,[A,n("ul",null,[n("li",null,[n("a",O,[s("DocSearch > Options > apiKey"),a(t)])])])])]),T,n("ul",null,[U,B,z,n("li",null,[L,n("ul",null,[n("li",null,[n("a",Y,[s("DocSearch > Options > indexName"),a(t)])])])])]),C,n("ul",null,[K,W,V,n("li",null,[j,n("ul",null,[n("li",null,[n("a",F,[s("DocSearch > Options > appId"),a(t)])])])])]),M,n("ul",null,[X,H,n("li",null,[Q,n("ul",null,[n("li",null,[n("a",$,[s("DocSearch > Options > searchParameters"),a(t)])]),n("li",null,[n("a",Z,[s("Algolia > Search API Parameters"),a(t)])])])])]),G,n("ul",null,[J,nn,sn,n("li",null,[an,n("ul",null,[n("li",null,[n("a",tn,[s("DocSearch > Options > placeholder"),a(t)])])])])]),en,n("ul",null,[pn,on,ln,n("li",null,[cn,n("ul",null,[n("li",null,[n("a",rn,[s("DocSearch > Options > disableUserPersonalization"),a(t)])])])])]),un,n("ul",null,[dn,kn,n("li",null,[hn,n("ul",null,[n("li",null,[n("a",vn,[s("DocSearch > Options > initialQuery"),a(t)])])])])]),bn,n("ul",null,[mn,gn,n("li",null,[_n,n("ul",null,[n("li",null,[n("a",yn,[s("DocSearch > Options > translations"),a(t)])])])])]),fn,n("ul",null,[n("li",null,[s("参考: "),n("ul",null,[n("li",null,[a(p,{to:"/zh/guide/i18n.html"},{default:o(()=>[s("指南 > 多语言支持")]),_:1})])])])]),xn,n("ul",null,[Sn,n("li",null,[n("p",null,[s("默认值: "),a(p,{to:"/zh/reference/config.html#base"},{default:o(()=>[s("base")]),_:1})])]),n("li",null,[Dn,Pn,wn,n("p",null,[s("如果你不同部署域名下的 "),a(p,{to:"/zh/reference/config.html#base"},{default:o(()=>[s("base")]),_:1}),s(" 是不一样的,你就需要将这个配置设置成 "),In,s(" 的 "),a(p,{to:"/zh/reference/config.html#base"},{default:o(()=>[s("base")]),_:1}),s(" ,这样其他的部署域名就可以正确复用索引了。")])])]),qn,n("p",null,[s("你可以通过 "),n("a",En,[s("@docsearch/css"),a(t)]),s(" 提供的 CSS 变量来自定义样式:")]),Nn])}const Un=i(d,[["render",Rn],["__file","docsearch.html.vue"]]);export{Un as default}; diff --git a/assets/docsearch.html-fea1bb38.js b/assets/docsearch.html-fea1bb38.js new file mode 100644 index 00000000..504b192d --- /dev/null +++ b/assets/docsearch.html-fea1bb38.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-190c7f2e","path":"/zh/reference/plugin/docsearch.html","title":"docsearch","lang":"zh-CN","frontmatter":{"description":"将 Algolia DocSearch (https://docsearch.algolia.com/) 集成到 VuePress 中,为你的文档网站提供搜索功能。 当你正确配置该插件后,默认主题会把 DocSearch 按钮添加到导航栏。 该插件不一定能在其他主题中直接使用,因此你应参考主题本身的文档来获取更多信息。 使用方法 获取搜索索引 你需要 ...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/plugin/docsearch.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/plugin/docsearch.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"docsearch"}],["meta",{"property":"og:description","content":"将 Algolia DocSearch (https://docsearch.algolia.com/) 集成到 VuePress 中,为你的文档网站提供搜索功能。 当你正确配置该插件后,默认主题会把 DocSearch 按钮添加到导航栏。 该插件不一定能在其他主题中直接使用,因此你应参考主题本身的文档来获取更多信息。 使用方法 获取搜索索引 你需要 ..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"docsearch\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"获取搜索索引","slug":"获取搜索索引","link":"#获取搜索索引","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"apiKey","slug":"apikey","link":"#apikey","children":[]},{"level":3,"title":"indexName","slug":"indexname","link":"#indexname","children":[]},{"level":3,"title":"appId","slug":"appid","link":"#appid","children":[]},{"level":3,"title":"searchParameters","slug":"searchparameters","link":"#searchparameters","children":[]},{"level":3,"title":"placeholder","slug":"placeholder","link":"#placeholder","children":[]},{"level":3,"title":"disableUserPersonalization","slug":"disableuserpersonalization","link":"#disableuserpersonalization","children":[]},{"level":3,"title":"initialQuery","slug":"initialquery","link":"#initialquery","children":[]},{"level":3,"title":"translations","slug":"translations","link":"#translations","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]},{"level":3,"title":"indexBase","slug":"indexbase","link":"#indexbase","children":[]},{"level":3,"title":"injectStyles","slug":"injectstyles","link":"#injectstyles","children":[]}]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]},{"level":2,"title":"组件","slug":"组件","link":"#组件","children":[{"level":3,"title":"Docsearch","slug":"docsearch-1","link":"#docsearch-1","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":6.42,"words":1925},"filePathRelative":"zh/reference/plugin/docsearch.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/extending-a-theme-01-9eaa80a2.js b/assets/extending-a-theme-01-9eaa80a2.js new file mode 100644 index 00000000..5bdac7ac --- /dev/null +++ b/assets/extending-a-theme-01-9eaa80a2.js @@ -0,0 +1 @@ +const o="/images/cookbook/extending-a-theme-01.png";export{o as _}; diff --git a/assets/extending.html-1e64d2ab.js b/assets/extending.html-1e64d2ab.js new file mode 100644 index 00000000..502e4952 --- /dev/null +++ b/assets/extending.html-1e64d2ab.js @@ -0,0 +1,66 @@ +import{_ as c}from"./extending-a-theme-01-9eaa80a2.js";import{_ as l,W as i,X as u,$ as s,a0 as n,Y as a,Z as r,a1 as e,D as t}from"./framework-46b0e263.js";const d={},k=e(`

    继承

    VuePress 默认主题有着大量的用户,因此我们对它进行了一些便于继承的设计,以便用户轻松进行定制化。

    VuePress 提供了继承主题的基础能力,但不同的主题可能会提供不同的可继承的功能。因此,如果你使用的是一个社区主题的话,你最好参考主题本身的文档来了解如何继承它。

    布局插槽

    默认主题的 Layout 布局提供了一些插槽:

    • navbar
    • navbar-before
    • navbar-after
    • sidebar
    • sidebar-top
    • sidebar-bottom
    • page
    • page-top
    • page-bottom
    • page-content-top
    • page-content-bottom

    在它们的帮助下,你可以很容易地添加或替换内容。下面通过一个示例来介绍一下如何使用布局插槽来继承默认主题。

    首先,创建一个客户端配置文件 .vuepress/client.ts

    import { defineClientConfig } from "@vuepress/client";
    +import Layout from "./layouts/Layout.vue";
    +
    +export default defineClientConfig({
    +  layouts: {
    +    Layout,
    +  },
    +});
    +

    接下来,创建 .vuepress/layouts/Layout.vue ,并使用由默认主题的 Layout 布局提供的插槽:

    <script setup>
    +import ParentLayout from "@vuepress/theme-default/layouts/Layout.vue";
    +</script>
    +
    +<template>
    +  <ParentLayout>
    +    <template #page-bottom>
    +      <div class="my-footer">This is my custom page footer</div>
    +    </template>
    +  </ParentLayout>
    +</template>
    +
    +<style lang="css">
    +.my-footer {
    +  text-align: center;
    +}
    +</style>
    +

    此时默认的 Layout 布局已经被你的本地布局覆盖,将会在除了首页外的所有页面添加一个自定义的页脚:

    extending-a-theme

    组件替换

    布局插槽十分实用,但有时候你可能会觉得它不够灵活。默认主题同样提供了替换单个组件的能力。

    ',15),v={href:"https://github.com/vuepress/vuepress-next/tree/main/ecosystem/theme-default/src/client/components",target:"_blank",rel:"noopener noreferrer"},m=s("code",null,"@theme",-1),g=s("code",null,"HomeFooter.vue",-1),b=s("code",null,"@theme/HomeFooter.vue",-1),h=e(`

    接下来,如果你想要替换 HomeFooter.vue 组件,只需要在配置文件 .vuepress/config.ts 中覆盖这个别名即可:

    import { getDirname, path } from "@vuepress/utils";
    +import { defaultTheme, defineUserConfig } from "vuepress";
    +
    +const __dirname = getDirname(import.meta.url);
    +
    +export default defineUserConfig({
    +  theme: defaultTheme(),
    +  alias: {
    +    "@theme/HomeFooter.vue": path.resolve(
    +      __dirname,
    +      "./components/MyHomeFooter.vue"
    +    ),
    +  },
    +});
    +

    开发一个子主题

    除了在 .vuepress/config.ts.vuepress/client.ts 中直接扩展默认主题以外,你可以通过继承默认主题来开发一个你自己的主题:

    import type { Theme } from "@vuepress/core";
    +import {
    +  defaultTheme,
    +  type DefaultThemeOptions,
    +} from "@vuepress/theme-default";
    +import { getDirname, path } from "@vuepress/utils";
    +
    +const __dirname = getDirname(import.meta.url);
    +
    +export const childTheme = (options: DefaultThemeOptions): Theme => {
    +  return {
    +    name: "vuepress-theme-child",
    +    extends: defaultTheme(options),
    +
    +    // 在子主题的客户端配置文件中覆盖布局
    +    clientConfigFile: path.resolve(__dirname, "./client.js"),
    +
    +    // 覆盖组件别名
    +    alias: {
    +      "@theme/HomeFooter.vue": path.resolve(
    +        __dirname,
    +        "./components/MyHomeFooter.vue"
    +      ),
    +    },
    +  };
    +};
    +
    `,5);function y(f,_){const p=t("ExternalLinkIcon"),o=t("RouterLink");return i(),u("div",null,[k,s("p",null,[n("默认主题将所有 "),s("a",v,[n("非全局的组件"),a(p)]),n(" 都注册了一个带 "),m,n(" 前缀的 "),a(o,{to:"/zh/reference/plugin-api.html#alias"},{default:r(()=>[n("alias")]),_:1}),n(" 。例如,"),g,n(" 的别名是 "),b,n(" 。")]),h])}const x=l(d,[["render",y],["__file","extending.html.vue"]]);export{x as default}; diff --git a/assets/extending.html-475b2487.js b/assets/extending.html-475b2487.js new file mode 100644 index 00000000..a3d0b9f3 --- /dev/null +++ b/assets/extending.html-475b2487.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6175ace0","path":"/reference/default-theme/extending.html","title":"Extending","lang":"en-US","frontmatter":{"icon":"fa6-solid:clone","description":"VuePress default theme is widely used by users, so it is designed to be extendable, allowing users to make their own customization with ease. VuePress provides basic ability to ...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/default-theme/extending.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/default-theme/extending.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Extending"}],["meta",{"property":"og:description","content":"VuePress default theme is widely used by users, so it is designed to be extendable, allowing users to make their own customization with ease. VuePress provides basic ability to ..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Extending\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Layout Slots","slug":"layout-slots","link":"#layout-slots","children":[]},{"level":2,"title":"Components Replacement","slug":"components-replacement","link":"#components-replacement","children":[]},{"level":2,"title":"Developing a Child Theme","slug":"developing-a-child-theme","link":"#developing-a-child-theme","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.56,"words":468},"filePathRelative":"reference/default-theme/extending.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/extending.html-d6c7b1f5.js b/assets/extending.html-d6c7b1f5.js new file mode 100644 index 00000000..d878f446 --- /dev/null +++ b/assets/extending.html-d6c7b1f5.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-90ed1862","path":"/zh/reference/default-theme/extending.html","title":"继承","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:clone","description":"VuePress 默认主题有着大量的用户,因此我们对它进行了一些便于继承的设计,以便用户轻松进行定制化。 VuePress 提供了继承主题的基础能力,但不同的主题可能会提供不同的可继承的功能。因此,如果你使用的是一个社区主题的话,你最好参考主题本身的文档来了解如何继承它。 布局插槽 默认主题的 Layout 布局提供了一些插槽: navbar; nav...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/default-theme/extending.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/default-theme/extending.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"继承"}],["meta",{"property":"og:description","content":"VuePress 默认主题有着大量的用户,因此我们对它进行了一些便于继承的设计,以便用户轻松进行定制化。 VuePress 提供了继承主题的基础能力,但不同的主题可能会提供不同的可继承的功能。因此,如果你使用的是一个社区主题的话,你最好参考主题本身的文档来了解如何继承它。 布局插槽 默认主题的 Layout 布局提供了一些插槽: navbar; nav..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"继承\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"布局插槽","slug":"布局插槽","link":"#布局插槽","children":[]},{"level":2,"title":"组件替换","slug":"组件替换","link":"#组件替换","children":[]},{"level":2,"title":"开发一个子主题","slug":"开发一个子主题","link":"#开发一个子主题","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":2.14,"words":643},"filePathRelative":"zh/reference/default-theme/extending.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/extending.html-f332bc2d.js b/assets/extending.html-f332bc2d.js new file mode 100644 index 00000000..a16b4e7a --- /dev/null +++ b/assets/extending.html-f332bc2d.js @@ -0,0 +1,66 @@ +import{_ as c}from"./extending-a-theme-01-9eaa80a2.js";import{_ as i,W as l,X as u,$ as s,a0 as n,Y as a,Z as r,a1 as t,D as e}from"./framework-46b0e263.js";const d={},k=t(`

    Extending

    VuePress default theme is widely used by users, so it is designed to be extendable, allowing users to make their own customization with ease.

    VuePress provides basic ability to extend a theme, but different themes may have different features to be extended. Thus, if you are using a community theme, you'd better refer to the theme's own documentation for how to extending it.

    Layout Slots

    Default theme's Layout provides some slots:

    • navbar
    • navbar-before
    • navbar-after
    • sidebar
    • sidebar-top
    • sidebar-bottom
    • page
    • page-top
    • page-bottom
    • page-content-top
    • page-content-bottom

    With the help of them, you can add or replace content easily. Here comes an example to introduce how to extend default theme with layout slots.

    Firstly, create a client config file .vuepress/client.ts:

    import { defineClientConfig } from "@vuepress/client";
    +import Layout from "./layouts/Layout.vue";
    +
    +export default defineClientConfig({
    +  layouts: {
    +    Layout,
    +  },
    +});
    +

    Next, create the .vuepress/layouts/Layout.vue, and make use of the slots that provided by the Layout of default theme:

    <script setup>
    +import ParentLayout from "@vuepress/theme-default/layouts/Layout.vue";
    +</script>
    +
    +<template>
    +  <ParentLayout>
    +    <template #page-bottom>
    +      <div class="my-footer">This is my custom page footer</div>
    +    </template>
    +  </ParentLayout>
    +</template>
    +
    +<style lang="css">
    +.my-footer {
    +  text-align: center;
    +}
    +</style>
    +

    Then the default Layout layout has been overridden by your own local layout, which will add a custom footer to every normal pages in default theme (excluding homepage):

    extending-a-theme

    Components Replacement

    The layout slots are useful, but sometimes you might find it's not flexible enough. Default theme also provides the ability to replace a single component.

    ',15),m={href:"https://github.com/vuepress/vuepress-next/tree/main/ecosystem/theme-default/src/client/components",target:"_blank",rel:"noopener noreferrer"},v=s("code",null,"@theme",-1),h=s("code",null,"HomeFooter.vue",-1),g=s("code",null,"@theme/HomeFooter.vue",-1),b=t(`

    Then, if you want to replace the HomeFooter.vue component, just override the alias in your config file .vuepress/config.ts:

    import { getDirname, path } from "@vuepress/utils";
    +import { defaultTheme, defineUserConfig } from "vuepress";
    +
    +const __dirname = getDirname(import.meta.url);
    +
    +export default defineUserConfig({
    +  theme: defaultTheme(),
    +  alias: {
    +    "@theme/HomeFooter.vue": path.resolve(
    +      __dirname,
    +      "./components/MyHomeFooter.vue"
    +    ),
    +  },
    +});
    +

    Developing a Child Theme

    Instead of extending the default theme directly in .vuepress/config.ts and .vuepress/client.ts, you can also develop your own theme extending the default theme:

    import type { Theme } from "@vuepress/core";
    +import {
    +  defaultTheme,
    +  type DefaultThemeOptions,
    +} from "@vuepress/theme-default";
    +import { getDirname, path } from "@vuepress/utils";
    +
    +const __dirname = getDirname(import.meta.url);
    +
    +export const childTheme = (options: DefaultThemeOptions): Theme => {
    +  return {
    +    name: "vuepress-theme-child",
    +    extends: defaultTheme(options),
    +
    +    // override layouts in child theme's client config file
    +    clientConfigFile: path.resolve(__dirname, "./client.js"),
    +
    +    // override component alias
    +    alias: {
    +      "@theme/HomeFooter.vue": path.resolve(
    +        __dirname,
    +        "./components/MyHomeFooter.vue"
    +      ),
    +    },
    +  };
    +};
    +
    `,5);function y(f,w){const o=e("RouterLink"),p=e("ExternalLinkIcon");return l(),u("div",null,[k,s("p",null,[n("Default theme has registered "),a(o,{to:"/reference/plugin-api.html#alias"},{default:r(()=>[n("alias")]),_:1}),n(" for every "),s("a",m,[n("non-global components"),a(p)]),n(" with a "),v,n(" prefix. For example, the alias of "),h,n(" is "),g,n(".")]),b])}const q=i(d,[["render",y],["__file","extending.html.vue"]]);export{q as default}; diff --git a/assets/external-link-icon.html-57fd9332.js b/assets/external-link-icon.html-57fd9332.js new file mode 100644 index 00000000..0d25eb7b --- /dev/null +++ b/assets/external-link-icon.html-57fd9332.js @@ -0,0 +1,25 @@ +import{_ as p,W as c,X as r,Y as s,$ as n,a0 as a,Z as u,a1 as t,D as e}from"./framework-46b0e263.js";const d={},k=n("h1",{id:"external-link-icon",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#external-link-icon","aria-hidden":"true"},"#"),a(" external-link-icon")],-1),h=t(`

    This plugin has been integrated into the default theme.

    Usage

    npm i -D @vuepress/plugin-external-link-icon@next
    +
    import { externalLinkIconPlugin } from "@vuepress/plugin-external-link-icon";
    +
    +export default {
    +  plugins: [
    +    externalLinkIconPlugin({
    +      // options
    +    }),
    +  ],
    +};
    +

    Options

    locales

    • Type: Record<string, { openInNewWindow: string }>

    • Details:

      The a11y text of the external link icon in different locales.

      If this option is not specified, it will fallback to default text.

    • Example:

    export default {
    +  plugins: [
    +    externalLinkIconPlugin({
    +      locales: {
    +        "/": {
    +          openInNewWindow: "open in new window",
    +        },
    +        "/zh/": {
    +          openInNewWindow: "在新窗口打开",
    +        },
    +      },
    +    }),
    +  ],
    +};
    +
    `,8),v=t('

    Frontmatter

    externalLinkIcon

    • Type: boolean

    • Details:

      Whether to append an external link icon to external links in current page.

    Styles

    You can customize the style of the external link icon via CSS variables:

    File not found

    Components

    ExternalLinkIcon

    • Details:

      This plugin will register a <ExternalLinkIcon /> component globally, and you can use it without any props.

    Tips

    This component is mainly used for theme development. You don't need to use it directly in most cases.

    ',10);function m(b,x){const i=e("NpmBadge"),o=e("ExternalLinkIcon"),l=e("RouterLink");return c(),r("div",null,[k,s(i,{package:"@vuepress/plugin-external-link-icon"}),n("p",null,[a("This plugin will add an icon to the external link in your markdown content, i.e. "),s(o)]),h,n("ul",null,[n("li",null,[a("Also see: "),n("ul",null,[n("li",null,[s(l,{to:"/guide/i18n.html"},{default:u(()=>[a("Guide > I18n")]),_:1})])])])]),v])}const f=p(d,[["render",m],["__file","external-link-icon.html.vue"]]);export{f as default}; diff --git a/assets/external-link-icon.html-58c8c6e2.js b/assets/external-link-icon.html-58c8c6e2.js new file mode 100644 index 00000000..2a000155 --- /dev/null +++ b/assets/external-link-icon.html-58c8c6e2.js @@ -0,0 +1,25 @@ +import{_ as p,W as c,X as r,Y as s,$ as n,a0 as a,Z as u,a1 as t,D as e}from"./framework-46b0e263.js";const d={},k=n("h1",{id:"external-link-icon",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#external-link-icon","aria-hidden":"true"},"#"),a(" external-link-icon")],-1),v=t(`

    该插件已经集成到默认主题中。

    使用方法

    npm i -D @vuepress/plugin-external-link-icon@next
    +
    import { externalLinkIconPlugin } from "@vuepress/plugin-external-link-icon";
    +
    +export default {
    +  plugins: [
    +    externalLinkIconPlugin({
    +      // 配置项
    +    }),
    +  ],
    +};
    +

    配置项

    locales

    • 类型: Record<string, { openInNewWindow: string }>

    • 详情:

      外部链接图标在不同 locales 下的 A11y 文字。

      如果没有指定该配置项,它会降级使用默认文字。

    • 示例:

    export default {
    +  plugins: [
    +    externalLinkIconPlugin({
    +      locales: {
    +        "/": {
    +          openInNewWindow: "open in new window",
    +        },
    +        "/zh/": {
    +          openInNewWindow: "在新窗口打开",
    +        },
    +      },
    +    }),
    +  ],
    +};
    +
    `,8),h=t('

    Frontmatter

    externalLinkIcon

    • 类型: boolean

    • 详情:

      是否在当前页面的外部链接的后面添加外部链接图标。

    样式

    你可以通过 CSS 变量来自定义外部链接图标的样式:

    File not found

    组件

    ExternalLinkIcon

    • 详情:

      该插件会全局注册一个 <ExternalLinkIcon /> 组件,你可以不传入任何 Props 来使用它。

    提示

    该组件主要用于主题开发。在大多数情况下你不需要直接使用该组件。

    ',10);function m(b,x){const i=e("NpmBadge"),l=e("ExternalLinkIcon"),o=e("RouterLink");return c(),r("div",null,[k,s(i,{package:"@vuepress/plugin-external-link-icon"}),n("p",null,[a("该插件会为你 Markdown 内容中的外部链接添加一个图标,即 "),s(l)]),v,n("ul",null,[n("li",null,[a("参考: "),n("ul",null,[n("li",null,[s(o,{to:"/zh/guide/i18n.html"},{default:u(()=>[a("指南 > 多语言支持")]),_:1})])])])]),h])}const f=p(d,[["render",m],["__file","external-link-icon.html.vue"]]);export{f as default}; diff --git a/assets/external-link-icon.html-b9e0c3f1.js b/assets/external-link-icon.html-b9e0c3f1.js new file mode 100644 index 00000000..cf25673b --- /dev/null +++ b/assets/external-link-icon.html-b9e0c3f1.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5c864690","path":"/reference/plugin/external-link-icon.html","title":"external-link-icon","lang":"en-US","frontmatter":{"description":"This plugin will add an icon to the external link in your markdown content, i.e. This plugin has been integrated into the default theme. Usage Options locales Type: Record; Deta...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/plugin/external-link-icon.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/plugin/external-link-icon.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"external-link-icon"}],["meta",{"property":"og:description","content":"This plugin will add an icon to the external link in your markdown content, i.e. This plugin has been integrated into the default theme. Usage Options locales Type: Record; Deta..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"external-link-icon\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[{"level":3,"title":"externalLinkIcon","slug":"externallinkicon","link":"#externallinkicon","children":[]}]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]},{"level":2,"title":"Components","slug":"components","link":"#components","children":[{"level":3,"title":"ExternalLinkIcon","slug":"externallinkicon-1","link":"#externallinkicon-1","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.7,"words":210},"filePathRelative":"reference/plugin/external-link-icon.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/external-link-icon.html-bf5c4074.js b/assets/external-link-icon.html-bf5c4074.js new file mode 100644 index 00000000..03f3d3d6 --- /dev/null +++ b/assets/external-link-icon.html-bf5c4074.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7cc40dbf","path":"/zh/reference/plugin/external-link-icon.html","title":"external-link-icon","lang":"zh-CN","frontmatter":{"description":"该插件会为你 Markdown 内容中的外部链接添加一个图标,即 该插件已经集成到默认主题中。 使用方法 配置项 locales 类型: Record; 详情:; 外部链接图标在不同 locales 下的 A11y 文字。 如果没有指定该配置项,它会降级使用默认文字。 示例:; 参考:; 指南 > 多语言支持 (../../guide/i18n.md)...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/plugin/external-link-icon.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/plugin/external-link-icon.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"external-link-icon"}],["meta",{"property":"og:description","content":"该插件会为你 Markdown 内容中的外部链接添加一个图标,即 该插件已经集成到默认主题中。 使用方法 配置项 locales 类型: Record; 详情:; 外部链接图标在不同 locales 下的 A11y 文字。 如果没有指定该配置项,它会降级使用默认文字。 示例:; 参考:; 指南 > 多语言支持 (../../guide/i18n.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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"external-link-icon\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[{"level":3,"title":"externalLinkIcon","slug":"externallinkicon","link":"#externallinkicon","children":[]}]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]},{"level":2,"title":"组件","slug":"组件","link":"#组件","children":[{"level":3,"title":"ExternalLinkIcon","slug":"externallinkicon-1","link":"#externallinkicon-1","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.97,"words":291},"filePathRelative":"zh/reference/plugin/external-link-icon.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/framework-46b0e263.js b/assets/framework-46b0e263.js new file mode 100644 index 00000000..e22dcdd9 --- /dev/null +++ b/assets/framework-46b0e263.js @@ -0,0 +1,5 @@ +function cs(e,t){const n=Object.create(null),s=e.split(",");for(let r=0;r!!n[r.toLowerCase()]:r=>!!n[r]}function us(e){if(U(e)){const t={};for(let n=0;n{if(n){const s=n.split(Zi);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function fs(e){let t="";if(pe(e))t=e;else if(U(e))for(let n=0;npe(e)?e:e==null?"":U(e)||ce(e)&&(e.toString===Lr||!V(e.toString))?JSON.stringify(e,Ir,2):String(e),Ir=(e,t)=>t&&t.__v_isRef?Ir(e,t.value):Ct(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r])=>(n[`${s} =>`]=r,n),{})}:Nr(t)?{[`Set(${t.size})`]:[...t.values()]}:ce(t)&&!U(t)&&!$r(t)?String(t):t,ue={},Et=[],He=()=>{},so=()=>!1,ro=/^on[^a-z]/,en=e=>ro.test(e),as=e=>e.startsWith("onUpdate:"),ge=Object.assign,ds=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},io=Object.prototype.hasOwnProperty,ne=(e,t)=>io.call(e,t),U=Array.isArray,Ct=e=>Pn(e)==="[object Map]",Nr=e=>Pn(e)==="[object Set]",V=e=>typeof e=="function",pe=e=>typeof e=="string",hs=e=>typeof e=="symbol",ce=e=>e!==null&&typeof e=="object",Fr=e=>ce(e)&&V(e.then)&&V(e.catch),Lr=Object.prototype.toString,Pn=e=>Lr.call(e),oo=e=>Pn(e).slice(8,-1),$r=e=>Pn(e)==="[object Object]",ps=e=>pe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,jt=cs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Tn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},lo=/-(\w)/g,We=Tn(e=>e.replace(lo,(t,n)=>n?n.toUpperCase():"")),co=/\B([A-Z])/g,It=Tn(e=>e.replace(co,"-$1").toLowerCase()),An=Tn(e=>e.charAt(0).toUpperCase()+e.slice(1)),$n=Tn(e=>e?`on${An(e)}`:""),Vt=(e,t)=>!Object.is(e,t),kn=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},uo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},fo=e=>{const t=pe(e)?Number(e):NaN;return isNaN(t)?e:t};let $s;const ao=()=>$s||($s=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});let we;class ho{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=we,!t&&we&&(this.index=(we.scopes||(we.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=we;try{return we=this,t()}finally{we=n}}}on(){we=this}off(){we=this.parent}stop(t){if(this._active){let n,s;for(n=0,s=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},kr=e=>(e.w&it)>0,Hr=e=>(e.n&it)>0,mo=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let s=0;s{(f==="length"||f>=c)&&l.push(a)})}else switch(n!==void 0&&l.push(o.get(n)),t){case"add":U(e)?ps(n)&&l.push(o.get("length")):(l.push(o.get(pt)),Ct(e)&&l.push(o.get(Jn)));break;case"delete":U(e)||(l.push(o.get(pt)),Ct(e)&&l.push(o.get(Jn)));break;case"set":Ct(e)&&l.push(o.get(pt));break}if(l.length===1)l[0]&&Xn(l[0]);else{const c=[];for(const a of l)a&&c.push(...a);Xn(gs(c))}}function Xn(e,t){const n=U(e)?e:[...e];for(const s of n)s.computed&&Hs(s);for(const s of n)s.computed||Hs(s)}function Hs(e,t){(e!==$e||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}function yo(e,t){var n;return(n=bn.get(e))===null||n===void 0?void 0:n.get(t)}const bo=cs("__proto__,__v_isRef,__isVue"),Dr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(hs)),vo=_s(),Eo=_s(!1,!0),Co=_s(!0),js=xo();function xo(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const s=G(this);for(let i=0,o=this.length;i{e[t]=function(...n){Nt();const s=G(this)[t].apply(this,n);return Ft(),s}}),e}function wo(e){const t=G(this);return Ce(t,"has",e),t.hasOwnProperty(e)}function _s(e=!1,t=!1){return function(s,r,i){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_isShallow")return t;if(r==="__v_raw"&&i===(e?t?Bo:Vr:t?qr:Wr).get(s))return s;const o=U(s);if(!e){if(o&&ne(js,r))return Reflect.get(js,r,i);if(r==="hasOwnProperty")return wo}const l=Reflect.get(s,r,i);return(hs(r)?Dr.has(r):bo(r))||(e||Ce(s,"get",r),t)?l:me(l)?o&&ps(r)?l:l.value:ce(l)?e?zr(l):tn(l):l}}const Ro=Ur(),Po=Ur(!0);function Ur(e=!1){return function(n,s,r,i){let o=n[s];if(Pt(o)&&me(o)&&!me(r))return!1;if(!e&&(!vn(r)&&!Pt(r)&&(o=G(o),r=G(r)),!U(n)&&me(o)&&!me(r)))return o.value=r,!0;const l=U(n)&&ps(s)?Number(s)e,On=e=>Reflect.getPrototypeOf(e);function on(e,t,n=!1,s=!1){e=e.__v_raw;const r=G(e),i=G(t);n||(t!==i&&Ce(r,"get",t),Ce(r,"get",i));const{has:o}=On(r),l=s?ys:n?Es:zt;if(o.call(r,t))return l(e.get(t));if(o.call(r,i))return l(e.get(i));e!==r&&e.get(t)}function ln(e,t=!1){const n=this.__v_raw,s=G(n),r=G(e);return t||(e!==r&&Ce(s,"has",e),Ce(s,"has",r)),e===r?n.has(e):n.has(e)||n.has(r)}function cn(e,t=!1){return e=e.__v_raw,!t&&Ce(G(e),"iterate",pt),Reflect.get(e,"size",e)}function Bs(e){e=G(e);const t=G(this);return On(t).has.call(t,e)||(t.add(e),Qe(t,"add",e,e)),this}function Ds(e,t){t=G(t);const n=G(this),{has:s,get:r}=On(n);let i=s.call(n,e);i||(e=G(e),i=s.call(n,e));const o=r.call(n,e);return n.set(e,t),i?Vt(t,o)&&Qe(n,"set",e,t):Qe(n,"add",e,t),this}function Us(e){const t=G(this),{has:n,get:s}=On(t);let r=n.call(t,e);r||(e=G(e),r=n.call(t,e)),s&&s.call(t,e);const i=t.delete(e);return r&&Qe(t,"delete",e,void 0),i}function Ks(){const e=G(this),t=e.size!==0,n=e.clear();return t&&Qe(e,"clear",void 0,void 0),n}function un(e,t){return function(s,r){const i=this,o=i.__v_raw,l=G(o),c=t?ys:e?Es:zt;return!e&&Ce(l,"iterate",pt),o.forEach((a,f)=>s.call(r,c(a),c(f),i))}}function fn(e,t,n){return function(...s){const r=this.__v_raw,i=G(r),o=Ct(i),l=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,a=r[e](...s),f=n?ys:t?Es:zt;return!t&&Ce(i,"iterate",c?Jn:pt),{next(){const{value:h,done:p}=a.next();return p?{value:h,done:p}:{value:l?[f(h[0]),f(h[1])]:f(h),done:p}},[Symbol.iterator](){return this}}}}function Je(e){return function(...t){return e==="delete"?!1:this}}function Io(){const e={get(i){return on(this,i)},get size(){return cn(this)},has:ln,add:Bs,set:Ds,delete:Us,clear:Ks,forEach:un(!1,!1)},t={get(i){return on(this,i,!1,!0)},get size(){return cn(this)},has:ln,add:Bs,set:Ds,delete:Us,clear:Ks,forEach:un(!1,!0)},n={get(i){return on(this,i,!0)},get size(){return cn(this,!0)},has(i){return ln.call(this,i,!0)},add:Je("add"),set:Je("set"),delete:Je("delete"),clear:Je("clear"),forEach:un(!0,!1)},s={get(i){return on(this,i,!0,!0)},get size(){return cn(this,!0)},has(i){return ln.call(this,i,!0)},add:Je("add"),set:Je("set"),delete:Je("delete"),clear:Je("clear"),forEach:un(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=fn(i,!1,!1),n[i]=fn(i,!0,!1),t[i]=fn(i,!1,!0),s[i]=fn(i,!0,!0)}),[e,n,t,s]}const[No,Fo,Lo,$o]=Io();function bs(e,t){const n=t?e?$o:Lo:e?Fo:No;return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(ne(n,r)&&r in s?n:s,r,i)}const ko={get:bs(!1,!1)},Ho={get:bs(!1,!0)},jo={get:bs(!0,!1)},Wr=new WeakMap,qr=new WeakMap,Vr=new WeakMap,Bo=new WeakMap;function Do(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Uo(e){return e.__v_skip||!Object.isExtensible(e)?0:Do(oo(e))}function tn(e){return Pt(e)?e:vs(e,!1,Kr,ko,Wr)}function Ko(e){return vs(e,!1,Mo,Ho,qr)}function zr(e){return vs(e,!0,So,jo,Vr)}function vs(e,t,n,s,r){if(!ce(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=Uo(e);if(o===0)return e;const l=new Proxy(e,o===2?s:n);return r.set(e,l),l}function xt(e){return Pt(e)?xt(e.__v_raw):!!(e&&e.__v_isReactive)}function Pt(e){return!!(e&&e.__v_isReadonly)}function vn(e){return!!(e&&e.__v_isShallow)}function Qr(e){return xt(e)||Pt(e)}function G(e){const t=e&&e.__v_raw;return t?G(t):e}function Yr(e){return yn(e,"__v_skip",!0),e}const zt=e=>ce(e)?tn(e):e,Es=e=>ce(e)?zr(e):e;function Jr(e){st&&$e&&(e=G(e),Br(e.dep||(e.dep=gs())))}function Xr(e,t){e=G(e);const n=e.dep;n&&Xn(n)}function me(e){return!!(e&&e.__v_isRef===!0)}function pn(e){return Zr(e,!1)}function Wo(e){return Zr(e,!0)}function Zr(e,t){return me(e)?e:new qo(e,t)}class qo{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:G(t),this._value=n?t:zt(t)}get value(){return Jr(this),this._value}set value(t){const n=this.__v_isShallow||vn(t)||Pt(t);t=n?t:G(t),Vt(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:zt(t),Xr(this))}}function wt(e){return me(e)?e.value:e}const Vo={get:(e,t,n)=>wt(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return me(r)&&!me(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Gr(e){return xt(e)?e:new Proxy(e,Vo)}class zo{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return yo(G(this._object),this._key)}}function Hu(e,t,n){const s=e[t];return me(s)?s:new zo(e,t,n)}var ei;class Qo{constructor(t,n,s,r){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this[ei]=!1,this._dirty=!0,this.effect=new ms(t,()=>{this._dirty||(this._dirty=!0,Xr(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=s}get value(){const t=G(this);return Jr(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}ei="__v_isReadonly";function Yo(e,t,n=!1){let s,r;const i=V(e);return i?(s=e,r=He):(s=e.get,r=e.set),new Qo(s,r,i||!r,n)}function rt(e,t,n,s){let r;try{r=s?e(...s):e()}catch(i){nn(i,t,n)}return r}function Se(e,t,n,s){if(V(e)){const i=rt(e,t,n,s);return i&&Fr(i)&&i.catch(o=>{nn(o,t,n)}),i}const r=[];for(let i=0;i>>1;Yt(ye[s])Ke&&ye.splice(t,1)}function Go(e){U(e)?Rt.push(...e):(!ze||!ze.includes(e,e.allowRecurse?at+1:at))&&Rt.push(e),si()}function Ws(e,t=Qt?Ke+1:0){for(;tYt(n)-Yt(s)),at=0;ate.id==null?1/0:e.id,el=(e,t)=>{const n=Yt(e)-Yt(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function ri(e){Zn=!1,Qt=!0,ye.sort(el);const t=He;try{for(Ke=0;Kepe(_)?_.trim():_)),h&&(r=n.map(uo))}let l,c=s[l=$n(t)]||s[l=$n(We(t))];!c&&i&&(c=s[l=$n(It(t))]),c&&Se(c,e,6,r);const a=s[l+"Once"];if(a){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Se(a,e,6,r)}}function ii(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!V(e)){const c=a=>{const f=ii(a,t,!0);f&&(l=!0,ge(o,f))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!l?(ce(e)&&s.set(e,null),null):(U(i)?i.forEach(c=>o[c]=null):ge(o,i),ce(e)&&s.set(e,o),o)}function Mn(e,t){return!e||!en(t)?!1:(t=t.slice(2).replace(/Once$/,""),ne(e,t[0].toLowerCase()+t.slice(1))||ne(e,It(t))||ne(e,t))}let Oe=null,oi=null;function Cn(e){const t=Oe;return Oe=e,oi=e&&e.type.__scopeId||null,t}function nl(e,t=Oe,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&er(-1);const i=Cn(t);let o;try{o=e(...r)}finally{Cn(i),s._d&&er(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Hn(e){const{type:t,vnode:n,proxy:s,withProxy:r,props:i,propsOptions:[o],slots:l,attrs:c,emit:a,render:f,renderCache:h,data:p,setupState:_,ctx:C,inheritAttrs:T}=e;let $,g;const y=Cn(e);try{if(n.shapeFlag&4){const k=r||s;$=Le(f.call(k,k,h,i,_,p,C)),g=c}else{const k=t;$=Le(k.length>1?k(i,{attrs:c,slots:l,emit:a}):k(i,null)),g=t.props?c:sl(c)}}catch(k){Kt.length=0,nn(k,e,1),$=de(Me)}let P=$;if(g&&T!==!1){const k=Object.keys(g),{shapeFlag:D}=P;k.length&&D&7&&(o&&k.some(as)&&(g=rl(g,o)),P=ot(P,g))}return n.dirs&&(P=ot(P),P.dirs=P.dirs?P.dirs.concat(n.dirs):n.dirs),n.transition&&(P.transition=n.transition),$=P,Cn(y),$}const sl=e=>{let t;for(const n in e)(n==="class"||n==="style"||en(n))&&((t||(t={}))[n]=e[n]);return t},rl=(e,t)=>{const n={};for(const s in e)(!as(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function il(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:c}=t,a=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?qs(s,o,a):!!o;if(c&8){const f=t.dynamicProps;for(let h=0;he.__isSuspense;function li(e,t){t&&t.pendingBranch?U(e)?t.effects.push(...e):t.effects.push(e):Go(e)}function gn(e,t){if(ae){let n=ae.provides;const s=ae.parent&&ae.parent.provides;s===n&&(n=ae.provides=Object.create(s)),n[e]=t}}function je(e,t,n=!1){const s=ae||Oe;if(s){const r=s.parent==null?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides;if(r&&e in r)return r[e];if(arguments.length>1)return n&&V(t)?t.call(s.proxy):t}}function ju(e,t){return xs(e,null,t)}const an={};function mn(e,t,n){return xs(e,t,n)}function xs(e,t,{immediate:n,deep:s,flush:r,onTrack:i,onTrigger:o}=ue){const l=go()===(ae==null?void 0:ae.scope)?ae:null;let c,a=!1,f=!1;if(me(e)?(c=()=>e.value,a=vn(e)):xt(e)?(c=()=>e,s=!0):U(e)?(f=!0,a=e.some(P=>xt(P)||vn(P)),c=()=>e.map(P=>{if(me(P))return P.value;if(xt(P))return vt(P);if(V(P))return rt(P,l,2)})):V(e)?t?c=()=>rt(e,l,2):c=()=>{if(!(l&&l.isUnmounted))return h&&h(),Se(e,l,3,[p])}:c=He,t&&s){const P=c;c=()=>vt(P())}let h,p=P=>{h=g.onStop=()=>{rt(P,l,4)}},_;if(Ot)if(p=He,t?n&&Se(t,l,3,[c(),f?[]:void 0,p]):c(),r==="sync"){const P=tc();_=P.__watcherHandles||(P.__watcherHandles=[])}else return He;let C=f?new Array(e.length).fill(an):an;const T=()=>{if(g.active)if(t){const P=g.run();(s||a||(f?P.some((k,D)=>Vt(k,C[D])):Vt(P,C)))&&(h&&h(),Se(t,l,3,[P,C===an?void 0:f&&C[0]===an?[]:C,p]),C=P)}else g.run()};T.allowRecurse=!!t;let $;r==="sync"?$=T:r==="post"?$=()=>Ee(T,l&&l.suspense):(T.pre=!0,l&&(T.id=l.uid),$=()=>Sn(T));const g=new ms(c,$);t?n?T():C=g.run():r==="post"?Ee(g.run.bind(g),l&&l.suspense):g.run();const y=()=>{g.stop(),l&&l.scope&&ds(l.scope.effects,g)};return _&&_.push(y),y}function cl(e,t,n){const s=this.proxy,r=pe(e)?e.includes(".")?ci(s,e):()=>s[e]:e.bind(s,s);let i;V(t)?i=t:(i=t.handler,n=t);const o=ae;At(this);const l=xs(r,i.bind(s),n);return o?At(o):gt(),l}function ci(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r{vt(n,t)});else if($r(e))for(const n in e)vt(e[n],t);return e}function ui(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return hi(()=>{e.isMounted=!0}),gi(()=>{e.isUnmounting=!0}),e}const Pe=[Function,Array],ul={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Pe,onEnter:Pe,onAfterEnter:Pe,onEnterCancelled:Pe,onBeforeLeave:Pe,onLeave:Pe,onAfterLeave:Pe,onLeaveCancelled:Pe,onBeforeAppear:Pe,onAppear:Pe,onAfterAppear:Pe,onAppearCancelled:Pe},setup(e,{slots:t}){const n=Si(),s=ui();let r;return()=>{const i=t.default&&ws(t.default(),!0);if(!i||!i.length)return;let o=i[0];if(i.length>1){for(const T of i)if(T.type!==Me){o=T;break}}const l=G(e),{mode:c}=l;if(s.isLeaving)return jn(o);const a=Vs(o);if(!a)return jn(o);const f=Jt(a,l,s,n);Xt(a,f);const h=n.subTree,p=h&&Vs(h);let _=!1;const{getTransitionKey:C}=a.type;if(C){const T=C();r===void 0?r=T:T!==r&&(r=T,_=!0)}if(p&&p.type!==Me&&(!dt(a,p)||_)){const T=Jt(p,l,s,n);if(Xt(p,T),c==="out-in")return s.isLeaving=!0,T.afterLeave=()=>{s.isLeaving=!1,n.update.active!==!1&&n.update()},jn(o);c==="in-out"&&a.type!==Me&&(T.delayLeave=($,g,y)=>{const P=ai(s,p);P[String(p.key)]=p,$._leaveCb=()=>{g(),$._leaveCb=void 0,delete f.delayedLeave},f.delayedLeave=y})}return o}}},fi=ul;function ai(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Jt(e,t,n,s){const{appear:r,mode:i,persisted:o=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:a,onEnterCancelled:f,onBeforeLeave:h,onLeave:p,onAfterLeave:_,onLeaveCancelled:C,onBeforeAppear:T,onAppear:$,onAfterAppear:g,onAppearCancelled:y}=t,P=String(e.key),k=ai(n,e),D=(S,q)=>{S&&Se(S,s,9,q)},J=(S,q)=>{const K=q[1];D(S,q),U(S)?S.every(Z=>Z.length<=1)&&K():S.length<=1&&K()},z={mode:i,persisted:o,beforeEnter(S){let q=l;if(!n.isMounted)if(r)q=T||l;else return;S._leaveCb&&S._leaveCb(!0);const K=k[P];K&&dt(e,K)&&K.el._leaveCb&&K.el._leaveCb(),D(q,[S])},enter(S){let q=c,K=a,Z=f;if(!n.isMounted)if(r)q=$||c,K=g||a,Z=y||f;else return;let N=!1;const Q=S._enterCb=L=>{N||(N=!0,L?D(Z,[S]):D(K,[S]),z.delayedLeave&&z.delayedLeave(),S._enterCb=void 0)};q?J(q,[S,Q]):Q()},leave(S,q){const K=String(e.key);if(S._enterCb&&S._enterCb(!0),n.isUnmounting)return q();D(h,[S]);let Z=!1;const N=S._leaveCb=Q=>{Z||(Z=!0,q(),Q?D(C,[S]):D(_,[S]),S._leaveCb=void 0,k[K]===e&&delete k[K])};k[K]=e,p?J(p,[S,N]):N()},clone(S){return Jt(S,t,n,s)}};return z}function jn(e){if(sn(e))return e=ot(e),e.children=null,e}function Vs(e){return sn(e)?e.children?e.children[0]:void 0:e}function Xt(e,t){e.shapeFlag&6&&e.component?Xt(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ws(e,t=!1,n){let s=[],r=0;for(let i=0;i1)for(let i=0;i!!e.type.__asyncLoader;function Bu(e){V(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:r=200,timeout:i,suspensible:o=!0,onError:l}=e;let c=null,a,f=0;const h=()=>(f++,c=null,p()),p=()=>{let _;return c||(_=c=t().catch(C=>{if(C=C instanceof Error?C:new Error(String(C)),l)return new Promise((T,$)=>{l(C,()=>T(h()),()=>$(C),f+1)});throw C}).then(C=>_!==c&&c?c:(C&&(C.__esModule||C[Symbol.toStringTag]==="Module")&&(C=C.default),a=C,C)))};return Rs({name:"AsyncComponentWrapper",__asyncLoader:p,get __asyncResolved(){return a},setup(){const _=ae;if(a)return()=>Bn(a,_);const C=y=>{c=null,nn(y,_,13,!s)};if(o&&_.suspense||Ot)return p().then(y=>()=>Bn(y,_)).catch(y=>(C(y),()=>s?de(s,{error:y}):null));const T=pn(!1),$=pn(),g=pn(!!r);return r&&setTimeout(()=>{g.value=!1},r),i!=null&&setTimeout(()=>{if(!T.value&&!$.value){const y=new Error(`Async component timed out after ${i}ms.`);C(y),$.value=y}},i),p().then(()=>{T.value=!0,_.parent&&sn(_.parent.vnode)&&Sn(_.parent.update)}).catch(y=>{C(y),$.value=y}),()=>{if(T.value&&a)return Bn(a,_);if($.value&&s)return de(s,{error:$.value});if(n&&!g.value)return de(n)}}})}function Bn(e,t){const{ref:n,props:s,children:r,ce:i}=t.vnode,o=de(e,s,r);return o.ref=n,o.ce=i,delete t.vnode.ce,o}const sn=e=>e.type.__isKeepAlive;function fl(e,t){di(e,"a",t)}function al(e,t){di(e,"da",t)}function di(e,t,n=ae){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(In(t,s,n),n){let r=n.parent;for(;r&&r.parent;)sn(r.parent.vnode)&&dl(s,t,n,r),r=r.parent}}function dl(e,t,n,s){const r=In(t,e,s,!0);mi(()=>{ds(s[t],r)},n)}function In(e,t,n=ae,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;Nt(),At(n);const l=Se(t,n,e,o);return gt(),Ft(),l});return s?r.unshift(i):r.push(i),i}}const Ye=e=>(t,n=ae)=>(!Ot||e==="sp")&&In(e,(...s)=>t(...s),n),hl=Ye("bm"),hi=Ye("m"),pl=Ye("bu"),pi=Ye("u"),gi=Ye("bum"),mi=Ye("um"),gl=Ye("sp"),ml=Ye("rtg"),_l=Ye("rtc");function yl(e,t=ae){In("ec",e,t)}function Ue(e,t,n,s){const r=e.dirs,i=t&&t.dirs;for(let o=0;ot(o,l,void 0,i&&i[l]));else{const o=Object.keys(e);r=new Array(o.length);for(let l=0,c=o.length;le?Mi(e)?Os(e)||e.proxy:Gn(e.parent):null,Dt=ge(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Gn(e.parent),$root:e=>Gn(e.root),$emit:e=>e.emit,$options:e=>Ps(e),$forceUpdate:e=>e.f||(e.f=()=>Sn(e.update)),$nextTick:e=>e.n||(e.n=ni.bind(e.proxy)),$watch:e=>cl.bind(e)}),Dn=(e,t)=>e!==ue&&!e.__isScriptSetup&&ne(e,t),El={get({_:e},t){const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:c}=e;let a;if(t[0]!=="$"){const _=o[t];if(_!==void 0)switch(_){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(Dn(s,t))return o[t]=1,s[t];if(r!==ue&&ne(r,t))return o[t]=2,r[t];if((a=e.propsOptions[0])&&ne(a,t))return o[t]=3,i[t];if(n!==ue&&ne(n,t))return o[t]=4,n[t];es&&(o[t]=0)}}const f=Dt[t];let h,p;if(f)return t==="$attrs"&&Ce(e,"get",t),f(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==ue&&ne(n,t))return o[t]=4,n[t];if(p=c.config.globalProperties,ne(p,t))return p[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return Dn(r,t)?(r[t]=n,!0):s!==ue&&ne(s,t)?(s[t]=n,!0):ne(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let l;return!!n[o]||e!==ue&&ne(e,o)||Dn(t,o)||(l=i[0])&&ne(l,o)||ne(s,o)||ne(Dt,o)||ne(r.config.globalProperties,o)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ne(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};let es=!0;function Cl(e){const t=Ps(e),n=e.proxy,s=e.ctx;es=!1,t.beforeCreate&&Qs(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:c,inject:a,created:f,beforeMount:h,mounted:p,beforeUpdate:_,updated:C,activated:T,deactivated:$,beforeDestroy:g,beforeUnmount:y,destroyed:P,unmounted:k,render:D,renderTracked:J,renderTriggered:z,errorCaptured:S,serverPrefetch:q,expose:K,inheritAttrs:Z,components:N,directives:Q,filters:L}=t;if(a&&xl(a,s,null,e.appContext.config.unwrapInjectedRef),o)for(const oe in o){const re=o[oe];V(re)&&(s[oe]=re.bind(n))}if(r){const oe=r.call(n,n);ce(oe)&&(e.data=tn(oe))}if(es=!0,i)for(const oe in i){const re=i[oe],Ie=V(re)?re.bind(n,n):V(re.get)?re.get.bind(n,n):He,lt=!V(re)&&V(re.set)?re.set.bind(n):He,Ne=Ae({get:Ie,set:lt});Object.defineProperty(s,oe,{enumerable:!0,configurable:!0,get:()=>Ne.value,set:ve=>Ne.value=ve})}if(l)for(const oe in l)yi(l[oe],s,n,oe);if(c){const oe=V(c)?c.call(n):c;Reflect.ownKeys(oe).forEach(re=>{gn(re,oe[re])})}f&&Qs(f,e,"c");function ee(oe,re){U(re)?re.forEach(Ie=>oe(Ie.bind(n))):re&&oe(re.bind(n))}if(ee(hl,h),ee(hi,p),ee(pl,_),ee(pi,C),ee(fl,T),ee(al,$),ee(yl,S),ee(_l,J),ee(ml,z),ee(gi,y),ee(mi,k),ee(gl,q),U(K))if(K.length){const oe=e.exposed||(e.exposed={});K.forEach(re=>{Object.defineProperty(oe,re,{get:()=>n[re],set:Ie=>n[re]=Ie})})}else e.exposed||(e.exposed={});D&&e.render===He&&(e.render=D),Z!=null&&(e.inheritAttrs=Z),N&&(e.components=N),Q&&(e.directives=Q)}function xl(e,t,n=He,s=!1){U(e)&&(e=ts(e));for(const r in e){const i=e[r];let o;ce(i)?"default"in i?o=je(i.from||r,i.default,!0):o=je(i.from||r):o=je(i),me(o)&&s?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:l=>o.value=l}):t[r]=o}}function Qs(e,t,n){Se(U(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function yi(e,t,n,s){const r=s.includes(".")?ci(n,s):()=>n[s];if(pe(e)){const i=t[e];V(i)&&mn(r,i)}else if(V(e))mn(r,e.bind(n));else if(ce(e))if(U(e))e.forEach(i=>yi(i,t,n,s));else{const i=V(e.handler)?e.handler.bind(n):t[e.handler];V(i)&&mn(r,i,e)}}function Ps(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(a=>xn(c,a,o,!0)),xn(c,t,o)),ce(t)&&i.set(t,c),c}function xn(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&xn(e,i,n,!0),r&&r.forEach(o=>xn(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=wl[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const wl={data:Ys,props:ft,emits:ft,methods:ft,computed:ft,beforeCreate:be,created:be,beforeMount:be,mounted:be,beforeUpdate:be,updated:be,beforeDestroy:be,beforeUnmount:be,destroyed:be,unmounted:be,activated:be,deactivated:be,errorCaptured:be,serverPrefetch:be,components:ft,directives:ft,watch:Pl,provide:Ys,inject:Rl};function Ys(e,t){return t?e?function(){return ge(V(e)?e.call(this,this):e,V(t)?t.call(this,this):t)}:t:e}function Rl(e,t){return ft(ts(e),ts(t))}function ts(e){if(U(e)){const t={};for(let n=0;n0)&&!(o&16)){if(o&8){const f=e.vnode.dynamicProps;for(let h=0;h{c=!0;const[p,_]=vi(h,t,!0);ge(o,p),_&&l.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!i&&!c)return ce(e)&&s.set(e,Et),Et;if(U(i))for(let f=0;f-1,_[1]=T<0||C-1||ne(_,"default"))&&l.push(h)}}}const a=[o,l];return ce(e)&&s.set(e,a),a}function Js(e){return e[0]!=="$"}function Xs(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function Zs(e,t){return Xs(e)===Xs(t)}function Gs(e,t){return U(t)?t.findIndex(n=>Zs(n,e)):V(t)&&Zs(t,e)?0:-1}const Ei=e=>e[0]==="_"||e==="$stable",Ts=e=>U(e)?e.map(Le):[Le(e)],Ol=(e,t,n)=>{if(t._n)return t;const s=nl((...r)=>Ts(t(...r)),n);return s._c=!1,s},Ci=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Ei(r))continue;const i=e[r];if(V(i))t[r]=Ol(r,i,s);else if(i!=null){const o=Ts(i);t[r]=()=>o}}},xi=(e,t)=>{const n=Ts(t);e.slots.default=()=>n},Sl=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=G(t),yn(t,"_",n)):Ci(t,e.slots={})}else e.slots={},t&&xi(e,t);yn(e.slots,Nn,1)},Ml=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=ue;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:(ge(r,t),!n&&l===1&&delete r._):(i=!t.$stable,Ci(t,r)),o=t}else t&&(xi(e,t),o={default:1});if(i)for(const l in r)!Ei(l)&&!(l in o)&&delete r[l]};function wi(){return{app:null,config:{isNativeTag:so,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Il=0;function Nl(e,t){return function(s,r=null){V(s)||(s=Object.assign({},s)),r!=null&&!ce(r)&&(r=null);const i=wi(),o=new Set;let l=!1;const c=i.app={_uid:Il++,_component:s,_props:r,_container:null,_context:i,_instance:null,version:nc,get config(){return i.config},set config(a){},use(a,...f){return o.has(a)||(a&&V(a.install)?(o.add(a),a.install(c,...f)):V(a)&&(o.add(a),a(c,...f))),c},mixin(a){return i.mixins.includes(a)||i.mixins.push(a),c},component(a,f){return f?(i.components[a]=f,c):i.components[a]},directive(a,f){return f?(i.directives[a]=f,c):i.directives[a]},mount(a,f,h){if(!l){const p=de(s,r);return p.appContext=i,f&&t?t(p,a):e(p,a,h),l=!0,c._container=a,a.__vue_app__=c,Os(p.component)||p.component.proxy}},unmount(){l&&(e(null,c._container),delete c._container.__vue_app__)},provide(a,f){return i.provides[a]=f,c}};return c}}function wn(e,t,n,s,r=!1){if(U(e)){e.forEach((p,_)=>wn(p,t&&(U(t)?t[_]:t),n,s,r));return}if(Bt(s)&&!r)return;const i=s.shapeFlag&4?Os(s.component)||s.component.proxy:s.el,o=r?null:i,{i:l,r:c}=e,a=t&&t.r,f=l.refs===ue?l.refs={}:l.refs,h=l.setupState;if(a!=null&&a!==c&&(pe(a)?(f[a]=null,ne(h,a)&&(h[a]=null)):me(a)&&(a.value=null)),V(c))rt(c,l,12,[o,f]);else{const p=pe(c),_=me(c);if(p||_){const C=()=>{if(e.f){const T=p?ne(h,c)?h[c]:f[c]:c.value;r?U(T)&&ds(T,i):U(T)?T.includes(i)||T.push(i):p?(f[c]=[i],ne(h,c)&&(h[c]=f[c])):(c.value=[i],e.k&&(f[e.k]=c.value))}else p?(f[c]=o,ne(h,c)&&(h[c]=o)):_&&(c.value=o,e.k&&(f[e.k]=o))};o?(C.id=-1,Ee(C,n)):C()}}}let Xe=!1;const dn=e=>/svg/.test(e.namespaceURI)&&e.tagName!=="foreignObject",hn=e=>e.nodeType===8;function Fl(e){const{mt:t,p:n,o:{patchProp:s,createText:r,nextSibling:i,parentNode:o,remove:l,insert:c,createComment:a}}=e,f=(g,y)=>{if(!y.hasChildNodes()){n(null,g,y),En(),y._vnode=g;return}Xe=!1,h(y.firstChild,g,null,null,null),En(),y._vnode=g,Xe&&console.error("Hydration completed but contains mismatches.")},h=(g,y,P,k,D,J=!1)=>{const z=hn(g)&&g.data==="[",S=()=>T(g,y,P,k,D,z),{type:q,ref:K,shapeFlag:Z,patchFlag:N}=y;let Q=g.nodeType;y.el=g,N===-2&&(J=!1,y.dynamicChildren=null);let L=null;switch(q){case Tt:Q!==3?y.children===""?(c(y.el=r(""),o(g),g),L=g):L=S():(g.data!==y.children&&(Xe=!0,g.data=y.children),L=i(g));break;case Me:Q!==8||z?L=S():L=i(g);break;case Ut:if(z&&(g=i(g),Q=g.nodeType),Q===1||Q===3){L=g;const _e=!y.children.length;for(let ee=0;ee{J=J||!!y.dynamicChildren;const{type:z,props:S,patchFlag:q,shapeFlag:K,dirs:Z}=y,N=z==="input"&&Z||z==="option";if(N||q!==-1){if(Z&&Ue(y,null,P,"created"),S)if(N||!J||q&48)for(const L in S)(N&&L.endsWith("value")||en(L)&&!jt(L))&&s(g,L,null,S[L],!1,void 0,P);else S.onClick&&s(g,"onClick",null,S.onClick,!1,void 0,P);let Q;if((Q=S&&S.onVnodeBeforeMount)&&Te(Q,P,y),Z&&Ue(y,null,P,"beforeMount"),((Q=S&&S.onVnodeMounted)||Z)&&li(()=>{Q&&Te(Q,P,y),Z&&Ue(y,null,P,"mounted")},k),K&16&&!(S&&(S.innerHTML||S.textContent))){let L=_(g.firstChild,y,g,P,k,D,J);for(;L;){Xe=!0;const _e=L;L=L.nextSibling,l(_e)}}else K&8&&g.textContent!==y.children&&(Xe=!0,g.textContent=y.children)}return g.nextSibling},_=(g,y,P,k,D,J,z)=>{z=z||!!y.dynamicChildren;const S=y.children,q=S.length;for(let K=0;K{const{slotScopeIds:z}=y;z&&(D=D?D.concat(z):z);const S=o(g),q=_(i(g),y,S,P,k,D,J);return q&&hn(q)&&q.data==="]"?i(y.anchor=q):(Xe=!0,c(y.anchor=a("]"),S,q),q)},T=(g,y,P,k,D,J)=>{if(Xe=!0,y.el=null,J){const q=$(g);for(;;){const K=i(g);if(K&&K!==q)l(K);else break}}const z=i(g),S=o(g);return l(g),n(null,y,S,z,P,k,dn(S),D),z},$=g=>{let y=0;for(;g;)if(g=i(g),g&&hn(g)&&(g.data==="["&&y++,g.data==="]")){if(y===0)return i(g);y--}return g};return[f,h]}const Ee=li;function Ll(e){return $l(e,Fl)}function $l(e,t){const n=ao();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:c,setText:a,setElementText:f,parentNode:h,nextSibling:p,setScopeId:_=He,insertStaticContent:C}=e,T=(u,d,m,b=null,E=null,R=null,M=!1,w=null,A=!!d.dynamicChildren)=>{if(u===d)return;u&&!dt(u,d)&&(b=O(u),ve(u,E,R,!0),u=null),d.patchFlag===-2&&(A=!1,d.dynamicChildren=null);const{type:x,ref:j,shapeFlag:F}=d;switch(x){case Tt:$(u,d,m,b);break;case Me:g(u,d,m,b);break;case Ut:u==null&&y(d,m,b,M);break;case Re:N(u,d,m,b,E,R,M,w,A);break;default:F&1?D(u,d,m,b,E,R,M,w,A):F&6?Q(u,d,m,b,E,R,M,w,A):(F&64||F&128)&&x.process(u,d,m,b,E,R,M,w,A,te)}j!=null&&E&&wn(j,u&&u.ref,R,d||u,!d)},$=(u,d,m,b)=>{if(u==null)s(d.el=l(d.children),m,b);else{const E=d.el=u.el;d.children!==u.children&&a(E,d.children)}},g=(u,d,m,b)=>{u==null?s(d.el=c(d.children||""),m,b):d.el=u.el},y=(u,d,m,b)=>{[u.el,u.anchor]=C(u.children,d,m,b,u.el,u.anchor)},P=({el:u,anchor:d},m,b)=>{let E;for(;u&&u!==d;)E=p(u),s(u,m,b),u=E;s(d,m,b)},k=({el:u,anchor:d})=>{let m;for(;u&&u!==d;)m=p(u),r(u),u=m;r(d)},D=(u,d,m,b,E,R,M,w,A)=>{M=M||d.type==="svg",u==null?J(d,m,b,E,R,M,w,A):q(u,d,E,R,M,w,A)},J=(u,d,m,b,E,R,M,w)=>{let A,x;const{type:j,props:F,shapeFlag:B,transition:W,dirs:X}=u;if(A=u.el=o(u.type,R,F&&F.is,F),B&8?f(A,u.children):B&16&&S(u.children,A,null,b,E,R&&j!=="foreignObject",M,w),X&&Ue(u,null,b,"created"),z(A,u,u.scopeId,M,b),F){for(const ie in F)ie!=="value"&&!jt(ie)&&i(A,ie,null,F[ie],R,u.children,b,E,I);"value"in F&&i(A,"value",null,F.value),(x=F.onVnodeBeforeMount)&&Te(x,b,u)}X&&Ue(u,null,b,"beforeMount");const le=(!E||E&&!E.pendingBranch)&&W&&!W.persisted;le&&W.beforeEnter(A),s(A,d,m),((x=F&&F.onVnodeMounted)||le||X)&&Ee(()=>{x&&Te(x,b,u),le&&W.enter(A),X&&Ue(u,null,b,"mounted")},E)},z=(u,d,m,b,E)=>{if(m&&_(u,m),b)for(let R=0;R{for(let x=A;x{const w=d.el=u.el;let{patchFlag:A,dynamicChildren:x,dirs:j}=d;A|=u.patchFlag&16;const F=u.props||ue,B=d.props||ue;let W;m&&ct(m,!1),(W=B.onVnodeBeforeUpdate)&&Te(W,m,d,u),j&&Ue(d,u,m,"beforeUpdate"),m&&ct(m,!0);const X=E&&d.type!=="foreignObject";if(x?K(u.dynamicChildren,x,w,m,b,X,R):M||re(u,d,w,null,m,b,X,R,!1),A>0){if(A&16)Z(w,d,F,B,m,b,E);else if(A&2&&F.class!==B.class&&i(w,"class",null,B.class,E),A&4&&i(w,"style",F.style,B.style,E),A&8){const le=d.dynamicProps;for(let ie=0;ie{W&&Te(W,m,d,u),j&&Ue(d,u,m,"updated")},b)},K=(u,d,m,b,E,R,M)=>{for(let w=0;w{if(m!==b){if(m!==ue)for(const w in m)!jt(w)&&!(w in b)&&i(u,w,m[w],null,M,d.children,E,R,I);for(const w in b){if(jt(w))continue;const A=b[w],x=m[w];A!==x&&w!=="value"&&i(u,w,x,A,M,d.children,E,R,I)}"value"in b&&i(u,"value",m.value,b.value)}},N=(u,d,m,b,E,R,M,w,A)=>{const x=d.el=u?u.el:l(""),j=d.anchor=u?u.anchor:l("");let{patchFlag:F,dynamicChildren:B,slotScopeIds:W}=d;W&&(w=w?w.concat(W):W),u==null?(s(x,m,b),s(j,m,b),S(d.children,m,j,E,R,M,w,A)):F>0&&F&64&&B&&u.dynamicChildren?(K(u.dynamicChildren,B,m,E,R,M,w),(d.key!=null||E&&d===E.subTree)&&Ri(u,d,!0)):re(u,d,m,j,E,R,M,w,A)},Q=(u,d,m,b,E,R,M,w,A)=>{d.slotScopeIds=w,u==null?d.shapeFlag&512?E.ctx.activate(d,m,b,M,A):L(d,m,b,E,R,M,A):_e(u,d,A)},L=(u,d,m,b,E,R,M)=>{const w=u.component=zl(u,b,E);if(sn(u)&&(w.ctx.renderer=te),Ql(w),w.asyncDep){if(E&&E.registerDep(w,ee),!u.el){const A=w.subTree=de(Me);g(null,A,d,m)}return}ee(w,u,d,m,E,R,M)},_e=(u,d,m)=>{const b=d.component=u.component;if(il(u,d,m))if(b.asyncDep&&!b.asyncResolved){oe(b,d,m);return}else b.next=d,Zo(b.update),b.update();else d.el=u.el,b.vnode=d},ee=(u,d,m,b,E,R,M)=>{const w=()=>{if(u.isMounted){let{next:j,bu:F,u:B,parent:W,vnode:X}=u,le=j,ie;ct(u,!1),j?(j.el=X.el,oe(u,j,M)):j=X,F&&kn(F),(ie=j.props&&j.props.onVnodeBeforeUpdate)&&Te(ie,W,j,X),ct(u,!0);const he=Hn(u),Fe=u.subTree;u.subTree=he,T(Fe,he,h(Fe.el),O(Fe),u,E,R),j.el=he.el,le===null&&ol(u,he.el),B&&Ee(B,E),(ie=j.props&&j.props.onVnodeUpdated)&&Ee(()=>Te(ie,W,j,X),E)}else{let j;const{el:F,props:B}=d,{bm:W,m:X,parent:le}=u,ie=Bt(d);if(ct(u,!1),W&&kn(W),!ie&&(j=B&&B.onVnodeBeforeMount)&&Te(j,le,d),ct(u,!0),F&&Y){const he=()=>{u.subTree=Hn(u),Y(F,u.subTree,u,E,null)};ie?d.type.__asyncLoader().then(()=>!u.isUnmounted&&he()):he()}else{const he=u.subTree=Hn(u);T(null,he,m,b,u,E,R),d.el=he.el}if(X&&Ee(X,E),!ie&&(j=B&&B.onVnodeMounted)){const he=d;Ee(()=>Te(j,le,he),E)}(d.shapeFlag&256||le&&Bt(le.vnode)&&le.vnode.shapeFlag&256)&&u.a&&Ee(u.a,E),u.isMounted=!0,d=m=b=null}},A=u.effect=new ms(w,()=>Sn(x),u.scope),x=u.update=()=>A.run();x.id=u.uid,ct(u,!0),x()},oe=(u,d,m)=>{d.component=u;const b=u.vnode.props;u.vnode=d,u.next=null,Al(u,d.props,b,m),Ml(u,d.children,m),Nt(),Ws(),Ft()},re=(u,d,m,b,E,R,M,w,A=!1)=>{const x=u&&u.children,j=u?u.shapeFlag:0,F=d.children,{patchFlag:B,shapeFlag:W}=d;if(B>0){if(B&128){lt(x,F,m,b,E,R,M,w,A);return}else if(B&256){Ie(x,F,m,b,E,R,M,w,A);return}}W&8?(j&16&&I(x,E,R),F!==x&&f(m,F)):j&16?W&16?lt(x,F,m,b,E,R,M,w,A):I(x,E,R,!0):(j&8&&f(m,""),W&16&&S(F,m,b,E,R,M,w,A))},Ie=(u,d,m,b,E,R,M,w,A)=>{u=u||Et,d=d||Et;const x=u.length,j=d.length,F=Math.min(x,j);let B;for(B=0;Bj?I(u,E,R,!0,!1,F):S(d,m,b,E,R,M,w,A,F)},lt=(u,d,m,b,E,R,M,w,A)=>{let x=0;const j=d.length;let F=u.length-1,B=j-1;for(;x<=F&&x<=B;){const W=u[x],X=d[x]=A?tt(d[x]):Le(d[x]);if(dt(W,X))T(W,X,m,null,E,R,M,w,A);else break;x++}for(;x<=F&&x<=B;){const W=u[F],X=d[B]=A?tt(d[B]):Le(d[B]);if(dt(W,X))T(W,X,m,null,E,R,M,w,A);else break;F--,B--}if(x>F){if(x<=B){const W=B+1,X=WB)for(;x<=F;)ve(u[x],E,R,!0),x++;else{const W=x,X=x,le=new Map;for(x=X;x<=B;x++){const xe=d[x]=A?tt(d[x]):Le(d[x]);xe.key!=null&&le.set(xe.key,x)}let ie,he=0;const Fe=B-X+1;let _t=!1,Ns=0;const Lt=new Array(Fe);for(x=0;x=Fe){ve(xe,E,R,!0);continue}let De;if(xe.key!=null)De=le.get(xe.key);else for(ie=X;ie<=B;ie++)if(Lt[ie-X]===0&&dt(xe,d[ie])){De=ie;break}De===void 0?ve(xe,E,R,!0):(Lt[De-X]=x+1,De>=Ns?Ns=De:_t=!0,T(xe,d[De],m,null,E,R,M,w,A),he++)}const Fs=_t?kl(Lt):Et;for(ie=Fs.length-1,x=Fe-1;x>=0;x--){const xe=X+x,De=d[xe],Ls=xe+1{const{el:R,type:M,transition:w,children:A,shapeFlag:x}=u;if(x&6){Ne(u.component.subTree,d,m,b);return}if(x&128){u.suspense.move(d,m,b);return}if(x&64){M.move(u,d,m,te);return}if(M===Re){s(R,d,m);for(let F=0;Fw.enter(R),E);else{const{leave:F,delayLeave:B,afterLeave:W}=w,X=()=>s(R,d,m),le=()=>{F(R,()=>{X(),W&&W()})};B?B(R,X,le):le()}else s(R,d,m)},ve=(u,d,m,b=!1,E=!1)=>{const{type:R,props:M,ref:w,children:A,dynamicChildren:x,shapeFlag:j,patchFlag:F,dirs:B}=u;if(w!=null&&wn(w,null,m,u,!0),j&256){d.ctx.deactivate(u);return}const W=j&1&&B,X=!Bt(u);let le;if(X&&(le=M&&M.onVnodeBeforeUnmount)&&Te(le,d,u),j&6)v(u.component,m,b);else{if(j&128){u.suspense.unmount(m,b);return}W&&Ue(u,null,d,"beforeUnmount"),j&64?u.type.remove(u,d,m,E,te,b):x&&(R!==Re||F>0&&F&64)?I(x,d,m,!1,!0):(R===Re&&F&384||!E&&j&16)&&I(A,d,m),b&&mt(u)}(X&&(le=M&&M.onVnodeUnmounted)||W)&&Ee(()=>{le&&Te(le,d,u),W&&Ue(u,null,d,"unmounted")},m)},mt=u=>{const{type:d,el:m,anchor:b,transition:E}=u;if(d===Re){rn(m,b);return}if(d===Ut){k(u);return}const R=()=>{r(m),E&&!E.persisted&&E.afterLeave&&E.afterLeave()};if(u.shapeFlag&1&&E&&!E.persisted){const{leave:M,delayLeave:w}=E,A=()=>M(m,R);w?w(u.el,R,A):A()}else R()},rn=(u,d)=>{let m;for(;u!==d;)m=p(u),r(u),u=m;r(d)},v=(u,d,m)=>{const{bum:b,scope:E,update:R,subTree:M,um:w}=u;b&&kn(b),E.stop(),R&&(R.active=!1,ve(M,u,d,m)),w&&Ee(w,d),Ee(()=>{u.isUnmounted=!0},d),d&&d.pendingBranch&&!d.isUnmounted&&u.asyncDep&&!u.asyncResolved&&u.suspenseId===d.pendingId&&(d.deps--,d.deps===0&&d.resolve())},I=(u,d,m,b=!1,E=!1,R=0)=>{for(let M=R;Mu.shapeFlag&6?O(u.component.subTree):u.shapeFlag&128?u.suspense.next():p(u.anchor||u.el),H=(u,d,m)=>{u==null?d._vnode&&ve(d._vnode,null,null,!0):T(d._vnode||null,u,d,null,null,null,m),Ws(),En(),d._vnode=u},te={p:T,um:ve,m:Ne,r:mt,mt:L,mc:S,pc:re,pbc:K,n:O,o:e};let fe,Y;return t&&([fe,Y]=t(te)),{render:H,hydrate:fe,createApp:Nl(H,fe)}}function ct({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function Ri(e,t,n=!1){const s=e.children,r=t.children;if(U(s)&&U(r))for(let i=0;i>1,e[n[l]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}const Hl=e=>e.__isTeleport,Re=Symbol(void 0),Tt=Symbol(void 0),Me=Symbol(void 0),Ut=Symbol(void 0),Kt=[];let ke=null;function jl(e=!1){Kt.push(ke=e?null:[])}function Bl(){Kt.pop(),ke=Kt[Kt.length-1]||null}let Zt=1;function er(e){Zt+=e}function Pi(e){return e.dynamicChildren=Zt>0?ke||Et:null,Bl(),Zt>0&&ke&&ke.push(e),e}function Ku(e,t,n,s,r,i){return Pi(Ai(e,t,n,s,r,i,!0))}function Dl(e,t,n,s,r){return Pi(de(e,t,n,s,r,!0))}function ss(e){return e?e.__v_isVNode===!0:!1}function dt(e,t){return e.type===t.type&&e.key===t.key}const Nn="__vInternal",Ti=({key:e})=>e??null,_n=({ref:e,ref_key:t,ref_for:n})=>e!=null?pe(e)||me(e)||V(e)?{i:Oe,r:e,k:t,f:!!n}:e:null;function Ai(e,t=null,n=null,s=0,r=null,i=e===Re?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ti(t),ref:t&&_n(t),scopeId:oi,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Oe};return l?(As(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=pe(n)?8:16),Zt>0&&!o&&ke&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&ke.push(c),c}const de=Ul;function Ul(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===bl)&&(e=Me),ss(e)){const l=ot(e,t,!0);return n&&As(l,n),Zt>0&&!i&&ke&&(l.shapeFlag&6?ke[ke.indexOf(e)]=l:ke.push(l)),l.patchFlag|=-2,l}if(Gl(e)&&(e=e.__vccOpts),t){t=Kl(t);let{class:l,style:c}=t;l&&!pe(l)&&(t.class=fs(l)),ce(c)&&(Qr(c)&&!U(c)&&(c=ge({},c)),t.style=us(c))}const o=pe(e)?1:ll(e)?128:Hl(e)?64:ce(e)?4:V(e)?2:0;return Ai(e,t,n,s,r,o,i,!0)}function Kl(e){return e?Qr(e)||Nn in e?ge({},e):e:null}function ot(e,t,n=!1){const{props:s,ref:r,patchFlag:i,children:o}=e,l=t?Wl(s||{},t):s;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Ti(l),ref:t&&t.ref?n&&r?U(r)?r.concat(_n(t)):[r,_n(t)]:_n(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Re?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ot(e.ssContent),ssFallback:e.ssFallback&&ot(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Oi(e=" ",t=0){return de(Tt,null,e,t)}function Wu(e,t){const n=de(Ut,null,e);return n.staticCount=t,n}function qu(e="",t=!1){return t?(jl(),Dl(Me,null,e)):de(Me,null,e)}function Le(e){return e==null||typeof e=="boolean"?de(Me):U(e)?de(Re,null,e.slice()):typeof e=="object"?tt(e):de(Tt,null,String(e))}function tt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ot(e)}function As(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(U(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),As(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!(Nn in t)?t._ctx=Oe:r===3&&Oe&&(Oe.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else V(t)?(t={default:t,_ctx:Oe},n=32):(t=String(t),s&64?(n=16,t=[Oi(t)]):n=8);e.children=t,e.shapeFlag|=n}function Wl(...e){const t={};for(let n=0;nae||Oe,At=e=>{ae=e,e.scope.on()},gt=()=>{ae&&ae.scope.off(),ae=null};function Mi(e){return e.vnode.shapeFlag&4}let Ot=!1;function Ql(e,t=!1){Ot=t;const{props:n,children:s}=e.vnode,r=Mi(e);Tl(e,n,r,t),Sl(e,s);const i=r?Yl(e,t):void 0;return Ot=!1,i}function Yl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Yr(new Proxy(e.ctx,El));const{setup:s}=n;if(s){const r=e.setupContext=s.length>1?Xl(e):null;At(e),Nt();const i=rt(s,e,0,[e.props,r]);if(Ft(),gt(),Fr(i)){if(i.then(gt,gt),t)return i.then(o=>{tr(e,o,t)}).catch(o=>{nn(o,e,0)});e.asyncDep=i}else tr(e,i,t)}else Ii(e,t)}function tr(e,t,n){V(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ce(t)&&(e.setupState=Gr(t)),Ii(e,n)}let nr;function Ii(e,t,n){const s=e.type;if(!e.render){if(!t&&nr&&!s.render){const r=s.template||Ps(e).template;if(r){const{isCustomElement:i,compilerOptions:o}=e.appContext.config,{delimiters:l,compilerOptions:c}=s,a=ge(ge({isCustomElement:i,delimiters:l},o),c);s.render=nr(r,a)}}e.render=s.render||He}At(e),Nt(),Cl(e),Ft(),gt()}function Jl(e){return new Proxy(e.attrs,{get(t,n){return Ce(e,"get","$attrs"),t[n]}})}function Xl(e){const t=s=>{e.exposed=s||{}};let n;return{get attrs(){return n||(n=Jl(e))},slots:e.slots,emit:e.emit,expose:t}}function Os(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Gr(Yr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Dt)return Dt[n](e)},has(t,n){return n in t||n in Dt}}))}function Zl(e,t=!0){return V(e)?e.displayName||e.name:e.name||t&&e.__name}function Gl(e){return V(e)&&"__vccOpts"in e}const Ae=(e,t)=>Yo(e,t,Ot);function Ss(e,t,n){const s=arguments.length;return s===2?ce(t)&&!U(t)?ss(t)?de(e,null,[t]):de(e,t):de(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&ss(n)&&(n=[n]),de(e,t,n))}const ec=Symbol(""),tc=()=>je(ec),nc="3.2.47",sc="http://www.w3.org/2000/svg",ht=typeof document<"u"?document:null,sr=ht&&ht.createElement("template"),rc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t?ht.createElementNS(sc,e):ht.createElement(e,n?{is:n}:void 0);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>ht.createTextNode(e),createComment:e=>ht.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ht.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{sr.innerHTML=s?`${e}`:e;const l=sr.content;if(s){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function ic(e,t,n){const s=e._vtc;s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function oc(e,t,n){const s=e.style,r=pe(n);if(n&&!r){if(t&&!pe(t))for(const i in t)n[i]==null&&rs(s,i,"");for(const i in n)rs(s,i,n[i])}else{const i=s.display;r?t!==n&&(s.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(s.display=i)}}const rr=/\s*!important$/;function rs(e,t,n){if(U(n))n.forEach(s=>rs(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=lc(e,t);rr.test(n)?e.setProperty(It(s),n.replace(rr,""),"important"):e[s]=n}}const ir=["Webkit","Moz","ms"],Un={};function lc(e,t){const n=Un[t];if(n)return n;let s=We(t);if(s!=="filter"&&s in e)return Un[t]=s;s=An(s);for(let r=0;rKn||(pc.then(()=>Kn=0),Kn=Date.now());function mc(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Se(_c(s,n.value),t,5,[s])};return n.value=e,n.attached=gc(),n}function _c(e,t){if(U(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const cr=/^on[a-z]/,yc=(e,t,n,s,r=!1,i,o,l,c)=>{t==="class"?ic(e,s,r):t==="style"?oc(e,n,s):en(t)?as(t)||dc(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):bc(e,t,s,r))?uc(e,t,s,i,o,l,c):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),cc(e,t,s,r))};function bc(e,t,n,s){return s?!!(t==="innerHTML"||t==="textContent"||t in e&&cr.test(t)&&V(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||cr.test(t)&&pe(n)?!1:t in e}const Ze="transition",$t="animation",Ni=(e,{slots:t})=>Ss(fi,Li(e),t);Ni.displayName="Transition";const Fi={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},vc=Ni.props=ge({},fi.props,Fi),ut=(e,t=[])=>{U(e)?e.forEach(n=>n(...t)):e&&e(...t)},ur=e=>e?U(e)?e.some(t=>t.length>1):e.length>1:!1;function Li(e){const t={};for(const N in e)N in Fi||(t[N]=e[N]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=i,appearActiveClass:a=o,appearToClass:f=l,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,C=Ec(r),T=C&&C[0],$=C&&C[1],{onBeforeEnter:g,onEnter:y,onEnterCancelled:P,onLeave:k,onLeaveCancelled:D,onBeforeAppear:J=g,onAppear:z=y,onAppearCancelled:S=P}=t,q=(N,Q,L)=>{et(N,Q?f:l),et(N,Q?a:o),L&&L()},K=(N,Q)=>{N._isLeaving=!1,et(N,h),et(N,_),et(N,p),Q&&Q()},Z=N=>(Q,L)=>{const _e=N?z:y,ee=()=>q(Q,N,L);ut(_e,[Q,ee]),fr(()=>{et(Q,N?c:i),Ve(Q,N?f:l),ur(_e)||ar(Q,s,T,ee)})};return ge(t,{onBeforeEnter(N){ut(g,[N]),Ve(N,i),Ve(N,o)},onBeforeAppear(N){ut(J,[N]),Ve(N,c),Ve(N,a)},onEnter:Z(!1),onAppear:Z(!0),onLeave(N,Q){N._isLeaving=!0;const L=()=>K(N,Q);Ve(N,h),ki(),Ve(N,p),fr(()=>{N._isLeaving&&(et(N,h),Ve(N,_),ur(k)||ar(N,s,$,L))}),ut(k,[N,L])},onEnterCancelled(N){q(N,!1),ut(P,[N])},onAppearCancelled(N){q(N,!0),ut(S,[N])},onLeaveCancelled(N){K(N),ut(D,[N])}})}function Ec(e){if(e==null)return null;if(ce(e))return[Wn(e.enter),Wn(e.leave)];{const t=Wn(e);return[t,t]}}function Wn(e){return fo(e)}function Ve(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function et(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function fr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Cc=0;function ar(e,t,n,s){const r=e._endId=++Cc,i=()=>{r===e._endId&&s()};if(n)return setTimeout(i,n);const{type:o,timeout:l,propCount:c}=$i(e,t);if(!o)return s();const a=o+"end";let f=0;const h=()=>{e.removeEventListener(a,p),i()},p=_=>{_.target===e&&++f>=c&&h()};setTimeout(()=>{f(n[C]||"").split(", "),r=s(`${Ze}Delay`),i=s(`${Ze}Duration`),o=dr(r,i),l=s(`${$t}Delay`),c=s(`${$t}Duration`),a=dr(l,c);let f=null,h=0,p=0;t===Ze?o>0&&(f=Ze,h=o,p=i.length):t===$t?a>0&&(f=$t,h=a,p=c.length):(h=Math.max(o,a),f=h>0?o>a?Ze:$t:null,p=f?f===Ze?i.length:c.length:0);const _=f===Ze&&/\b(transform|all)(,|$)/.test(s(`${Ze}Property`).toString());return{type:f,timeout:h,propCount:p,hasTransform:_}}function dr(e,t){for(;e.lengthhr(n)+hr(e[s])))}function hr(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function ki(){return document.body.offsetHeight}const Hi=new WeakMap,ji=new WeakMap,Bi={name:"TransitionGroup",props:ge({},vc,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Si(),s=ui();let r,i;return pi(()=>{if(!r.length)return;const o=e.moveClass||`${e.name||"v"}-move`;if(!Tc(r[0].el,n.vnode.el,o))return;r.forEach(wc),r.forEach(Rc);const l=r.filter(Pc);ki(),l.forEach(c=>{const a=c.el,f=a.style;Ve(a,o),f.transform=f.webkitTransform=f.transitionDuration="";const h=a._moveCb=p=>{p&&p.target!==a||(!p||/transform$/.test(p.propertyName))&&(a.removeEventListener("transitionend",h),a._moveCb=null,et(a,o))};a.addEventListener("transitionend",h)})}),()=>{const o=G(e),l=Li(o);let c=o.tag||Re;r=i,i=t.default?ws(t.default()):[];for(let a=0;adelete e.mode;Bi.props;const Vu=Bi;function wc(e){const t=e.el;t._moveCb&&t._moveCb(),t._enterCb&&t._enterCb()}function Rc(e){ji.set(e,e.el.getBoundingClientRect())}function Pc(e){const t=Hi.get(e),n=ji.get(e),s=t.left-n.left,r=t.top-n.top;if(s||r){const i=e.el.style;return i.transform=i.webkitTransform=`translate(${s}px,${r}px)`,i.transitionDuration="0s",e}}function Tc(e,t,n){const s=e.cloneNode();e._vtc&&e._vtc.forEach(o=>{o.split(/\s+/).forEach(l=>l&&s.classList.remove(l))}),n.split(/\s+/).forEach(o=>o&&s.classList.add(o)),s.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(s);const{hasTransform:i}=$i(s);return r.removeChild(s),i}const Ac=ge({patchProp:yc},rc);let qn,pr=!1;function Oc(){return qn=pr?qn:Ll(Ac),pr=!0,qn}const zu=(...e)=>{const t=Oc().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Sc(s);if(r)return n(r,!0,r instanceof SVGElement)},t};function Sc(e){return pe(e)?document.querySelector(e):e}var Mc=([e,t,n])=>e==="meta"&&t.name?`${e}.${t.name}`:["title","base"].includes(e)?e:e==="template"&&t.id?`${e}.${t.id}`:JSON.stringify([e,t,n]),Qu=e=>{const t=new Set,n=[];return e.forEach(s=>{const r=Mc(s);t.has(r)||(t.add(r),n.push(s))}),n},Yu=e=>/(\.html|\/)$/.test(e)?e:e+"/",Ic=e=>e.startsWith("ftp://"),Nc=e=>/^(https?:)?\/\//.test(e),Fc=/.md((\?|#).*)?$/,Ju=(e,t="/")=>!!(Nc(e)||Ic(e)||e.startsWith("/")&&!e.startsWith(t)&&!Fc.test(e)),Xu=e=>/^mailto:/.test(e),Zu=e=>/^tel:/.test(e),Gu=e=>Object.prototype.toString.call(e)==="[object Object]",ef=e=>e.replace(/\/$/,""),tf=e=>e.replace(/^\//,""),nf=(e,t)=>{const n=Object.keys(e).sort((s,r)=>{const i=r.split("/").length-s.split("/").length;return i!==0?i:r.length-s.length});for(const s of n)if(t.startsWith(s))return s;return"/"},sf=(e,t="/")=>e.replace(/^(https?:)?\/\/[^/]*/,"").replace(new RegExp(`^${t}`),"/");/*! + * vue-router v4.1.6 + * (c) 2022 Eduardo San Martin Morote + * @license MIT + */const bt=typeof window<"u";function Lc(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const se=Object.assign;function Vn(e,t){const n={};for(const s in t){const r=t[s];n[s]=Be(r)?r.map(e):e(r)}return n}const Wt=()=>{},Be=Array.isArray,$c=/\/$/,kc=e=>e.replace($c,"");function zn(e,t,n="/"){let s,r={},i="",o="";const l=t.indexOf("#");let c=t.indexOf("?");return l=0&&(c=-1),c>-1&&(s=t.slice(0,c),i=t.slice(c+1,l>-1?l:t.length),r=e(i)),l>-1&&(s=s||t.slice(0,l),o=t.slice(l,t.length)),s=Dc(s??t,n),{fullPath:s+(i&&"?")+i+o,path:s,query:r,hash:o}}function Hc(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function gr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function jc(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&St(t.matched[s],n.matched[r])&&Di(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function St(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Di(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Bc(e[n],t[n]))return!1;return!0}function Bc(e,t){return Be(e)?mr(e,t):Be(t)?mr(t,e):e===t}function mr(e,t){return Be(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Dc(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/");let r=n.length-1,i,o;for(i=0;i1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(i-(i===s.length?1:0)).join("/")}var Gt;(function(e){e.pop="pop",e.push="push"})(Gt||(Gt={}));var qt;(function(e){e.back="back",e.forward="forward",e.unknown=""})(qt||(qt={}));function Uc(e){if(!e)if(bt){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),kc(e)}const Kc=/^[^#]+#/;function Wc(e,t){return e.replace(Kc,"#")+t}function qc(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Fn=()=>({left:window.pageXOffset,top:window.pageYOffset});function Vc(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=qc(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function _r(e,t){return(history.state?history.state.position-t:-1)+e}const is=new Map;function zc(e,t){is.set(e,t)}function Qc(e){const t=is.get(e);return is.delete(e),t}let Yc=()=>location.protocol+"//"+location.host;function Ui(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let l=r.includes(e.slice(i))?e.slice(i).length:1,c=r.slice(l);return c[0]!=="/"&&(c="/"+c),gr(c,"")}return gr(n,e)+s+r}function Jc(e,t,n,s){let r=[],i=[],o=null;const l=({state:p})=>{const _=Ui(e,location),C=n.value,T=t.value;let $=0;if(p){if(n.value=_,t.value=p,o&&o===C){o=null;return}$=T?p.position-T.position:0}else s(_);r.forEach(g=>{g(n.value,C,{delta:$,type:Gt.pop,direction:$?$>0?qt.forward:qt.back:qt.unknown})})};function c(){o=n.value}function a(p){r.push(p);const _=()=>{const C=r.indexOf(p);C>-1&&r.splice(C,1)};return i.push(_),_}function f(){const{history:p}=window;p.state&&p.replaceState(se({},p.state,{scroll:Fn()}),"")}function h(){for(const p of i)p();i=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",f)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",f),{pauseListeners:c,listen:a,destroy:h}}function yr(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Fn():null}}function Xc(e){const{history:t,location:n}=window,s={value:Ui(e,n)},r={value:t.state};r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(c,a,f){const h=e.indexOf("#"),p=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+c:Yc()+e+c;try{t[f?"replaceState":"pushState"](a,"",p),r.value=a}catch(_){console.error(_),n[f?"replace":"assign"](p)}}function o(c,a){const f=se({},t.state,yr(r.value.back,c,r.value.forward,!0),a,{position:r.value.position});i(c,f,!0),s.value=c}function l(c,a){const f=se({},r.value,t.state,{forward:c,scroll:Fn()});i(f.current,f,!0);const h=se({},yr(s.value,c,null),{position:f.position+1},a);i(c,h,!1),s.value=c}return{location:s,state:r,push:l,replace:o}}function rf(e){e=Uc(e);const t=Xc(e),n=Jc(e,t.state,t.location,t.replace);function s(i,o=!0){o||n.pauseListeners(),history.go(i)}const r=se({location:"",base:e,go:s,createHref:Wc.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function Zc(e){return typeof e=="string"||e&&typeof e=="object"}function Ki(e){return typeof e=="string"||typeof e=="symbol"}const Ge={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Wi=Symbol("");var br;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(br||(br={}));function Mt(e,t){return se(new Error,{type:e,[Wi]:!0},t)}function qe(e,t){return e instanceof Error&&Wi in e&&(t==null||!!(e.type&t))}const vr="[^/]+?",Gc={sensitive:!1,strict:!1,start:!0,end:!0},eu=/[.+*?^${}()[\]/\\]/g;function tu(e,t){const n=se({},Gc,t),s=[];let r=n.start?"^":"";const i=[];for(const a of e){const f=a.length?[]:[90];n.strict&&!a.length&&(r+="/");for(let h=0;ht.length?t.length===1&&t[0]===40+40?1:-1:0}function su(e,t){let n=0;const s=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const ru={type:0,value:""},iu=/[a-zA-Z0-9_]/;function ou(e){if(!e)return[[]];if(e==="/")return[[ru]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${a}": ${_}`)}let n=0,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let l=0,c,a="",f="";function h(){a&&(n===0?i.push({type:0,value:a}):n===1||n===2||n===3?(i.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:a,regexp:f,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),a="")}function p(){a+=c}for(;l{o(y)}:Wt}function o(f){if(Ki(f)){const h=s.get(f);h&&(s.delete(f),n.splice(n.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=n.indexOf(f);h>-1&&(n.splice(h,1),f.record.name&&s.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function l(){return n}function c(f){let h=0;for(;h=0&&(f.record.path!==n[h].record.path||!qi(f,n[h]));)h++;n.splice(h,0,f),f.record.name&&!xr(f)&&s.set(f.record.name,f)}function a(f,h){let p,_={},C,T;if("name"in f&&f.name){if(p=s.get(f.name),!p)throw Mt(1,{location:f});T=p.record.name,_=se(Cr(h.params,p.keys.filter(y=>!y.optional).map(y=>y.name)),f.params&&Cr(f.params,p.keys.map(y=>y.name))),C=p.stringify(_)}else if("path"in f)C=f.path,p=n.find(y=>y.re.test(C)),p&&(_=p.parse(C),T=p.record.name);else{if(p=h.name?s.get(h.name):n.find(y=>y.re.test(h.path)),!p)throw Mt(1,{location:f,currentLocation:h});T=p.record.name,_=se({},h.params,f.params),C=p.stringify(_)}const $=[];let g=p;for(;g;)$.unshift(g.record),g=g.parent;return{name:T,path:C,params:_,matched:$,meta:au($)}}return e.forEach(f=>i(f)),{addRoute:i,resolve:a,removeRoute:o,getRoutes:l,getRecordMatcher:r}}function Cr(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function uu(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:fu(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function fu(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="boolean"?n:n[s];return t}function xr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function au(e){return e.reduce((t,n)=>se(t,n.meta),{})}function wr(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}function qi(e,t){return t.children.some(n=>n===e||qi(e,n))}const Vi=/#/g,du=/&/g,hu=/\//g,pu=/=/g,gu=/\?/g,zi=/\+/g,mu=/%5B/g,_u=/%5D/g,Qi=/%5E/g,yu=/%60/g,Yi=/%7B/g,bu=/%7C/g,Ji=/%7D/g,vu=/%20/g;function Ms(e){return encodeURI(""+e).replace(bu,"|").replace(mu,"[").replace(_u,"]")}function Eu(e){return Ms(e).replace(Yi,"{").replace(Ji,"}").replace(Qi,"^")}function os(e){return Ms(e).replace(zi,"%2B").replace(vu,"+").replace(Vi,"%23").replace(du,"%26").replace(yu,"`").replace(Yi,"{").replace(Ji,"}").replace(Qi,"^")}function Cu(e){return os(e).replace(pu,"%3D")}function xu(e){return Ms(e).replace(Vi,"%23").replace(gu,"%3F")}function wu(e){return e==null?"":xu(e).replace(hu,"%2F")}function Rn(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function Ru(e){const t={};if(e===""||e==="?")return t;const s=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;ri&&os(i)):[s&&os(s)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function Pu(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=Be(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const Tu=Symbol(""),Pr=Symbol(""),Ln=Symbol(""),Is=Symbol(""),ls=Symbol("");function kt(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function nt(e,t,n,s,r){const i=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((o,l)=>{const c=h=>{h===!1?l(Mt(4,{from:n,to:t})):h instanceof Error?l(h):Zc(h)?l(Mt(2,{from:t,to:h})):(i&&s.enterCallbacks[r]===i&&typeof h=="function"&&i.push(h),o())},a=e.call(s&&s.instances[r],t,n,c);let f=Promise.resolve(a);e.length<3&&(f=f.then(c)),f.catch(h=>l(h))})}function Qn(e,t,n,s){const r=[];for(const i of e)for(const o in i.components){let l=i.components[o];if(!(t!=="beforeRouteEnter"&&!i.instances[o]))if(Au(l)){const a=(l.__vccOpts||l)[t];a&&r.push(nt(a,n,s,i,o))}else{let c=l();r.push(()=>c.then(a=>{if(!a)return Promise.reject(new Error(`Couldn't resolve component "${o}" at "${i.path}"`));const f=Lc(a)?a.default:a;i.components[o]=f;const p=(f.__vccOpts||f)[t];return p&&nt(p,n,s,i,o)()}))}}return r}function Au(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Tr(e){const t=je(Ln),n=je(Is),s=Ae(()=>t.resolve(wt(e.to))),r=Ae(()=>{const{matched:c}=s.value,{length:a}=c,f=c[a-1],h=n.matched;if(!f||!h.length)return-1;const p=h.findIndex(St.bind(null,f));if(p>-1)return p;const _=Ar(c[a-2]);return a>1&&Ar(f)===_&&h[h.length-1].path!==_?h.findIndex(St.bind(null,c[a-2])):p}),i=Ae(()=>r.value>-1&&Iu(n.params,s.value.params)),o=Ae(()=>r.value>-1&&r.value===n.matched.length-1&&Di(n.params,s.value.params));function l(c={}){return Mu(c)?t[wt(e.replace)?"replace":"push"](wt(e.to)).catch(Wt):Promise.resolve()}return{route:s,href:Ae(()=>s.value.href),isActive:i,isExactActive:o,navigate:l}}const Ou=Rs({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Tr,setup(e,{slots:t}){const n=tn(Tr(e)),{options:s}=je(Ln),r=Ae(()=>({[Or(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Or(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:Ss("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Su=Ou;function Mu(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Iu(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Be(r)||r.length!==s.length||s.some((i,o)=>i!==r[o]))return!1}return!0}function Ar(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Or=(e,t,n)=>e??t??n,Nu=Rs({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=je(ls),r=Ae(()=>e.route||s.value),i=je(Pr,0),o=Ae(()=>{let a=wt(i);const{matched:f}=r.value;let h;for(;(h=f[a])&&!h.components;)a++;return a}),l=Ae(()=>r.value.matched[o.value]);gn(Pr,Ae(()=>o.value+1)),gn(Tu,l),gn(ls,r);const c=pn();return mn(()=>[c.value,l.value,e.name],([a,f,h],[p,_,C])=>{f&&(f.instances[h]=a,_&&_!==f&&a&&a===p&&(f.leaveGuards.size||(f.leaveGuards=_.leaveGuards),f.updateGuards.size||(f.updateGuards=_.updateGuards))),a&&f&&(!_||!St(f,_)||!p)&&(f.enterCallbacks[h]||[]).forEach(T=>T(a))},{flush:"post"}),()=>{const a=r.value,f=e.name,h=l.value,p=h&&h.components[f];if(!p)return Sr(n.default,{Component:p,route:a});const _=h.props[f],C=_?_===!0?a.params:typeof _=="function"?_(a):_:null,$=Ss(p,se({},C,t,{onVnodeUnmounted:g=>{g.component.isUnmounted&&(h.instances[f]=null)},ref:c}));return Sr(n.default,{Component:$,route:a})||$}}});function Sr(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Fu=Nu;function of(e){const t=cu(e.routes,e),n=e.parseQuery||Ru,s=e.stringifyQuery||Rr,r=e.history,i=kt(),o=kt(),l=kt(),c=Wo(Ge);let a=Ge;bt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const f=Vn.bind(null,v=>""+v),h=Vn.bind(null,wu),p=Vn.bind(null,Rn);function _(v,I){let O,H;return Ki(v)?(O=t.getRecordMatcher(v),H=I):H=v,t.addRoute(H,O)}function C(v){const I=t.getRecordMatcher(v);I&&t.removeRoute(I)}function T(){return t.getRoutes().map(v=>v.record)}function $(v){return!!t.getRecordMatcher(v)}function g(v,I){if(I=se({},I||c.value),typeof v=="string"){const u=zn(n,v,I.path),d=t.resolve({path:u.path},I),m=r.createHref(u.fullPath);return se(u,d,{params:p(d.params),hash:Rn(u.hash),redirectedFrom:void 0,href:m})}let O;if("path"in v)O=se({},v,{path:zn(n,v.path,I.path).path});else{const u=se({},v.params);for(const d in u)u[d]==null&&delete u[d];O=se({},v,{params:h(v.params)}),I.params=h(I.params)}const H=t.resolve(O,I),te=v.hash||"";H.params=f(p(H.params));const fe=Hc(s,se({},v,{hash:Eu(te),path:H.path})),Y=r.createHref(fe);return se({fullPath:fe,hash:te,query:s===Rr?Pu(v.query):v.query||{}},H,{redirectedFrom:void 0,href:Y})}function y(v){return typeof v=="string"?zn(n,v,c.value.path):se({},v)}function P(v,I){if(a!==v)return Mt(8,{from:I,to:v})}function k(v){return z(v)}function D(v){return k(se(y(v),{replace:!0}))}function J(v){const I=v.matched[v.matched.length-1];if(I&&I.redirect){const{redirect:O}=I;let H=typeof O=="function"?O(v):O;return typeof H=="string"&&(H=H.includes("?")||H.includes("#")?H=y(H):{path:H},H.params={}),se({query:v.query,hash:v.hash,params:"path"in H?{}:v.params},H)}}function z(v,I){const O=a=g(v),H=c.value,te=v.state,fe=v.force,Y=v.replace===!0,u=J(O);if(u)return z(se(y(u),{state:typeof u=="object"?se({},te,u.state):te,force:fe,replace:Y}),I||O);const d=O;d.redirectedFrom=I;let m;return!fe&&jc(s,H,O)&&(m=Mt(16,{to:d,from:H}),lt(H,H,!0,!1)),(m?Promise.resolve(m):q(d,H)).catch(b=>qe(b)?qe(b,2)?b:Ie(b):oe(b,d,H)).then(b=>{if(b){if(qe(b,2))return z(se({replace:Y},y(b.to),{state:typeof b.to=="object"?se({},te,b.to.state):te,force:fe}),I||d)}else b=Z(d,H,!0,Y,te);return K(d,H,b),b})}function S(v,I){const O=P(v,I);return O?Promise.reject(O):Promise.resolve()}function q(v,I){let O;const[H,te,fe]=Lu(v,I);O=Qn(H.reverse(),"beforeRouteLeave",v,I);for(const u of H)u.leaveGuards.forEach(d=>{O.push(nt(d,v,I))});const Y=S.bind(null,v,I);return O.push(Y),yt(O).then(()=>{O=[];for(const u of i.list())O.push(nt(u,v,I));return O.push(Y),yt(O)}).then(()=>{O=Qn(te,"beforeRouteUpdate",v,I);for(const u of te)u.updateGuards.forEach(d=>{O.push(nt(d,v,I))});return O.push(Y),yt(O)}).then(()=>{O=[];for(const u of v.matched)if(u.beforeEnter&&!I.matched.includes(u))if(Be(u.beforeEnter))for(const d of u.beforeEnter)O.push(nt(d,v,I));else O.push(nt(u.beforeEnter,v,I));return O.push(Y),yt(O)}).then(()=>(v.matched.forEach(u=>u.enterCallbacks={}),O=Qn(fe,"beforeRouteEnter",v,I),O.push(Y),yt(O))).then(()=>{O=[];for(const u of o.list())O.push(nt(u,v,I));return O.push(Y),yt(O)}).catch(u=>qe(u,8)?u:Promise.reject(u))}function K(v,I,O){for(const H of l.list())H(v,I,O)}function Z(v,I,O,H,te){const fe=P(v,I);if(fe)return fe;const Y=I===Ge,u=bt?history.state:{};O&&(H||Y?r.replace(v.fullPath,se({scroll:Y&&u&&u.scroll},te)):r.push(v.fullPath,te)),c.value=v,lt(v,I,O,Y),Ie()}let N;function Q(){N||(N=r.listen((v,I,O)=>{if(!rn.listening)return;const H=g(v),te=J(H);if(te){z(se(te,{replace:!0}),H).catch(Wt);return}a=H;const fe=c.value;bt&&zc(_r(fe.fullPath,O.delta),Fn()),q(H,fe).catch(Y=>qe(Y,12)?Y:qe(Y,2)?(z(Y.to,H).then(u=>{qe(u,20)&&!O.delta&&O.type===Gt.pop&&r.go(-1,!1)}).catch(Wt),Promise.reject()):(O.delta&&r.go(-O.delta,!1),oe(Y,H,fe))).then(Y=>{Y=Y||Z(H,fe,!1),Y&&(O.delta&&!qe(Y,8)?r.go(-O.delta,!1):O.type===Gt.pop&&qe(Y,20)&&r.go(-1,!1)),K(H,fe,Y)}).catch(Wt)}))}let L=kt(),_e=kt(),ee;function oe(v,I,O){Ie(v);const H=_e.list();return H.length?H.forEach(te=>te(v,I,O)):console.error(v),Promise.reject(v)}function re(){return ee&&c.value!==Ge?Promise.resolve():new Promise((v,I)=>{L.add([v,I])})}function Ie(v){return ee||(ee=!v,Q(),L.list().forEach(([I,O])=>v?O(v):I()),L.reset()),v}function lt(v,I,O,H){const{scrollBehavior:te}=e;if(!bt||!te)return Promise.resolve();const fe=!O&&Qc(_r(v.fullPath,0))||(H||!O)&&history.state&&history.state.scroll||null;return ni().then(()=>te(v,I,fe)).then(Y=>Y&&Vc(Y)).catch(Y=>oe(Y,v,I))}const Ne=v=>r.go(v);let ve;const mt=new Set,rn={currentRoute:c,listening:!0,addRoute:_,removeRoute:C,hasRoute:$,getRoutes:T,resolve:g,options:e,push:k,replace:D,go:Ne,back:()=>Ne(-1),forward:()=>Ne(1),beforeEach:i.add,beforeResolve:o.add,afterEach:l.add,onError:_e.add,isReady:re,install(v){const I=this;v.component("RouterLink",Su),v.component("RouterView",Fu),v.config.globalProperties.$router=I,Object.defineProperty(v.config.globalProperties,"$route",{enumerable:!0,get:()=>wt(c)}),bt&&!ve&&c.value===Ge&&(ve=!0,k(r.location).catch(te=>{}));const O={};for(const te in Ge)O[te]=Ae(()=>c.value[te]);v.provide(Ln,I),v.provide(Is,tn(O)),v.provide(ls,c);const H=v.unmount;mt.add(v),v.unmount=function(){mt.delete(v),mt.size<1&&(a=Ge,N&&N(),N=null,c.value=Ge,ve=!1,ee=!1),H()}}};return rn}function yt(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function Lu(e,t){const n=[],s=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let o=0;oSt(a,l))?s.push(l):n.push(l));const c=e.matched[o];c&&(t.matched.find(a=>St(a,c))||r.push(c))}return[n,s,r]}function lf(){return je(Ln)}function cf(){return je(Is)}const uf=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n};export{Ai as $,ju as A,lf as B,gi as C,Du as D,Xu as E,Hu as F,Zu as G,Ju as H,Yu as I,Gu as J,gn as K,Vu as L,ef as M,Tr as N,sf as O,of as P,zu as Q,Su as R,Ge as S,Ni as T,rf as U,Fu as V,jl as W,Ku as X,de as Y,nl as Z,uf as _,zr as a,Oi as a0,Wu as a1,qu as a2,Re as a3,Uu as a4,$u as a5,tn as b,Rs as c,Bu as d,U as e,Qu as f,nf as g,Ae as h,pe as i,Ss as j,Nc as k,tf as l,je as m,Si as n,hi as o,We as p,An as q,pn as r,wt as s,ni as t,cf as u,mi as v,mn as w,go as x,ku as y,Wo as z}; diff --git a/assets/frontmatter.html-397e5aab.js b/assets/frontmatter.html-397e5aab.js new file mode 100644 index 00000000..6367fcb0 --- /dev/null +++ b/assets/frontmatter.html-397e5aab.js @@ -0,0 +1,30 @@ +import{_ as c,W as u,X as d,Y as t,$ as n,a0 as a,Z as s,a1 as o,D as l}from"./framework-46b0e263.js";const r={},m=n("h1",{id:"frontmatter",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),a(" Frontmatter")],-1),k=n("h2",{id:"date",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#date","aria-hidden":"true"},"#"),a(" date")],-1),h=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string")])],-1),_=n("p",null,"详情:",-1),v=n("p",null,"页面的创建日期。",-1),g=n("code",null,"yyyy-MM-dd",-1),f={href:"https://yaml.org/type/timestamp.html",target:"_blank",rel:"noopener noreferrer"},b=n("p",null,"参考:",-1),y=n("h2",{id:"description",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#description","aria-hidden":"true"},"#"),a(" description")],-1),x=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string")])],-1),P=n("li",null,[n("p",null,"详情:"),n("p",null,"页面的描述。"),n("p",null,[a("它将会覆盖站点配置中的 "),n("code",null,"description"),a(" 配置项。")])],-1),w=n("p",null,"参考:",-1),q=o(`
    • 类型: HeadConfig[]

    • 详情:

      页面 <head> 标签内添加的额外标签。

    • 示例:

    ---
    +head:
    +  - - meta
    +    - name: foo
    +      content: yaml 数组语法
    +  - [meta, { name: bar, content: 方括号语法 }]
    +---
    +

    渲染为:

    <head>
    +  <meta name="foo" content="yaml 数组语法" />
    +  <meta name="bar" content="方括号语法" />
    +</head>
    +
    `,5),M=n("h2",{id:"lang",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#lang","aria-hidden":"true"},"#"),a(" lang")],-1),z=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string")])],-1),F=n("li",null,[n("p",null,"详情:"),n("p",null,"页面的语言。"),n("p",null,[a("它将会覆盖站点配置中的 "),n("code",null,"lang"),a(" 配置项")])],-1),N=n("p",null,"参考:",-1),C=o(`

    layout

    • 类型: string

    • 详情:

      页面的布局。

      布局是由主题提供的。如果你不指定该 Frontmatter ,则会使用默认布局。你应该参考主题自身的文档来了解其提供了哪些布局。

      如果主题布局无法满足你的需求,你可以使用自定义布局组件。

    • 示例:

    .vuepress/client.ts 文件中注册一个布局组件:

    import { defineClientConfig } from "@vuepress/client";
    +import CustomLayout from "./CustomLayout.vue";
    +
    +export default defineClientConfig({
    +  layouts: {
    +    CustomLayout,
    +  },
    +});
    +

    在 Frontmatter 中设置自定义布局:

    ---
    +layout: CustomLayout
    +---
    +
    `,7),L=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string")])],-1),A=n("li",null,[n("p",null,"详情:"),n("p",null,"页面的永久链接。"),n("p",null,"它将会覆盖根据文件路径来决定的默认路由路径。")],-1),I=n("p",null,"参考:",-1),B=n("li",null,[n("a",{href:"#permalinkpattern"},"Frontmatter > permalinkPattern")],-1),E=o(`

    permalinkPattern

    • 类型: string | null

    • 详情:

      为页面生成永久链接的 Pattern 。

      它将会覆盖站点配置中的 permalinkPattern 配置项。

      如果 Frontmatter 中设置了 permalink ,那么这个字段则不会生效。

    • 使用:

      Pattern描述
      :year创建日期的 年 部分
      :month创建日期的 月 部分
      :day创建日期的 日 部分
      :slug页面文件名的 Slug
      :raw原始路由路径

      :year, :month:day Pattern 根据如下优先级进行解析:

      • Frontmatter 中的 date 字段。
      • 符合 yyyy-MM-dd-foobar.mdyyyy-MM-foobar.md 日期格式的文件名。
      • 符合 yyyy/MM/dd/foobar.mdyyyy/MM/foobar.md 日期格式的目录名。
      • 默认值 0000-00-00
    • 示例 1 :

      页面文件名是 foo-bar.md

      页面 Frontmatter 是:

    ---
    +date: 2021-01-03
    +permalinkPattern: :year/:month/:day/:slug.html
    +---
    +

    那么页面的永久链接将会是 2021/01/03/foo-bar.html

    • 示例 2 :

      页面文件名是 2021-01-03-bar-baz.md

      页面 Frontmatter 是:

    ---
    +permalinkPattern: :year/:month/:day/:slug.html
    +---
    +

    那么页面的永久链接将会是 2021/01/03/bar-baz.html

    `,7),V=n("li",null,[n("a",{href:"#date"},"Frontmatter > date")],-1),R=n("li",null,[n("a",{href:"#permalink"},"Frontmatter > permalink")],-1),T=n("h2",{id:"routemeta",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#routemeta","aria-hidden":"true"},"#"),a(" routeMeta")],-1),S=n("li",null,[n("p",null,[a("类型: "),n("code",null,"Record")])],-1),Y=n("li",null,[n("p",null,"详情:"),n("p",null,"附加到页面路由的自定义数据。")],-1),D=n("p",null,"参考:",-1),H=n("h2",{id:"title",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#title","aria-hidden":"true"},"#"),a(" title")],-1),W=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string")])],-1),X=n("li",null,[n("p",null,"详情:"),n("p",null,"页面的标题。"),n("p",null,[a("如果你不在 Frontmatter 中设置 "),n("code",null,"title"),a(" ,那么页面中第一个一级标题(即 "),n("code",null,"# title"),a(")的内容会被当作标题使用。")])],-1),Z=n("p",null,"参考:",-1);function $(j,G){const p=l("NpmBadge"),i=l("ExternalLinkIcon"),e=l("RouterLink");return u(),d("div",null,[m,t(p,{package:"@vuepress/client"}),t(p,{package:"@vuepress/markdown"}),k,n("ul",null,[h,n("li",null,[_,v,n("p",null,[a("应按照 "),g,a(" 的格式来指定日期,或者遵循 "),n("a",f,[a("YAML Timestamp Type"),t(i)]),a(" 。")])]),n("li",null,[b,n("ul",null,[n("li",null,[t(e,{to:"/zh/reference/node-api.html#date"},{default:s(()=>[a("Node API > Page 属性 > date")]),_:1})])])])]),y,n("ul",null,[x,P,n("li",null,[w,n("ul",null,[n("li",null,[t(e,{to:"/zh/reference/config.html#description"},{default:s(()=>[a("配置 > description")]),_:1})])])])]),q,n("ul",null,[n("li",null,[a("参考: "),n("ul",null,[n("li",null,[t(e,{to:"/zh/reference/config.html#head"},{default:s(()=>[a("配置 > head")]),_:1})])])])]),M,n("ul",null,[z,F,n("li",null,[N,n("ul",null,[n("li",null,[t(e,{to:"/zh/reference/config.html#lang"},{default:s(()=>[a("配置 > lang")]),_:1})]),n("li",null,[t(e,{to:"/zh/reference/node-api.html#lang"},{default:s(()=>[a("Node API > Page 属性 > lang")]),_:1})])])])]),C,n("ul",null,[L,A,n("li",null,[I,n("ul",null,[B,n("li",null,[t(e,{to:"/zh/guide/page.html#%E8%B7%AF%E7%94%B1"},{default:s(()=>[a("指南 > 页面 > 路由")]),_:1})]),n("li",null,[t(e,{to:"/zh/reference/node-api.html#permalink"},{default:s(()=>[a("Node API > Page 属性 > permalink")]),_:1})])])])]),E,n("ul",null,[n("li",null,[a("参考: "),n("ul",null,[n("li",null,[t(e,{to:"/zh/reference/config.html#permalinkpattern"},{default:s(()=>[a("配置 > permalinkPattern")]),_:1})]),V,R,n("li",null,[t(e,{to:"/zh/reference/node-api.html#permalink"},{default:s(()=>[a("Node API > Page 属性 > permalink")]),_:1})])])])]),T,n("ul",null,[S,Y,n("li",null,[D,n("ul",null,[n("li",null,[t(e,{to:"/zh/reference/node-api.html#routeMeta"},{default:s(()=>[a("Node API > Page 属性 > routeMeta")]),_:1})])])])]),H,n("ul",null,[W,X,n("li",null,[Z,n("ul",null,[n("li",null,[t(e,{to:"/zh/reference/node-api.html#title"},{default:s(()=>[a("Node API > Page 属性 > title")]),_:1})])])])])])}const K=c(r,[["render",$],["__file","frontmatter.html.vue"]]);export{K as default}; diff --git a/assets/frontmatter.html-457ea87f.js b/assets/frontmatter.html-457ea87f.js new file mode 100644 index 00000000..7ae0f1f5 --- /dev/null +++ b/assets/frontmatter.html-457ea87f.js @@ -0,0 +1,60 @@ +import{_ as c,W as d,X as p,Y as a,$ as n,a0 as e,Z as l,a1 as t,D as i}from"./framework-46b0e263.js";const r={},h=n("h1",{id:"frontmatter",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),e(" Frontmatter")],-1),m=n("h2",{id:"所有页面",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#所有页面","aria-hidden":"true"},"#"),e(" 所有页面")],-1),k=n("p",null,"本章节中的 Frontmatter 会在所有类型的页面中生效。",-1),v=n("h3",{id:"externallinkicon",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#externallinkicon","aria-hidden":"true"},"#"),e(" externalLinkIcon")],-1),_=n("li",null,[n("p",null,[e("类型: "),n("code",null,"boolean")])],-1),b=n("p",null,"详情:",-1),g=n("p",null,"参考:",-1),f=n("h3",{id:"navbar",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#navbar","aria-hidden":"true"},"#"),e(" navbar")],-1),x=n("li",null,[n("p",null,[e("类型: "),n("code",null,"boolean")])],-1),y=n("li",null,[n("p",null,"详情:"),n("p",null,"是否在当前页面展示导航栏。"),n("p",null,"如果你在主题配置中禁用了导航栏,那么该 Frontmatter 将不会生效。")],-1),L=n("p",null,"参考:",-1),w=t(`

    pageClass

    • 类型: string

    • 详情:

      为当前页面添加额外的类名。

    • 示例:

    ---
    +pageClass: custom-page-class
    +---
    +

    然后你可以在 .vuepress/styles/index.scss 文件中为这个页面添加自定义样式:

    .theme-container.custom-page-class {
    +  /* 页面样式 */
    +}
    +
    `,5),z=t(`

    首页

    本章节中的 Frontmatter 只会在首页中生效。

    home

    • 类型: boolean

    • 详情:

      设定该页面是首页还是普通页面。

      如果你不设置该 Frontmatter 或将其设为 false ,则该页面会是一个 普通页面

    • 示例:

      ---
      +home: true
      +---
      +

    heroImage

    `,5),N=t(`
  • 类型: string

  • 详情:

    首页图片的 URL 。

  • 示例:

    ---
    +# Public 文件路径
    +heroImage: /images/hero.png
    +# URL
    +heroImage: https://vuejs.org/images/logo.png
    +---
    +
  • `,3),B=n("p",null,"参考:",-1),E=n("h3",{id:"heroimagedark",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#heroimagedark","aria-hidden":"true"},"#"),e(" heroImageDark")],-1),F=n("li",null,[n("p",null,[e("类型: "),n("code",null,"string")])],-1),A=n("li",null,[n("p",null,"详情:"),n("p",null,"在夜间模式中使用的首页图片的 URL 。"),n("p",null,"如果你想在夜间模式中使用不同的首页图片,就可以使用该配置项。")],-1),I=n("p",null,"参考:",-1),S=n("li",null,[n("a",{href:"#heroimage"},"默认主题 > Frontmatter > heroImage")],-1),V=t('

    heroAlt

    • 类型: string

    • 详情:

      首页图片的 alt 属性。

      如果不设置,则默认使用 heroText

    heroHeight

    ',3),C=n("li",null,[n("p",null,[e("类型: "),n("code",null,"number")])],-1),P=n("li",null,[n("p",null,[e("默认值: "),n("code",null,"280")])],-1),T=n("p",null,"详情:",-1),H=n("p",null,[e("首页图片 "),n("code",null,""),e(" 标签的 "),n("code",null,"height"),e(" 属性。")],-1),M=n("p",null,"当你的首页图片高度小于默认值时,你可能需要减小该属性。",-1),R={href:"https://web.dev/cls/",target:"_blank",rel:"noopener noreferrer"},U=n("h3",{id:"herotext",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#herotext","aria-hidden":"true"},"#"),e(" heroText")],-1),D=n("li",null,[n("p",null,[e("类型: "),n("code",null,"string | null")])],-1),q=n("p",null,"详情:",-1),j=n("p",null,"首页的大标题。",-1),G=n("p",null,[e("设置为 "),n("code",null,"null"),e(" 来禁用首页大标题。")],-1),O=n("h3",{id:"tagline",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#tagline","aria-hidden":"true"},"#"),e(" tagline")],-1),W=n("li",null,[n("p",null,[e("类型: "),n("code",null,"string | null")])],-1),X=n("p",null,"详情:",-1),Y=n("p",null,"首页的标语。",-1),Z=n("p",null,[e("设置为 "),n("code",null,"null"),e(" 来禁用首页标语。")],-1),$=t(`

    actions

    • 类型:
    Array<{
    +  text: string;
    +  link: string;
    +  type?: "primary" | "secondary";
    +}>;
    +
    • 详情:

      配置首页按钮。

    • 示例:

    ---
    +actions:
    +  - text: 快速上手
    +    link: /zh/guide/getting-started.html
    +    type: primary
    +  - text: 项目简介
    +    link: /guide/
    +    type: secondary
    +---
    +

    features

    • 类型:
    Array<{
    +  title: string;
    +  details: string;
    +}>;
    +
    • 详情:

      配置首页特性列表。

    • 示例:

    ---
    +features:
    +  - title: 简洁至上
    +    details: 以 Markdown 为中心的项目结构,以最少的配置帮助你专注于写作。
    +  - title: Vue 驱动
    +    details: 享受 Vue 的开发体验,可以在 Markdown 中使用 Vue 组件,又可以使用 Vue 来开发自定义主题。
    +  - title: 高性能
    +    details: VuePress 会为每个页面预渲染生成静态的 HTML,同时,每个页面被加载的时候,将作为 SPA 运行。
    +---
    +
    • 类型: string

    • 详情:

      首页的页脚。

    footerHtml

    • 类型: boolean

    • 详情:

      是否允许页脚中使用 HTML 。

      如果设置为 true ,那么 footer 会被作为 HTML 代码处理。

    普通页面

    本章节中的 Frontmatter 只会在普通页面中生效。

    `,17),J=n("li",null,[n("p",null,[e("类型: "),n("code",null,"boolean")])],-1),K=n("li",null,[n("p",null,"详情:"),n("p",null,[e("是否在本页面中启用 "),n("em",null,"编辑此页"),e(" 链接。")])],-1),Q=n("p",null,"参考:",-1),nn=n("h3",{id:"editlinkpattern",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#editlinkpattern","aria-hidden":"true"},"#"),e(" editLinkPattern")],-1),en=n("li",null,[n("p",null,[e("类型: "),n("code",null,"string")])],-1),an=n("li",null,[n("p",null,"详情:"),n("p",null,[e("本页面中 "),n("em",null,"编辑此页"),e(" 链接的 Pattern 。")])],-1),sn=n("p",null,"参考:",-1),ln=n("h3",{id:"lastupdated",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#lastupdated","aria-hidden":"true"},"#"),e(" lastUpdated")],-1),tn=n("li",null,[n("p",null,[e("类型: "),n("code",null,"boolean")])],-1),on=n("li",null,[n("p",null,"详情:"),n("p",null,[e("是否在本页面中启用 "),n("em",null,"最近更新时间戳"),e(" 。")])],-1),un=n("p",null,"参考:",-1),cn=n("h3",{id:"contributors",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#contributors","aria-hidden":"true"},"#"),e(" contributors")],-1),dn=n("li",null,[n("p",null,[e("类型: "),n("code",null,"boolean")])],-1),pn=n("li",null,[n("p",null,"详情:"),n("p",null,[e("是否在本页面中启用 "),n("em",null,"贡献者列表"),e(" 。")])],-1),rn=n("p",null,"参考:",-1),hn=n("h3",{id:"sidebar",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#sidebar","aria-hidden":"true"},"#"),e(" sidebar")],-1),mn=n("li",null,[n("p",null,[e("类型: "),n("code",null,"false | 'auto' | SidebarConfigArray | SidebarConfigObject")])],-1),kn=n("li",null,[n("p",null,"详情:"),n("p",null,"配置本页面的侧边栏。")],-1),vn=n("p",null,"参考:",-1),_n=n("h3",{id:"sidebardepth",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#sidebardepth","aria-hidden":"true"},"#"),e(" sidebarDepth")],-1),bn=n("li",null,[n("p",null,[e("类型: "),n("code",null,"number")])],-1),gn=n("li",null,[n("p",null,"详情:"),n("p",null,"配置本页面的侧边栏深度。")],-1),fn=n("p",null,"参考:",-1),xn=t(`

    prev

    • 类型: NavLink | string

    • 详情:

      上一个页面的链接。

      如果你不设置该 Frontmatter ,该链接会自动根据侧边栏配置进行推断。

      为了手动配置上一页面的链接,你可以将其设置为一个 NavLink 对象或者一个字符串:

      • NavLink 对象应该有一个 text 字段和一个 link 字段。
      • 字符串应为目标页面文件的路径。它将会被转换为 NavLink 对象,将页面标题作为 text ,将页面路由路径作为 link
    • 示例:

    ---
    +# NavLink
    +prev:
    +  text: Get Started
    +  link: /guide/getting-started.html
    +
    +# NavLink - 外部 URL
    +prev:
    +  text: GitHub
    +  link: https://github.com
    +
    +# 字符串 - 页面文件路径
    +prev: /guide/getting-started.md
    +
    +# 字符串 - 页面文件相对路径
    +prev: ../../guide/getting-started.md
    +---
    +

    next

    • 类型: NavLink | string

    • 详情:

      下一个页面的链接。

      如果你不设置该 Frontmatter ,该链接会自动根据侧边栏配置进行推断。

      类型和 prev Frontmatter 相同。

    `,5);function yn(Ln,wn){const o=i("NpmBadge"),s=i("RouterLink"),u=i("ExternalLinkIcon");return d(),p("div",null,[h,a(o,{package:"@vuepress/theme-default"}),m,k,v,n("ul",null,[_,n("li",null,[b,n("p",null,[e("由"),a(s,{to:"/zh/reference/plugin/external-link-icon.html#externallinkicon"},{default:l(()=>[e("@vuepress/plugin-external-link-icon")]),_:1}),e(" 提供。")])]),n("li",null,[g,n("ul",null,[n("li",null,[a(s,{to:"/zh/reference/default-theme/config.html#themeplugins-externallinkicon"},{default:l(()=>[e("默认主题 > 配置 > themePlugins.externalLinkIcon")]),_:1})])])])]),f,n("ul",null,[x,y,n("li",null,[L,n("ul",null,[n("li",null,[a(s,{to:"/zh/reference/default-theme/config.html#navbar"},{default:l(()=>[e("默认主题 > 配置 > navbar")]),_:1})])])])]),w,n("ul",null,[n("li",null,[e("参考: "),n("ul",null,[n("li",null,[a(s,{to:"/zh/reference/default-theme/styles.html#style-%E6%96%87%E4%BB%B6"},{default:l(()=>[e("默认主题 > 样式 > Style 文件")]),_:1})])])])]),z,n("ul",null,[N,n("li",null,[B,n("ul",null,[n("li",null,[a(s,{to:"/zh/guide/assets.html#public-%E6%96%87%E4%BB%B6"},{default:l(()=>[e("指南 > 静态资源 > Public 文件")]),_:1})])])])]),E,n("ul",null,[F,A,n("li",null,[I,n("ul",null,[S,n("li",null,[a(s,{to:"/zh/reference/default-theme/config.html#colormode"},{default:l(()=>[e("默认主题 > 配置 > colorMode")]),_:1})])])])]),V,n("ul",null,[C,P,n("li",null,[T,H,M,n("p",null,[e("需要注意的是,首页图片的高度同样受到了 CSS 的约束。设置这个属性主要是为了减少由加载首页图片引起的 "),n("a",R,[e("累积布局偏移 (CLS)"),a(u)]),e(" 。")])])]),U,n("ul",null,[D,n("li",null,[q,j,n("p",null,[e("如果不设置,则默认使用站点 "),a(s,{to:"/zh/reference/config.html#title"},{default:l(()=>[e("title")]),_:1}),e(" 。")]),G])]),O,n("ul",null,[W,n("li",null,[X,Y,n("p",null,[e("如果不设置,则默认使用站点 "),a(s,{to:"/zh/reference/config.html#description"},{default:l(()=>[e("description")]),_:1}),e(" 。")]),Z])]),$,n("ul",null,[J,K,n("li",null,[Q,n("ul",null,[n("li",null,[a(s,{to:"/zh/reference/default-theme/config.html#editlink"},{default:l(()=>[e("默认主题 > 配置 > editLink")]),_:1})])])])]),nn,n("ul",null,[en,an,n("li",null,[sn,n("ul",null,[n("li",null,[a(s,{to:"/zh/reference/default-theme/config.html#editlinkpattern"},{default:l(()=>[e("默认主题 > 配置 > editLinkPattern")]),_:1})])])])]),ln,n("ul",null,[tn,on,n("li",null,[un,n("ul",null,[n("li",null,[a(s,{to:"/zh/reference/default-theme/config.html#lastupdated"},{default:l(()=>[e("默认主题 > 配置 > lastUpdated")]),_:1})])])])]),cn,n("ul",null,[dn,pn,n("li",null,[rn,n("ul",null,[n("li",null,[a(s,{to:"/zh/reference/default-theme/config.html#contributors"},{default:l(()=>[e("默认主题 > 配置 > contributors")]),_:1})])])])]),hn,n("ul",null,[mn,kn,n("li",null,[vn,n("ul",null,[n("li",null,[a(s,{to:"/zh/reference/default-theme/config.html#sidebar"},{default:l(()=>[e("默认主题 > 配置 > sidebar")]),_:1})])])])]),_n,n("ul",null,[bn,gn,n("li",null,[fn,n("ul",null,[n("li",null,[a(s,{to:"/zh/reference/default-theme/config.html#sidebardepth"},{default:l(()=>[e("默认主题 > 配置 > sidebarDepth")]),_:1})])])])]),xn])}const Nn=c(r,[["render",yn],["__file","frontmatter.html.vue"]]);export{Nn as default}; diff --git a/assets/frontmatter.html-5c8a8e5d.js b/assets/frontmatter.html-5c8a8e5d.js new file mode 100644 index 00000000..415baf83 --- /dev/null +++ b/assets/frontmatter.html-5c8a8e5d.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3590f0ec","path":"/reference/frontmatter.html","title":"Frontmatter","lang":"en-US","frontmatter":{"icon":"fa-solid:bars","description":"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 (https://yaml.org/type/timestamp...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/frontmatter.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/frontmatter.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Frontmatter"}],["meta",{"property":"og:description","content":"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 (https://yaml.org/type/timestamp..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Frontmatter\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.96,"words":588},"filePathRelative":"reference/frontmatter.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/frontmatter.html-5f732d4f.js b/assets/frontmatter.html-5f732d4f.js new file mode 100644 index 00000000..5a9c455b --- /dev/null +++ b/assets/frontmatter.html-5f732d4f.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-a566dc26","path":"/zh/reference/default-theme/frontmatter.html","title":"Frontmatter","lang":"zh-CN","frontmatter":{"icon":"fa-solid:bars","description":"所有页面 本章节中的 Frontmatter 会在所有类型的页面中生效。 externalLinkIcon 类型: boolean; 详情:; 由@vuepress/plugin-external-link-icon (../plugin/external-link-icon.md#externallinkicon) 提供。 参考:; 默认主题 > 配...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/default-theme/frontmatter.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/default-theme/frontmatter.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Frontmatter"}],["meta",{"property":"og:description","content":"所有页面 本章节中的 Frontmatter 会在所有类型的页面中生效。 externalLinkIcon 类型: boolean; 详情:; 由@vuepress/plugin-external-link-icon (../plugin/external-link-icon.md#externallinkicon) 提供。 参考:; 默认主题 > 配..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Frontmatter\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"所有页面","slug":"所有页面","link":"#所有页面","children":[{"level":3,"title":"externalLinkIcon","slug":"externallinkicon","link":"#externallinkicon","children":[]},{"level":3,"title":"navbar","slug":"navbar","link":"#navbar","children":[]},{"level":3,"title":"pageClass","slug":"pageclass","link":"#pageclass","children":[]}]},{"level":2,"title":"首页","slug":"首页","link":"#首页","children":[{"level":3,"title":"home","slug":"home","link":"#home","children":[]},{"level":3,"title":"heroImage","slug":"heroimage","link":"#heroimage","children":[]},{"level":3,"title":"heroImageDark","slug":"heroimagedark","link":"#heroimagedark","children":[]},{"level":3,"title":"heroAlt","slug":"heroalt","link":"#heroalt","children":[]},{"level":3,"title":"heroHeight","slug":"heroheight","link":"#heroheight","children":[]},{"level":3,"title":"heroText","slug":"herotext","link":"#herotext","children":[]},{"level":3,"title":"tagline","slug":"tagline","link":"#tagline","children":[]},{"level":3,"title":"actions","slug":"actions","link":"#actions","children":[]},{"level":3,"title":"features","slug":"features","link":"#features","children":[]},{"level":3,"title":"footer","slug":"footer","link":"#footer","children":[]},{"level":3,"title":"footerHtml","slug":"footerhtml","link":"#footerhtml","children":[]}]},{"level":2,"title":"普通页面","slug":"普通页面","link":"#普通页面","children":[{"level":3,"title":"editLink","slug":"editlink","link":"#editlink","children":[]},{"level":3,"title":"editLinkPattern","slug":"editlinkpattern","link":"#editlinkpattern","children":[]},{"level":3,"title":"lastUpdated","slug":"lastupdated","link":"#lastupdated","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]},{"level":3,"title":"sidebar","slug":"sidebar","link":"#sidebar","children":[]},{"level":3,"title":"sidebarDepth","slug":"sidebardepth","link":"#sidebardepth","children":[]},{"level":3,"title":"prev","slug":"prev","link":"#prev","children":[]},{"level":3,"title":"next","slug":"next","link":"#next","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":4.18,"words":1254},"filePathRelative":"zh/reference/default-theme/frontmatter.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/frontmatter.html-60124b9c.js b/assets/frontmatter.html-60124b9c.js new file mode 100644 index 00000000..f34b291d --- /dev/null +++ b/assets/frontmatter.html-60124b9c.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-e5e26a84","path":"/reference/default-theme/frontmatter.html","title":"Frontmatter","lang":"en-US","frontmatter":{"icon":"fa-solid:bars","description":"All Pages Frontmatter in this section will take effect in all types of pages. externalLinkIcon Type: boolean; Details:; Provided by @vuepress/plugin-external-link-icon (../plugi...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/default-theme/frontmatter.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/default-theme/frontmatter.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Frontmatter"}],["meta",{"property":"og:description","content":"All Pages Frontmatter in this section will take effect in all types of pages. externalLinkIcon Type: boolean; Details:; Provided by @vuepress/plugin-external-link-icon (../plugi..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Frontmatter\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"All Pages","slug":"all-pages","link":"#all-pages","children":[{"level":3,"title":"externalLinkIcon","slug":"externallinkicon","link":"#externallinkicon","children":[]},{"level":3,"title":"navbar","slug":"navbar","link":"#navbar","children":[]},{"level":3,"title":"pageClass","slug":"pageclass","link":"#pageclass","children":[]}]},{"level":2,"title":"Home Page","slug":"home-page","link":"#home-page","children":[{"level":3,"title":"home","slug":"home","link":"#home","children":[]},{"level":3,"title":"heroImage","slug":"heroimage","link":"#heroimage","children":[]},{"level":3,"title":"heroImageDark","slug":"heroimagedark","link":"#heroimagedark","children":[]},{"level":3,"title":"heroAlt","slug":"heroalt","link":"#heroalt","children":[]},{"level":3,"title":"heroHeight","slug":"heroheight","link":"#heroheight","children":[]},{"level":3,"title":"heroText","slug":"herotext","link":"#herotext","children":[]},{"level":3,"title":"tagline","slug":"tagline","link":"#tagline","children":[]},{"level":3,"title":"actions","slug":"actions","link":"#actions","children":[]},{"level":3,"title":"features","slug":"features","link":"#features","children":[]},{"level":3,"title":"footer","slug":"footer","link":"#footer","children":[]},{"level":3,"title":"footerHtml","slug":"footerhtml","link":"#footerhtml","children":[]}]},{"level":2,"title":"Normal Page","slug":"normal-page","link":"#normal-page","children":[{"level":3,"title":"editLink","slug":"editlink","link":"#editlink","children":[]},{"level":3,"title":"editLinkPattern","slug":"editlinkpattern","link":"#editlinkpattern","children":[]},{"level":3,"title":"lastUpdated","slug":"lastupdated","link":"#lastupdated","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]},{"level":3,"title":"sidebar","slug":"sidebar","link":"#sidebar","children":[]},{"level":3,"title":"sidebarDepth","slug":"sidebardepth","link":"#sidebardepth","children":[]},{"level":3,"title":"prev","slug":"prev","link":"#prev","children":[]},{"level":3,"title":"next","slug":"next","link":"#next","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":2.91,"words":874},"filePathRelative":"reference/default-theme/frontmatter.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/frontmatter.html-9281febe.js b/assets/frontmatter.html-9281febe.js new file mode 100644 index 00000000..07856d27 --- /dev/null +++ b/assets/frontmatter.html-9281febe.js @@ -0,0 +1,30 @@ +import{_ as u,W as c,X as d,Y as e,$ as n,a0 as a,Z as s,a1 as o,D as l}from"./framework-46b0e263.js";const r={},m=n("h1",{id:"frontmatter",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),a(" Frontmatter")],-1),h=n("h2",{id:"date",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#date","aria-hidden":"true"},"#"),a(" date")],-1),k=n("li",null,[n("p",null,[a("Type: "),n("code",null,"string")])],-1),f=n("p",null,"Details:",-1),g=n("p",null,"Created date for the page.",-1),y=n("code",null,"yyyy-MM-dd",-1),v={href:"https://yaml.org/type/timestamp.html",target:"_blank",rel:"noopener noreferrer"},_=n("p",null,"Also see:",-1),b=n("h2",{id:"description",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#description","aria-hidden":"true"},"#"),a(" description")],-1),x=n("li",null,[n("p",null,[a("Type: "),n("code",null,"string")])],-1),w=n("li",null,[n("p",null,"Details:"),n("p",null,"Description for the page."),n("p",null,[a("This will override the "),n("code",null,"description"),a(" option in your site config.")])],-1),P=n("p",null,"Also see:",-1),T=o(`
    • Type: HeadConfig[]

    • Details:

      Extra tags in <head> tag for the page.

    • Example:

    ---
    +head:
    +  - - meta
    +    - name: foo
    +      content: yaml array syntax
    +  - [meta, { name: bar, content: square brackets syntax }]
    +---
    +

    Rendered as:

    <head>
    +  <meta name="foo" content="yaml array syntax" />
    +  <meta name="bar" content="square brackets syntax" />
    +</head>
    +
    `,5),q=n("h2",{id:"lang",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#lang","aria-hidden":"true"},"#"),a(" lang")],-1),C=n("li",null,[n("p",null,[a("Type: "),n("code",null,"string")])],-1),A=n("li",null,[n("p",null,"Details:"),n("p",null,"Language for the page."),n("p",null,[a("This will override the "),n("code",null,"lang"),a(" option in your site config.")])],-1),M=n("p",null,"Also see:",-1),D=o(`

    layout

    • Type: string

    • Details:

      Layout for the page.

      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:

    import { defineClientConfig } from "@vuepress/client";
    +import CustomLayout from "./CustomLayout.vue";
    +
    +export default defineClientConfig({
    +  layouts: {
    +    CustomLayout,
    +  },
    +});
    +

    Set custom layout in frontmatter:

    ---
    +layout: CustomLayout
    +---
    +
    `,7),L=n("li",null,[n("p",null,[a("Type: "),n("code",null,"string")])],-1),N=n("li",null,[n("p",null,"Details:"),n("p",null,"Permalink for the page."),n("p",null,"This will override the default route path that determined by the file path of the page.")],-1),I=n("p",null,"Also see:",-1),E=n("li",null,[n("a",{href:"#permalinkpattern"},"Frontmatter > permalinkPattern")],-1),R=o(`

    permalinkPattern

    • Type: string | null

    • Details:

      Pattern to generate permalink for the page.

      This will override the permalinkPattern option in your site config.

      This won't take effect if the permalink frontmatter has been set.

    • Usage:

      PatternDescription
      :yearYear part of created date
      :monthMonth part of created date
      :dayDay part of created date
      :slugSlug of page filename
      :rawRaw route path

      The :year, :month and :day patterns are resolved according to the following priority:

      • The date frontmatter.
      • The filename that matches the date pattern yyyy-MM-dd-foobar.md or yyyy-MM-foobar.md.
      • The dirname that matches the date pattern yyyy/MM/dd/foobar.md or yyyy/MM/foobar.md.
      • Fallback to 0000-00-00.
    • Example 1:

      The page filename is foo-bar.md.

      The page frontmatter is:

    ---
    +date: 2021-01-03
    +permalinkPattern: :year/:month/:day/:slug.html
    +---
    +

    Then the permalink of the page would be 2021/01/03/foo-bar.html.

    • Example 2:

      The page filename is 2021-01-03-bar-baz.md.

      The page frontmatter is:

    ---
    +permalinkPattern: :year/:month/:day/:slug.html
    +---
    +

    Then the permalink of the page would be 2021/01/03/bar-baz.html.

    `,7),B=n("li",null,[n("a",{href:"#date"},"Frontmatter > date")],-1),F=n("li",null,[n("a",{href:"#permalink"},"Frontmatter > permalink")],-1),Y=n("h2",{id:"routemeta",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#routemeta","aria-hidden":"true"},"#"),a(" routeMeta")],-1),V=n("li",null,[n("p",null,[a("Type: "),n("code",null,"Record")])],-1),S=n("li",null,[n("p",null,"Details:"),n("p",null,"Custom data to be attached to the page route.")],-1),z=n("p",null,"Also see:",-1),G=n("h2",{id:"title",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#title","aria-hidden":"true"},"#"),a(" title")],-1),H=n("li",null,[n("p",null,[a("Type: "),n("code",null,"string")])],-1),U=n("li",null,[n("p",null,"Details:"),n("p",null,"Title for the page."),n("p",null,[a("If you don't specify "),n("code",null,"title"),a(" in frontmatter, content of the first level-one header (i.e. "),n("code",null,"# title"),a(") will be used as the title.")])],-1),W=n("p",null,"Also see:",-1);function X(Z,$){const i=l("NpmBadge"),p=l("ExternalLinkIcon"),t=l("RouterLink");return c(),d("div",null,[m,e(i,{package:"@vuepress/client"}),e(i,{package:"@vuepress/markdown"}),h,n("ul",null,[k,n("li",null,[f,g,n("p",null,[a("You should specify the date in the form of "),y,a(", or follow the "),n("a",v,[a("YAML Timestamp Type"),e(p)]),a(".")])]),n("li",null,[_,n("ul",null,[n("li",null,[e(t,{to:"/reference/node-api.html#date"},{default:s(()=>[a("Node API > Page Properties > date")]),_:1})])])])]),b,n("ul",null,[x,w,n("li",null,[P,n("ul",null,[n("li",null,[e(t,{to:"/reference/config.html#description"},{default:s(()=>[a("Config > description")]),_:1})])])])]),T,n("ul",null,[n("li",null,[a("Also see: "),n("ul",null,[n("li",null,[e(t,{to:"/reference/config.html#head"},{default:s(()=>[a("Config > head")]),_:1})])])])]),q,n("ul",null,[C,A,n("li",null,[M,n("ul",null,[n("li",null,[e(t,{to:"/reference/config.html#lang"},{default:s(()=>[a("Config > lang")]),_:1})]),n("li",null,[e(t,{to:"/reference/node-api.html#lang"},{default:s(()=>[a("Node API > Page Properties > lang")]),_:1})])])])]),D,n("ul",null,[L,N,n("li",null,[I,n("ul",null,[E,n("li",null,[e(t,{to:"/guide/page.html#routing"},{default:s(()=>[a("Guide > Page > Routing")]),_:1})]),n("li",null,[e(t,{to:"/reference/node-api.html#permalink"},{default:s(()=>[a("Node API > Page Properties > permalink")]),_:1})])])])]),R,n("ul",null,[n("li",null,[a("Also see: "),n("ul",null,[n("li",null,[e(t,{to:"/reference/config.html#permalinkpattern"},{default:s(()=>[a("Config > permalinkPattern")]),_:1})]),B,F,n("li",null,[e(t,{to:"/reference/node-api.html#permalink"},{default:s(()=>[a("Node API > Page Properties > permalink")]),_:1})])])])]),Y,n("ul",null,[V,S,n("li",null,[z,n("ul",null,[n("li",null,[e(t,{to:"/reference/node-api.html#routeMeta"},{default:s(()=>[a("Node API > Page Properties > routeMeta")]),_:1})])])])]),G,n("ul",null,[H,U,n("li",null,[W,n("ul",null,[n("li",null,[e(t,{to:"/reference/node-api.html#title"},{default:s(()=>[a("Node API > Page Properties > title")]),_:1})])])])])])}const J=u(r,[["render",X],["__file","frontmatter.html.vue"]]);export{J as default}; diff --git a/assets/frontmatter.html-96a3ef5a.js b/assets/frontmatter.html-96a3ef5a.js new file mode 100644 index 00000000..5ad49dd7 --- /dev/null +++ b/assets/frontmatter.html-96a3ef5a.js @@ -0,0 +1,60 @@ +import{_ as u,W as r,X as c,Y as a,$ as e,a0 as n,Z as t,a1 as l,D as i}from"./framework-46b0e263.js";const d={},h=e("h1",{id:"frontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),n(" Frontmatter")],-1),m=e("h2",{id:"all-pages",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#all-pages","aria-hidden":"true"},"#"),n(" All Pages")],-1),k=e("p",null,"Frontmatter in this section will take effect in all types of pages.",-1),f=e("h3",{id:"externallinkicon",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#externallinkicon","aria-hidden":"true"},"#"),n(" externalLinkIcon")],-1),g=e("li",null,[e("p",null,[n("Type: "),e("code",null,"boolean")])],-1),v=e("p",null,"Details:",-1),b=e("p",null,"Also see:",-1),_=e("h3",{id:"navbar",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#navbar","aria-hidden":"true"},"#"),n(" navbar")],-1),y=e("li",null,[e("p",null,[n("Type: "),e("code",null,"boolean")])],-1),x=e("li",null,[e("p",null,"Details:"),e("p",null,"Show navbar on this page or not."),e("p",null,"If you disable navbar in theme config, this frontmatter will not take effect.")],-1),T=e("p",null,"Also see:",-1),D=l(`

    pageClass

    • Type: string

    • Details:

      Add extra class name to this page.

    • Example:

    ---
    +pageClass: custom-page-class
    +---
    +

    Then you can customize styles of this page in .vuepress/styles/index.scss file:

    .theme-container.custom-page-class {
    +  /* page styles */
    +}
    +
    `,5),w=l(`

    Home Page

    Frontmatter in this section will only take effect in home pages.

    home

    • Type: boolean

    • Details:

      Specify whether the page is homepage or a normal page.

      If you don't set this frontmatter or set it to false, the page would be a normal page.

    • Example:

    ---
    +home: true
    +---
    +

    heroImage

    • Type: string

    • Details:

      Specify the url of the hero image.

    • Example:

    ---
    +# public file path
    +heroImage: /images/hero.png
    +# url
    +heroImage: https://vuejs.org/images/logo.png
    +---
    +
    `,8),S=e("h3",{id:"heroimagedark",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#heroimagedark","aria-hidden":"true"},"#"),n(" heroImageDark")],-1),A=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string")])],-1),C=e("li",null,[e("p",null,"Details:"),e("p",null,"Specify the url of hero image to be used in dark mode."),e("p",null,"You can make use of this option if you want to use different heroImage config in dark mode.")],-1),L=e("p",null,"Also see:",-1),I=e("li",null,[e("a",{href:"#heroimage"},"Default Theme > Frontmatter > heroImage")],-1),N=l('

    heroAlt

    • Type: string

    • Details:

      Specify the alt attribute of the hero image.

      This will fallback to the heroText.

    heroHeight

    ',3),E=e("li",null,[e("p",null,[n("Type: "),e("code",null,"number")])],-1),P=e("li",null,[e("p",null,[n("Default: "),e("code",null,"280")])],-1),V=e("p",null,"Details:",-1),F=e("p",null,[n("Specify the "),e("code",null,"height"),n(" attribute of the hero "),e("code",null,""),n(" tag.")],-1),j=e("p",null,"You may need to reduce this value if the height of your hero image is less than the default value.",-1),H={href:"https://web.dev/cls/",target:"_blank",rel:"noopener noreferrer"},B=e("h3",{id:"herotext",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#herotext","aria-hidden":"true"},"#"),n(" heroText")],-1),M=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string | null")])],-1),q=e("p",null,"Details:",-1),G=e("p",null,"Specify the the hero text.",-1),R=e("p",null,[n("Set to "),e("code",null,"null"),n(" to disable hero text.")],-1),Y=e("h3",{id:"tagline",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#tagline","aria-hidden":"true"},"#"),n(" tagline")],-1),U=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string | null")])],-1),z=e("p",null,"Details:",-1),O=e("p",null,"Specify the the tagline.",-1),W=e("p",null,[n("Set to "),e("code",null,"null"),n(" to disable tagline.")],-1),X=l(`

    actions

    • Type:
    Array<{
    +  text: string;
    +  link: string;
    +  type?: "primary" | "secondary";
    +}>;
    +
    • Details:

      Configuration of the action buttons.

    • Example:

    ---
    +actions:
    +  - text: Get Started
    +    link: /guide/getting-started.html
    +    type: primary
    +  - text: Introduction
    +    link: /guide/
    +    type: secondary
    +---
    +

    features

    • Type:
    Array<{
    +  title: string;
    +  details: string;
    +}>;
    +
    • Details:

      Configuration of the features list.

    • Example:

    ---
    +features:
    +  - title: Simplicity First
    +    details: Minimal setup with markdown-centered project structure helps you focus on writing.
    +  - title: Vue-Powered
    +    details: Enjoy the dev experience of Vue, use Vue components in markdown, and develop custom themes with Vue.
    +  - title: Performant
    +    details: VuePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded.
    +---
    +
    • Type: string

    • Details:

      Specify the content of the footer.

    footerHtml

    • Type: boolean

    • Details:

      Allow HTML in footer or not.

      If you set it to true, the footer will be treated as HTML code.

    Normal Page

    Frontmatter in this section will only take effect in normal pages.

    `,17),Z=e("li",null,[e("p",null,[n("Type: "),e("code",null,"boolean")])],-1),$=e("li",null,[e("p",null,"Details:"),e("p",null,[n("Enable the "),e("em",null,"edit this page"),n(" link in this page or not.")])],-1),J=e("p",null,"Also see:",-1),K=e("h3",{id:"editlinkpattern",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#editlinkpattern","aria-hidden":"true"},"#"),n(" editLinkPattern")],-1),Q=e("li",null,[e("p",null,[n("Type: "),e("code",null,"string")])],-1),ee=e("li",null,[e("p",null,"Details:"),e("p",null,[n("Specify the pattern of the "),e("em",null,"edit this page"),n(" link of this page.")])],-1),ne=e("p",null,"Also see:",-1),ae=e("h3",{id:"lastupdated",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#lastupdated","aria-hidden":"true"},"#"),n(" lastUpdated")],-1),se=e("li",null,[e("p",null,[n("Type: "),e("code",null,"boolean")])],-1),te=e("li",null,[e("p",null,"Details:"),e("p",null,[n("Enable the "),e("em",null,"last updated timestamp"),n(" in this page or not.")])],-1),le=e("p",null,"Also see:",-1),ie=e("h3",{id:"contributors",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#contributors","aria-hidden":"true"},"#"),n(" contributors")],-1),oe=e("li",null,[e("p",null,[n("Type: "),e("code",null,"boolean")])],-1),pe=e("li",null,[e("p",null,"Details:"),e("p",null,[n("Enable the "),e("em",null,"contributors list"),n(" in this page or not.")])],-1),ue=e("p",null,"Also see:",-1),re=e("h3",{id:"sidebar",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#sidebar","aria-hidden":"true"},"#"),n(" sidebar")],-1),ce=e("li",null,[e("p",null,[n("Type: "),e("code",null,"false | 'auto' | SidebarConfigArray | SidebarConfigObject")])],-1),de=e("li",null,[e("p",null,"Details:"),e("p",null,"Configure the sidebar of this page.")],-1),he=e("p",null,"Also see:",-1),me=e("h3",{id:"sidebardepth",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#sidebardepth","aria-hidden":"true"},"#"),n(" sidebarDepth")],-1),ke=e("li",null,[e("p",null,[n("Type: "),e("code",null,"number")])],-1),fe=e("li",null,[e("p",null,"Details:"),e("p",null,"Configure the sidebar depth of this page.")],-1),ge=e("p",null,"Also see:",-1),ve=l(`

    prev

    • Type: NavLink | string

    • Details:

      Specify the link of the previous page.

      If you don't set this frontmatter, the link will be inferred from the sidebar config.

      To configure the prev link manually, you can set this frontmatter to a NavLink object or a string:

      • A NavLink object should have a text field and a link field.
      • A string should be the path to the target page file. It will be converted to a NavLink object, whose text is the page title, and link is the page route path.
    • Example:

    ---
    +# NavLink
    +prev:
    +  text: Get Started
    +  link: /guide/getting-started.html
    +
    +# NavLink - external url
    +prev:
    +  text: GitHub
    +  link: https://github.com
    +
    +# string - page file path
    +prev: /guide/getting-started.md
    +
    +# string - page file relative path
    +prev: ../../guide/getting-started.md
    +---
    +

    next

    • Type: NavLink | string

    • Details:

      Specify the link of the next page.

      If you don't set this frontmatter, the link will be inferred from the sidebar config.

      The type is the same as prev frontmatter.

    `,5);function be(_e,ye){const o=i("NpmBadge"),s=i("RouterLink"),p=i("ExternalLinkIcon");return r(),c("div",null,[h,a(o,{package:"@vuepress/theme-default"}),m,k,f,e("ul",null,[g,e("li",null,[v,e("p",null,[n("Provided by "),a(s,{to:"/reference/plugin/external-link-icon.html#externallinkicon"},{default:t(()=>[n("@vuepress/plugin-external-link-icon")]),_:1}),n(".")])]),e("li",null,[b,e("ul",null,[e("li",null,[a(s,{to:"/reference/default-theme/config.html#themeplugins-externallinkicon"},{default:t(()=>[n("Default Theme > Config Reference > themePlugins.externalLinkIcon")]),_:1})])])])]),_,e("ul",null,[y,x,e("li",null,[T,e("ul",null,[e("li",null,[a(s,{to:"/reference/default-theme/config.html#navbar"},{default:t(()=>[n("Default Theme > Config > navbar")]),_:1})])])])]),D,e("ul",null,[e("li",null,[n("Also see: "),e("ul",null,[e("li",null,[a(s,{to:"/reference/default-theme/styles.html#style-file"},{default:t(()=>[n("Default Theme > Styles > Style File")]),_:1})])])])]),w,e("ul",null,[e("li",null,[n("Also see: "),e("ul",null,[e("li",null,[a(s,{to:"/guide/assets.html#public-files"},{default:t(()=>[n("Guide > Assets > Public Files")]),_:1})])])])]),S,e("ul",null,[A,C,e("li",null,[L,e("ul",null,[I,e("li",null,[a(s,{to:"/reference/default-theme/config.html#colormode"},{default:t(()=>[n("Default Theme > Config > colorMode")]),_:1})])])])]),N,e("ul",null,[E,P,e("li",null,[V,F,j,e("p",null,[n("Notice that the height is also constrained by CSS. This attribute is to reduce "),e("a",H,[n("Cumulative Layout Shift (CLS)"),a(p)]),n(" that caused by the loading of the hero image.")])])]),B,e("ul",null,[M,e("li",null,[q,G,e("p",null,[n("This will fallback to the site "),a(s,{to:"/reference/config.html#title"},{default:t(()=>[n("title")]),_:1}),n(".")]),R])]),Y,e("ul",null,[U,e("li",null,[z,O,e("p",null,[n("This will fallback to the site "),a(s,{to:"/reference/config.html#description"},{default:t(()=>[n("description")]),_:1}),n(".")]),W])]),X,e("ul",null,[Z,$,e("li",null,[J,e("ul",null,[e("li",null,[a(s,{to:"/reference/default-theme/config.html#editlink"},{default:t(()=>[n("Default Theme > Config > editLink")]),_:1})])])])]),K,e("ul",null,[Q,ee,e("li",null,[ne,e("ul",null,[e("li",null,[a(s,{to:"/reference/default-theme/config.html#editlinkpattern"},{default:t(()=>[n("Default Theme > Config > editLinkPattern")]),_:1})])])])]),ae,e("ul",null,[se,te,e("li",null,[le,e("ul",null,[e("li",null,[a(s,{to:"/reference/default-theme/config.html#lastupdated"},{default:t(()=>[n("Default Theme > Config > lastUpdated")]),_:1})])])])]),ie,e("ul",null,[oe,pe,e("li",null,[ue,e("ul",null,[e("li",null,[a(s,{to:"/reference/default-theme/config.html#contributors"},{default:t(()=>[n("Default Theme > Config > contributors")]),_:1})])])])]),re,e("ul",null,[ce,de,e("li",null,[he,e("ul",null,[e("li",null,[a(s,{to:"/reference/default-theme/config.html#sidebar"},{default:t(()=>[n("Default Theme > Config > sidebar")]),_:1})])])])]),me,e("ul",null,[ke,fe,e("li",null,[ge,e("ul",null,[e("li",null,[a(s,{to:"/reference/default-theme/config.html#sidebardepth"},{default:t(()=>[n("Default Theme > Config > sidebarDepth")]),_:1})])])])]),ve])}const Te=u(d,[["render",be],["__file","frontmatter.html.vue"]]);export{Te as default}; diff --git a/assets/frontmatter.html-bdbde184.js b/assets/frontmatter.html-bdbde184.js new file mode 100644 index 00000000..820a449b --- /dev/null +++ b/assets/frontmatter.html-bdbde184.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-d147334a","path":"/zh/reference/frontmatter.html","title":"Frontmatter","lang":"zh-CN","frontmatter":{"icon":"fa-solid:bars","description":"date 类型: string; 详情:; 页面的创建日期。 应按照 yyyy-MM-dd 的格式来指定日期,或者遵循 YAML Timestamp Type (https://yaml.org/type/timestamp.html) 。 参考:; Node API > Page 属性 > date (./node-api.md#date); des...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/frontmatter.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/frontmatter.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Frontmatter"}],["meta",{"property":"og:description","content":"date 类型: string; 详情:; 页面的创建日期。 应按照 yyyy-MM-dd 的格式来指定日期,或者遵循 YAML Timestamp Type (https://yaml.org/type/timestamp.html) 。 参考:; Node API > Page 属性 > date (./node-api.md#date); des..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Frontmatter\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":2.56,"words":767},"filePathRelative":"zh/reference/frontmatter.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/getting-started.html-218659cd.js b/assets/getting-started.html-218659cd.js new file mode 100644 index 00000000..f0e0c393 --- /dev/null +++ b/assets/getting-started.html-218659cd.js @@ -0,0 +1 @@ +const e=JSON.parse(`{"key":"v-fb0f0066","path":"/guide/getting-started.html","title":"Getting Started","lang":"en-US","frontmatter":{"icon":"fa6-solid:lightbulb","description":"VuePress v2 is currently in beta stage. It's ready to be used for building your site, but the config and API are not stable enough, which is likely to have breaking changes betw...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/guide/getting-started.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/guide/getting-started.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Getting Started"}],["meta",{"property":"og:description","content":"VuePress v2 is currently in beta stage. It's ready to be used for building your site, but the config and API are not stable enough, which is likely to have breaking changes betw..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Getting Started\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Prerequisites","slug":"prerequisites","link":"#prerequisites","children":[]},{"level":2,"title":"Manual Installation","slug":"manual-installation","link":"#manual-installation","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.32,"words":397},"filePathRelative":"guide/getting-started.md","localizedDate":"February 22, 2023","autoDesc":true}`);export{e as data}; diff --git a/assets/getting-started.html-7cb9cdb6.js b/assets/getting-started.html-7cb9cdb6.js new file mode 100644 index 00000000..3166e81f --- /dev/null +++ b/assets/getting-started.html-7cb9cdb6.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-37781588","path":"/zh/guide/getting-started.html","title":"快速上手","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:lightbulb","description":"VuePress v2 目前仍处于 beta 阶段。你已经可以用它来构建你的站点,但是它的配置和 API 还不够稳定,很可能会在 Minor 版本中发生 Breaking Changes 。因此,在每次更新 beta 版本之后,请一定要仔细阅读 更新日志 (https://github.com/vuepress/vuepress-next/blob/m...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/guide/getting-started.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/guide/getting-started.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"快速上手"}],["meta",{"property":"og:description","content":"VuePress v2 目前仍处于 beta 阶段。你已经可以用它来构建你的站点,但是它的配置和 API 还不够稳定,很可能会在 Minor 版本中发生 Breaking Changes 。因此,在每次更新 beta 版本之后,请一定要仔细阅读 更新日志 (https://github.com/vuepress/vuepress-next/blob/m..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"快速上手\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"依赖环境","slug":"依赖环境","link":"#依赖环境","children":[]},{"level":2,"title":"手动安装","slug":"手动安装","link":"#手动安装","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.75,"words":524},"filePathRelative":"zh/guide/getting-started.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/getting-started.html-82d2dd43.js b/assets/getting-started.html-82d2dd43.js new file mode 100644 index 00000000..8fb6de56 --- /dev/null +++ b/assets/getting-started.html-82d2dd43.js @@ -0,0 +1,26 @@ +import{_ as p,W as h,X as v,$ as e,a0 as n,Y as s,Z as a,a1 as d,D as c}from"./framework-46b0e263.js";const g={},b=e("h1",{id:"getting-started",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#getting-started","aria-hidden":"true"},"#"),n(" Getting Started")],-1),m={class:"hint-container warning"},_=e("p",{class:"hint-container-title"},"Note",-1),k=e("code",null,"beta",-1),f={href:"https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer"},y=e("h2",{id:"prerequisites",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#prerequisites","aria-hidden":"true"},"#"),n(" Prerequisites")],-1),x={href:"https://nodejs.org/",target:"_blank",rel:"noopener noreferrer"},P={href:"https://classic.yarnpkg.com/en/",target:"_blank",rel:"noopener noreferrer"},A={class:"hint-container tip"},N=e("p",{class:"hint-container-title"},"Tips",-1),q={href:"https://pnpm.io/",target:"_blank",rel:"noopener noreferrer"},S=e("code",null,"vue",-1),w=e("code",null,"@vuepress/client",-1),V=e("code",null,"pnpm add -D vue @vuepress/client@next",-1),j={href:"https://yarnpkg.com/",target:"_blank",rel:"noopener noreferrer"},I=e("code",null,"nodeLinker: 'node-modules'",-1),M={href:"https://yarnpkg.com/configuration/yarnrc#nodeLinker",target:"_blank",rel:"noopener noreferrer"},C=e("code",null,".yarnrc.yml",-1),L=d(`

    Manual Installation

    This section will help you build a basic VuePress documentation site from ground up. If you already have an existing project and would like to keep documentation inside the project, start from Step 3.

    • Step 1: Create and change into a new directory
    mkdir vuepress-starter
    +cd vuepress-starter
    +
    • Step 2: Initialize your project
    `,5),D=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"git"),n(` init +`),e("span",{class:"token function"},"pnpm"),n(` init +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1),E=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"git"),n(` init +`),e("span",{class:"token function"},"yarn"),n(` init +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1),R=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"git"),n(` init +`),e("span",{class:"token function"},"npm"),n(` init +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1),T=e("ul",null,[e("li",null,[e("strong",null,"Step 3"),n(": Install VuePress locally")])],-1),Y=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"pnpm"),n(),e("span",{class:"token function"},"add"),n(),e("span",{class:"token parameter variable"},"-D"),n(` vuepress@next @vuepress/client@next vue +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),B=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"yarn"),n(),e("span",{class:"token function"},"add"),n(),e("span",{class:"token parameter variable"},"-D"),n(` vuepress@next +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),W=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"npm"),n(),e("span",{class:"token function"},"install"),n(),e("span",{class:"token parameter variable"},"-D"),n(` vuepress@next +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),G=e("strong",null,"Step 4",-1),H={href:"https://classic.yarnpkg.com/en/docs/package-json#toc-scripts",target:"_blank",rel:"noopener noreferrer"},O=e("code",null,"package.json",-1),z=d(`
    {
    +  "scripts": {
    +    "docs:dev": "vuepress dev docs",
    +    "docs:build": "vuepress build docs"
    +  }
    +}
    +
    • Step 5: Add the default temp and cache directory to .gitignore file
    echo 'node_modules' >> .gitignore
    +echo '.temp' >> .gitignore
    +echo '.cache' >> .gitignore
    +
    • Step 6: Create your first document
    mkdir docs
    +echo '# Hello VuePress' > docs/README.md
    +
    • Step 7: Serve the documentation site in the local server
    `,6),X=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"pnpm"),n(` docs:dev +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),Z=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"yarn"),n(` docs:dev +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),$=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"npm"),n(` run docs:dev +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),F={href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"};function J(K,Q){const t=c("ExternalLinkIcon"),r=c("CodeTabs"),u=c("RouterLink");return h(),v("div",null,[b,e("div",m,[_,e("p",null,[n("VuePress v2 is currently in "),k,n(" stage. It's ready to be used for building your site, but the config and API are not stable enough, which is likely to have breaking changes between minor releases. So make sure to read the "),e("a",f,[n("changelog"),s(t)]),n(" carefully each time you upgrade a beta version.")])]),y,e("ul",null,[e("li",null,[e("a",x,[n("Node.js v14.18.0+"),s(t)])]),e("li",null,[e("a",P,[n("Yarn v1 classic"),s(t)]),n(" (Optional)")])]),e("div",A,[N,e("ul",null,[e("li",null,[n("With "),e("a",q,[n("pnpm"),s(t)]),n(", you may need to install "),S,n(" and "),w,n(" as peer-dependencies, i.e. "),V,n(".")]),e("li",null,[n("With "),e("a",j,[n("yarn 2"),s(t)]),n(", you need to set "),I,n(" in your "),e("a",M,[C,s(t)]),n(" file.")])])]),L,s(r,{id:"58",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:0,"tab-id":"shell"},{tab0:a(({title:i,value:l,isActive:o})=>[D]),tab1:a(({title:i,value:l,isActive:o})=>[E]),tab2:a(({title:i,value:l,isActive:o})=>[R]),_:1}),T,s(r,{id:"76",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:0,"tab-id":"shell"},{tab0:a(({title:i,value:l,isActive:o})=>[Y]),tab1:a(({title:i,value:l,isActive:o})=>[B]),tab2:a(({title:i,value:l,isActive:o})=>[W]),_:1}),e("ul",null,[e("li",null,[G,n(": Add some "),e("a",H,[n("scripts"),s(t)]),n(" to "),O])]),z,s(r,{id:"118",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:0,"tab-id":"shell"},{tab0:a(({title:i,value:l,isActive:o})=>[X]),tab1:a(({title:i,value:l,isActive:o})=>[Z]),tab2:a(({title:i,value:l,isActive:o})=>[$]),_:1}),e("p",null,[n("VuePress will start a hot-reloading development server at "),e("a",F,[n("http://localhost:8080"),s(t)]),n(". When you modify your markdown files, the content in the browser will be auto updated.")]),e("p",null,[n("By now, you should have a basic but functional VuePress documentation site. Next, learn about the basics of "),s(u,{to:"/guide/configuration.html"},{default:a(()=>[n("configuration")]),_:1}),n(" in VuePress.")])])}const ee=p(g,[["render",J],["__file","getting-started.html.vue"]]);export{ee as default}; diff --git a/assets/getting-started.html-b0306b71.js b/assets/getting-started.html-b0306b71.js new file mode 100644 index 00000000..8187e8c6 --- /dev/null +++ b/assets/getting-started.html-b0306b71.js @@ -0,0 +1,26 @@ +import{_ as p,W as h,X as v,$ as e,a0 as s,Y as n,Z as a,a1 as d,D as c}from"./framework-46b0e263.js";const b={},g=e("h1",{id:"快速上手",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#快速上手","aria-hidden":"true"},"#"),s(" 快速上手")],-1),m={class:"hint-container warning"},_=e("p",{class:"hint-container-title"},"注意",-1),k=e("code",null,"beta",-1),f={href:"https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer"},x=e("h2",{id:"依赖环境",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#依赖环境","aria-hidden":"true"},"#"),s(" 依赖环境")],-1),P={href:"https://nodejs.org/",target:"_blank",rel:"noopener noreferrer"},A={href:"https://classic.yarnpkg.com/zh-Hans/",target:"_blank",rel:"noopener noreferrer"},N={class:"hint-container tip"},y=e("p",{class:"hint-container-title"},"提示",-1),V={href:"https://pnpm.io/zh/",target:"_blank",rel:"noopener noreferrer"},q=e("code",null,"vue",-1),M=e("code",null,"@vuepress/client",-1),j=e("code",null,"pnpm add -D vue @vuepress/client@next",-1),L={href:"https://yarnpkg.com/",target:"_blank",rel:"noopener noreferrer"},C={href:"https://yarnpkg.com/configuration/yarnrc#nodeLinker",target:"_blank",rel:"noopener noreferrer"},D=e("code",null,".yarnrc.yml",-1),E=e("code",null,"nodeLinker: 'node-modules'",-1),R=d(`

    手动安装

    这一章节会帮助你从头搭建一个简单的 VuePress 文档网站。如果你想在一个现有项目中使用 VuePress 管理文档,从步骤 3 开始。

    • 步骤 1: 创建并进入一个新目录
    mkdir vuepress-starter
    +cd vuepress-starter
    +
    • 步骤 2: 初始化项目
    `,5),Y=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"git"),s(` init +`),e("span",{class:"token function"},"pnpm"),s(` init +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1),z=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"git"),s(` init +`),e("span",{class:"token function"},"yarn"),s(` init +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1),B=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"git"),s(` init +`),e("span",{class:"token function"},"npm"),s(` init +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"}),e("div",{class:"line-number"})])],-1),H=e("ul",null,[e("li",null,[e("strong",null,"步骤 3"),s(": 将 VuePress 安装为本地依赖")])],-1),w=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"pnpm"),s(),e("span",{class:"token function"},"add"),s(),e("span",{class:"token parameter variable"},"-D"),s(` vuepress@next @vuepress/client@next vue +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),I=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"yarn"),s(),e("span",{class:"token function"},"add"),s(),e("span",{class:"token parameter variable"},"-D"),s(` vuepress@next +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),T=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"npm"),s(),e("span",{class:"token function"},"install"),s(),e("span",{class:"token parameter variable"},"-D"),s(` vuepress@next +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),G=e("strong",null,"步骤 4",-1),S=e("code",null,"package.json",-1),O={href:"https://classic.yarnpkg.com/zh-Hans/docs/package-json#toc-scripts",target:"_blank",rel:"noopener noreferrer"},W=d(`
    {
    +  "scripts": {
    +    "docs:dev": "vuepress dev docs",
    +    "docs:build": "vuepress build docs"
    +  }
    +}
    +
    • 步骤 5: 将默认的临时目录和缓存目录添加到 .gitignore 文件中
    echo 'node_modules' >> .gitignore
    +echo '.temp' >> .gitignore
    +echo '.cache' >> .gitignore
    +
    • 步骤 6: 创建你的第一篇文档
    mkdir docs
    +echo '# Hello VuePress' > docs/README.md
    +
    • 步骤 7: 在本地启动服务器来开发你的文档网站
    `,6),X=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"pnpm"),s(` docs:dev +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),Z=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"yarn"),s(` docs:dev +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),$=e("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[e("pre",{class:"language-bash"},[e("code",null,[e("span",{class:"token function"},"npm"),s(` run docs:dev +`)])]),e("div",{class:"line-numbers","aria-hidden":"true"},[e("div",{class:"line-number"})])],-1),F={href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"};function J(K,Q){const t=c("ExternalLinkIcon"),r=c("CodeTabs"),u=c("RouterLink");return h(),v("div",null,[g,e("div",m,[_,e("p",null,[s("VuePress v2 目前仍处于 "),k,s(" 阶段。你已经可以用它来构建你的站点,但是它的配置和 API 还不够稳定,很可能会在 Minor 版本中发生 Breaking Changes 。因此,在每次更新 beta 版本之后,请一定要仔细阅读 "),e("a",f,[s("更新日志"),n(t)]),s("。")])]),x,e("ul",null,[e("li",null,[e("a",P,[s("Node.js v14.18.0+"),n(t)])]),e("li",null,[e("a",A,[s("Yarn v1 classic"),n(t)]),s(" (可选)")])]),e("div",N,[y,e("ul",null,[e("li",null,[s("使用 "),e("a",V,[s("pnpm"),n(t)]),s(" 时,你可能需要安装 "),q,s(" 和 "),M,s(" 作为 peer-dependencies ,即 "),j,s(" 。")]),e("li",null,[s("使用 "),e("a",L,[s("yarn 2"),n(t)]),s(" 时,你需要在 "),e("a",C,[D,n(t)]),s(" 文件中设置 "),E,s(" 。")])])]),R,n(r,{id:"58",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:0,"tab-id":"shell"},{tab0:a(({title:l,value:i,isActive:o})=>[Y]),tab1:a(({title:l,value:i,isActive:o})=>[z]),tab2:a(({title:l,value:i,isActive:o})=>[B]),_:1}),H,n(r,{id:"76",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:0,"tab-id":"shell"},{tab0:a(({title:l,value:i,isActive:o})=>[w]),tab1:a(({title:l,value:i,isActive:o})=>[I]),tab2:a(({title:l,value:i,isActive:o})=>[T]),_:1}),e("ul",null,[e("li",null,[G,s(": 在 "),S,s(" 中添加一些 "),e("a",O,[s("scripts"),n(t)])])]),W,n(r,{id:"118",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:0,"tab-id":"shell"},{tab0:a(({title:l,value:i,isActive:o})=>[X]),tab1:a(({title:l,value:i,isActive:o})=>[Z]),tab2:a(({title:l,value:i,isActive:o})=>[$]),_:1}),e("p",null,[s("VuePress 会在 "),e("a",F,[s("http://localhost:8080"),n(t)]),s(" 启动一个热重载的开发服务器。当你修改你的 Markdown 文件时,浏览器中的内容也会自动更新。")]),e("p",null,[s("现在,你应该已经有了一个简单可用的 VuePress 文档网站。接下来,了解一下 VuePress "),n(u,{to:"/zh/guide/configuration.html"},{default:a(()=>[s("配置")]),_:1}),s(" 相关的内容。")])])}const ee=p(b,[["render",J],["__file","getting-started.html.vue"]]);export{ee as default}; diff --git a/assets/git.html-33f0c5bb.js b/assets/git.html-33f0c5bb.js new file mode 100644 index 00000000..67f3e5b3 --- /dev/null +++ b/assets/git.html-33f0c5bb.js @@ -0,0 +1,30 @@ +import{_ as c,W as r,X as d,Y as e,$ as a,a0 as n,Z as o,a1 as p,D as s}from"./framework-46b0e263.js";const u={},h=a("h1",{id:"git",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#git","aria-hidden":"true"},"#"),n(" git")],-1),m=a("p",null,"This plugin will collect git information of your pages, including the created and updated time, the contributors, etc.",-1),g=p(`

    This plugin is mainly used to develop themes. You won't need to use it directly in most cases.

    Usage

    npm i -D @vuepress/plugin-git@next
    +
    import { gitPlugin } from "@vuepress/plugin-git";
    +
    +export default {
    +  plugins: [
    +    gitPlugin({
    +      // options
    +    }),
    +  ],
    +};
    +

    Git Repository

    `,5),k={href:"https://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository",target:"_blank",rel:"noopener noreferrer"},v={href:"https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt",target:"_blank",rel:"noopener noreferrer"},b=p(`

    Note

    This plugin will significantly slow down the speed of data preparation, especially when you have a lot of pages. You can consider disabling this plugin in dev mode to get better development experience.

    Options

    createdTime

    • Type: boolean

    • Default: true

    • Details:

      Whether to collect page created time or not.

    updatedTime

    • Type: boolean

    • Default: true

    • Details:

      Whether to collect page updated time or not.

    contributors

    • Type: boolean

    • Default: true

    • Details:

      Whether to collect page contributors or not.

    Frontmatter

    gitInclude

    • Type: string[]

    • Details:

      An array of relative paths to be included when calculating page data.

    • Example:

    ---
    +gitInclude:
    +  - relative/path/to/file1
    +  - relative/path/to/file2
    +---
    +

    Page Data

    This plugin will add a git field to page data.

    After using this plugin, you can get the collected git information in page data:

    import { usePageData } from "@vuepress/client";
    +import type { GitPluginPageData } from "@vuepress/plugin-git";
    +
    +export default {
    +  setup() {
    +    const page = usePageData<GitPluginPageData>();
    +    console.log(page.value.git);
    +  },
    +};
    +

    git.createdTime

    • Type: number

    • Details:

      Unix timestamp in milliseconds of the first commit of the page.

      This attribute would take the minimum of the first commit timestamps of the current page and the files listed in gitInclude.

    git.updatedTime

    • Type: number

    • Details:

      Unix timestamp in milliseconds of the last commit of the page.

      This attribute would take the maximum of the last commit timestamps of the current page and the files listed in gitInclude.

    git.contributors

    • Type: GitContributor[]
    interface GitContributor {
    +  name: string;
    +  email: string;
    +  commits: number;
    +}
    +
    • Details:

      The contributors information of the page.

      This attribute would also include contributors to the files listed in gitInclude.

    `,24);function f(y,x){const l=s("NpmBadge"),t=s("RouterLink"),i=s("ExternalLinkIcon");return r(),d("div",null,[h,e(l,{package:"@vuepress/plugin-git"}),m,a("p",null,[n("The "),e(t,{to:"/reference/default-theme/config.html#lastupdated"},{default:o(()=>[n("lastUpdated")]),_:1}),n(" and "),e(t,{to:"/reference/default-theme/config.html#contributors"},{default:o(()=>[n("contributors")]),_:1}),n(" of default theme is powered by this plugin.")]),g,a("p",null,[n("This plugin requires your project to be inside a "),a("a",k,[n("Git Repository"),e(i)]),n(", so that it can collect information from the commit history.")]),a("p",null,[n("You should ensure all commits are available when building your site. For example, CI workflows usually clone your repository with "),a("a",v,[n("--depth 1"),e(i)]),n(" to avoid fetching all commits, so you should disable the behavior to make this plugin work properly in CI.")]),b])}const _=c(u,[["render",f],["__file","git.html.vue"]]);export{_ as default}; diff --git a/assets/git.html-3f427683.js b/assets/git.html-3f427683.js new file mode 100644 index 00000000..705c52ab --- /dev/null +++ b/assets/git.html-3f427683.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0f9e4c06","path":"/reference/plugin/git.html","title":"git","lang":"en-US","frontmatter":{"description":"This plugin will collect git information of your pages, including the created and updated time, the contributors, etc. The lastUpdated (../default-theme/config.md#lastupdated) a...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/plugin/git.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/plugin/git.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"git"}],["meta",{"property":"og:description","content":"This plugin will collect git information of your pages, including the created and updated time, the contributors, etc. The lastUpdated (../default-theme/config.md#lastupdated) a..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"git\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Git Repository","slug":"git-repository","link":"#git-repository","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"createdTime","slug":"createdtime","link":"#createdtime","children":[]},{"level":3,"title":"updatedTime","slug":"updatedtime","link":"#updatedtime","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]}]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[{"level":3,"title":"gitInclude","slug":"gitinclude","link":"#gitinclude","children":[]}]},{"level":2,"title":"Page Data","slug":"page-data","link":"#page-data","children":[{"level":3,"title":"git.createdTime","slug":"git-createdtime","link":"#git-createdtime","children":[]},{"level":3,"title":"git.updatedTime","slug":"git-updatedtime","link":"#git-updatedtime","children":[]},{"level":3,"title":"git.contributors","slug":"git-contributors","link":"#git-contributors","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.45,"words":436},"filePathRelative":"reference/plugin/git.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/git.html-e47476ae.js b/assets/git.html-e47476ae.js new file mode 100644 index 00000000..fd41727f --- /dev/null +++ b/assets/git.html-e47476ae.js @@ -0,0 +1,30 @@ +import{_ as l,W as r,X as d,Y as s,$ as a,a0 as n,Z as p,a1 as o,D as e}from"./framework-46b0e263.js";const u={},h=a("h1",{id:"git",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#git","aria-hidden":"true"},"#"),n(" git")],-1),k=a("p",null,"该插件会收集你的页面的 Git 信息,包括创建和更新时间、贡献者等。",-1),m=o(`

    该插件主要用于开发主题,大部分情况下你不需要直接使用它。

    使用方法

    npm i -D @vuepress/plugin-git@next
    +
    import { gitPlugin } from "@vuepress/plugin-git";
    +
    +export default {
    +  plugins: [
    +    gitPlugin({
    +      // 配置项
    +    }),
    +  ],
    +};
    +

    Git 仓库

    `,5),g={href:"https://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository",target:"_blank",rel:"noopener noreferrer"},v={href:"https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt",target:"_blank",rel:"noopener noreferrer"},b=o(`

    注意

    该插件会显著降低准备数据的速度,特别是在你的页面数量很多的时候。你可以考虑在 dev 模式下禁用该插件来获取更好的开发体验。

    配置项

    createdTime

    • 类型: boolean

    • 默认值: true

    • 详情:

      是否收集页面的创建时间。

    updatedTime

    • 类型: boolean

    • 默认值: true

    • 详情:

      是否收集页面的更新时间。

    contributors

    • 类型: boolean

    • 默认值: true

    • 详情:

      是否收集页面的贡献者。

    Frontmatter

    gitInclude

    • 类型: string[]

    • 详情:

      文件相对路径组成的数组,该数组中的文件会在计算页面数据时被包含在内。

    • 示例:

    ---
    +gitInclude:
    +  - relative/path/to/file1
    +  - relative/path/to/file2
    +---
    +

    页面数据

    该插件会向页面数据中添加一个 git 字段。

    在使用该插件后,可以在页面数据中获取该插件收集到的 Git 信息:

    import { usePageData } from "@vuepress/client";
    +import type { GitPluginPageData } from "@vuepress/plugin-git";
    +
    +export default {
    +  setup() {
    +    const page = usePageData<GitPluginPageData>();
    +    console.log(page.value.git);
    +  },
    +};
    +

    git.createdTime

    • 类型: number

    • 详情:

      页面第一次提交的 Unix 毫秒时间戳。

      该属性将取当前页面及 gitInclude 中所列文件的第一次提交的时间戳的最小值。

    git.updatedTime

    • 类型: number

    • 详情:

      页面最后一次提交的 Unix 毫秒时间戳。

      该属性将取当前页面及 gitInclude 中所列文件的最后一次提交的时间戳的最大值。

    git.contributors

    • 类型: GitContributor[]
    interface GitContributor {
    +  name: string;
    +  email: string;
    +  commits: number;
    +}
    +
    • 详情:

      页面的贡献者信息。

      该属性将会包含 gitInclude 所列文件的贡献者。

    `,24);function f(_,x){const c=e("NpmBadge"),t=e("RouterLink"),i=e("ExternalLinkIcon");return r(),d("div",null,[h,s(c,{package:"@vuepress/plugin-git"}),k,a("p",null,[n("默认主题的 "),s(t,{to:"/zh/reference/default-theme/config.html#lastupdated"},{default:p(()=>[n("lastUpdated")]),_:1}),n(" 和 "),s(t,{to:"/zh/reference/default-theme/config.html#contributors"},{default:p(()=>[n("contributors")]),_:1}),n(" 就是由该插件支持的。")]),m,a("p",null,[n("该插件要求你的项目在 "),a("a",g,[n("Git 仓库"),s(i)]),n(" 下,这样它才能从提交历史记录中收集信息。")]),a("p",null,[n("在构建站点时,你应该确保所有的提交记录是可以获取到的。举例来说, CI 工作流通常会在克隆你的仓库时添加 "),a("a",v,[n("--depth 1"),s(i)]),n(" 参数来避免拉取全部的提交记录,因此你需要禁用这个功能,以便该插件在 CI 可以中正常使用。")]),b])}const w=l(u,[["render",f],["__file","git.html.vue"]]);export{w as default}; diff --git a/assets/git.html-fe8105d2.js b/assets/git.html-fe8105d2.js new file mode 100644 index 00000000..6f4d7a5d --- /dev/null +++ b/assets/git.html-fe8105d2.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-d2322692","path":"/zh/reference/plugin/git.html","title":"git","lang":"zh-CN","frontmatter":{"description":"该插件会收集你的页面的 Git 信息,包括创建和更新时间、贡献者等。 默认主题的 lastUpdated (../default-theme/config.md#lastupdated) 和 contributors (../default-theme/config.md#contributors) 就是由该插件支持的。 该插件主要用于开发主题,大部分...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/plugin/git.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/plugin/git.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"git"}],["meta",{"property":"og:description","content":"该插件会收集你的页面的 Git 信息,包括创建和更新时间、贡献者等。 默认主题的 lastUpdated (../default-theme/config.md#lastupdated) 和 contributors (../default-theme/config.md#contributors) 就是由该插件支持的。 该插件主要用于开发主题,大部分..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"git\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"Git 仓库","slug":"git-仓库","link":"#git-仓库","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"createdTime","slug":"createdtime","link":"#createdtime","children":[]},{"level":3,"title":"updatedTime","slug":"updatedtime","link":"#updatedtime","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]}]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[{"level":3,"title":"gitInclude","slug":"gitinclude","link":"#gitinclude","children":[]}]},{"level":2,"title":"页面数据","slug":"页面数据","link":"#页面数据","children":[{"level":3,"title":"git.createdTime","slug":"git-createdtime","link":"#git-createdtime","children":[]},{"level":3,"title":"git.updatedTime","slug":"git-updatedtime","link":"#git-updatedtime","children":[]},{"level":3,"title":"git.contributors","slug":"git-contributors","link":"#git-contributors","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":2.14,"words":643},"filePathRelative":"zh/reference/plugin/git.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/google-analytics.html-6e744845.js b/assets/google-analytics.html-6e744845.js new file mode 100644 index 00000000..af64d201 --- /dev/null +++ b/assets/google-analytics.html-6e744845.js @@ -0,0 +1,26 @@ +import{_ as i,W as c,X as p,Y as a,$ as n,a0 as s,a1 as t,D as o}from"./framework-46b0e263.js";const r={},u=n("h1",{id:"google-analytics",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#google-analytics","aria-hidden":"true"},"#"),s(" google-analytics")],-1),d={href:"https://analytics.google.com/",target:"_blank",rel:"noopener noreferrer"},g={href:"https://developers.google.com/analytics/devguides/collection/gtagjs",target:"_blank",rel:"noopener noreferrer"},h={href:"https://support.google.com/analytics/answer/10089681",target:"_blank",rel:"noopener noreferrer"},k=t(`

    使用方法

    npm i -D @vuepress/plugin-google-analytics@next
    +
    import { googleAnalyticsPlugin } from "@vuepress/plugin-google-analytics";
    +
    +export default {
    +  plugins: [
    +    googleAnalyticsPlugin({
    +      // 配置项
    +    }),
    +  ],
    +};
    +

    上报事件

    `,4),v={href:"https://support.google.com/analytics/answer/9234069",target:"_blank",rel:"noopener noreferrer"},_=n("code",null,"page_view",-1),m=n("code",null,"first_visit",-1),b=n("p",null,[s("因此,如果你只是想收集站点的一些基础数据,你只需要正确设置 "),n("a",{href:"#id"},"Measurement ID"),s(" ,不需要再额外做其他事情。")],-1),y=n("code",null,"gtag()",-1),f=n("code",null,"window",-1),X={href:"https://developers.google.com/analytics/devguides/collection/ga4/events",target:"_blank",rel:"noopener noreferrer"},x=n("h2",{id:"配置项",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#配置项","aria-hidden":"true"},"#"),s(" 配置项")],-1),w=n("h3",{id:"id",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#id","aria-hidden":"true"},"#"),s(" id")],-1),A=n("li",null,[n("p",null,[s("类型: "),n("code",null,"string")])],-1),D=n("p",null,"详情:",-1),G=n("p",null,[s("Google Analytics 4 的 Measurement ID ,应以 "),n("code",null,"'G-'"),s(" 开头。")],-1),I={href:"https://support.google.com/analytics/answer/9539598",target:"_blank",rel:"noopener noreferrer"},V=n("li",null,[n("p",null,"示例:")],-1),q=t(`
    export default {
    +  plugins: [
    +    googleAnalyticsPlugin({
    +      id: "G-XXXXXXXXXX",
    +    }),
    +  ],
    +};
    +

    debug

    `,2),N=n("li",null,[n("p",null,[s("类型: "),n("code",null,"boolean")])],-1),B=n("p",null,"详情:",-1),P=n("code",null,"true",-1),M={href:"https://support.google.com/analytics/answer/7201382",target:"_blank",rel:"noopener noreferrer"},E=n("li",null,[n("p",null,"示例:")],-1),j=t(`
    export default {
    +  plugins: [
    +    googleAnalyticsPlugin({
    +      id: "G-XXXXXXXXXX",
    +      debug: true,
    +    }),
    +  ],
    +};
    +
    `,1);function L(T,U){const l=o("NpmBadge"),e=o("ExternalLinkIcon");return c(),p("div",null,[u,a(l,{package:"@vuepress/plugin-google-analytics"}),n("p",null,[s("将 "),n("a",d,[s("Google Analytics"),a(e)]),s(" 集成到 VuePress 中。")]),n("p",null,[s("该插件会通过引入 "),n("a",g,[s("gtag.js"),a(e)]),s(" 来启用 "),n("a",h,[s("Google Analytics 4"),a(e)]),s(" 。")]),k,n("p",null,[s("Google Analytics 会 "),n("a",v,[s("自动收集部分事件"),a(e)]),s(" ,比如 "),_,s(", "),m,s(" 等。")]),b,n("p",null,[s("在引入该插件之后,一个全局的 "),y,s(" 函数会被挂载到 "),f,s(" 对象上,你可以使用它进行 "),n("a",X,[s("自定义事件的上报"),a(e)]),s(" 。")]),x,w,n("ul",null,[A,n("li",null,[D,G,n("p",null,[s("你可以通过 "),n("a",I,[s("这里"),a(e)]),s(' 的指引来找到你的 Measurement ID 。注意区分 Google Analytics 4 的 Measurement ID (即 "G-" 开头的 ID) 和 Universal Analytics 的 Tracking ID (即 "UA-" 开头的 ID)。')])]),V]),q,n("ul",null,[N,n("li",null,[B,n("p",null,[s("设置为 "),P,s(" 可以向 DebugView 发送事件。"),n("a",M,[s("了解更多关于 DebugView 的信息"),a(e)]),s(" 。")])]),E]),j])}const S=i(r,[["render",L],["__file","google-analytics.html.vue"]]);export{S as default}; diff --git a/assets/google-analytics.html-86042f8e.js b/assets/google-analytics.html-86042f8e.js new file mode 100644 index 00000000..ea9f9df4 --- /dev/null +++ b/assets/google-analytics.html-86042f8e.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-07ca2692","path":"/zh/reference/plugin/google-analytics.html","title":"google-analytics","lang":"zh-CN","frontmatter":{"description":"将 Google Analytics (https://analytics.google.com/) 集成到 VuePress 中。 该插件会通过引入 gtag.js (https://developers.google.com/analytics/devguides/collection/gtagjs) 来启用 Google Analytics 4 ...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/plugin/google-analytics.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/plugin/google-analytics.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"google-analytics"}],["meta",{"property":"og:description","content":"将 Google Analytics (https://analytics.google.com/) 集成到 VuePress 中。 该插件会通过引入 gtag.js (https://developers.google.com/analytics/devguides/collection/gtagjs) 来启用 Google Analytics 4 ..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"google-analytics\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"上报事件","slug":"上报事件","link":"#上报事件","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"id","slug":"id","link":"#id","children":[]},{"level":3,"title":"debug","slug":"debug","link":"#debug","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.07,"words":320},"filePathRelative":"zh/reference/plugin/google-analytics.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/google-analytics.html-bb077b11.js b/assets/google-analytics.html-bb077b11.js new file mode 100644 index 00000000..c3f815d2 --- /dev/null +++ b/assets/google-analytics.html-bb077b11.js @@ -0,0 +1,26 @@ +import{_ as i,W as c,X as p,Y as e,$ as n,a0 as s,a1 as t,D as o}from"./framework-46b0e263.js";const r={},u=n("h1",{id:"google-analytics",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#google-analytics","aria-hidden":"true"},"#"),s(" google-analytics")],-1),d={href:"https://analytics.google.com/",target:"_blank",rel:"noopener noreferrer"},g={href:"https://developers.google.com/analytics/devguides/collection/gtagjs",target:"_blank",rel:"noopener noreferrer"},h={href:"https://support.google.com/analytics/answer/10089681",target:"_blank",rel:"noopener noreferrer"},v=t(`

    Usage

    npm i -D @vuepress/plugin-google-analytics@next
    +
    import { googleAnalyticsPlugin } from "@vuepress/plugin-google-analytics";
    +
    +export default {
    +  plugins: [
    +    googleAnalyticsPlugin({
    +      // options
    +    }),
    +  ],
    +};
    +

    Reporting Events

    `,4),k={href:"https://support.google.com/analytics/answer/9234069",target:"_blank",rel:"noopener noreferrer"},_=n("code",null,"page_view",-1),m=n("code",null,"first_visit",-1),b=n("p",null,[s("So if you only want to collect some basic data of your site, you don't need to do anything else except setting the "),n("a",{href:"#id"},"Measurement ID"),s(" correctly.")],-1),y=n("code",null,"gtag()",-1),f=n("code",null,"window",-1),w={href:"https://developers.google.com/analytics/devguides/collection/ga4/events",target:"_blank",rel:"noopener noreferrer"},x=n("h2",{id:"options",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#options","aria-hidden":"true"},"#"),s(" Options")],-1),X=n("h3",{id:"id",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#id","aria-hidden":"true"},"#"),s(" id")],-1),A=n("li",null,[n("p",null,[s("Type: "),n("code",null,"string")])],-1),D=n("p",null,"Details:",-1),I=n("p",null,[s("The Measurement ID of Google Analytics 4, which should start with "),n("code",null,"'G-'"),s(".")],-1),G={href:"https://support.google.com/analytics/answer/9539598",target:"_blank",rel:"noopener noreferrer"},N=n("li",null,[n("p",null,"Example:")],-1),V=t(`
    export default {
    +  plugins: [
    +    googleAnalyticsPlugin({
    +      id: "G-XXXXXXXXXX",
    +    }),
    +  ],
    +};
    +

    debug

    `,2),q=n("li",null,[n("p",null,[s("Type: "),n("code",null,"boolean")])],-1),E=n("p",null,"Details:",-1),T=n("code",null,"true",-1),B={href:"https://support.google.com/analytics/answer/7201382",target:"_blank",rel:"noopener noreferrer"},P=n("li",null,[n("p",null,"Example:")],-1),M=t(`
    export default {
    +  plugins: [
    +    googleAnalyticsPlugin({
    +      id: "G-XXXXXXXXXX",
    +      debug: true,
    +    }),
    +  ],
    +};
    +
    `,1);function S(j,U){const l=o("NpmBadge"),a=o("ExternalLinkIcon");return c(),p("div",null,[u,e(l,{package:"@vuepress/plugin-google-analytics"}),n("p",null,[s("Integrate "),n("a",d,[s("Google Analytics"),e(a)]),s(" into VuePress.")]),n("p",null,[s("This plugin will import "),n("a",g,[s("gtag.js"),e(a)]),s(" for "),n("a",h,[s("Google Analytics 4"),e(a)]),s(".")]),v,n("p",null,[s("Google Analytics will "),n("a",k,[s("automatically collect some events"),e(a)]),s(", such as "),_,s(", "),m,s(", etc.")]),b,n("p",null,[s("After using this plugin, the global "),y,s(" function is available on the "),f,s(" object, and you can use it for "),n("a",w,[s("custom events reporting"),e(a)]),s(".")]),x,X,n("ul",null,[A,n("li",null,[D,I,n("p",null,[s("You can follow the instructions "),n("a",G,[s("here"),e(a)]),s(' to find your Measurement ID. Notice the difference between Google Analytics 4 Measurement ID (i.e. "G-" ID) and Universal Analytics Tracking ID (i.e. "UA-" ID).')])]),N]),V,n("ul",null,[q,n("li",null,[E,n("p",null,[s("Set to "),T,s(" to enable sending events to DebugView. "),n("a",B,[s("See more information on DebugView"),e(a)]),s(".")])]),P]),M])}const Y=i(r,[["render",S],["__file","google-analytics.html.vue"]]);export{Y as default}; diff --git a/assets/google-analytics.html-fe5b25b3.js b/assets/google-analytics.html-fe5b25b3.js new file mode 100644 index 00000000..43e37564 --- /dev/null +++ b/assets/google-analytics.html-fe5b25b3.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-b3f1b470","path":"/reference/plugin/google-analytics.html","title":"google-analytics","lang":"en-US","frontmatter":{"description":"Integrate Google Analytics (https://analytics.google.com/) into VuePress. This plugin will import gtag.js (https://developers.google.com/analytics/devguides/collection/gtagjs) f...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/plugin/google-analytics.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/plugin/google-analytics.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"google-analytics"}],["meta",{"property":"og:description","content":"Integrate Google Analytics (https://analytics.google.com/) into VuePress. This plugin will import gtag.js (https://developers.google.com/analytics/devguides/collection/gtagjs) f..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"google-analytics\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Reporting Events","slug":"reporting-events","link":"#reporting-events","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"id","slug":"id","link":"#id","children":[]},{"level":3,"title":"debug","slug":"debug","link":"#debug","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.82,"words":247},"filePathRelative":"reference/plugin/google-analytics.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/hero-8a9eb0cf.js b/assets/hero-8a9eb0cf.js new file mode 100644 index 00000000..d90d6d57 --- /dev/null +++ b/assets/hero-8a9eb0cf.js @@ -0,0 +1 @@ +const o="/images/hero.png";export{o as _}; diff --git a/assets/i18n.html-979c3eb8.js b/assets/i18n.html-979c3eb8.js new file mode 100644 index 00000000..dd046dee --- /dev/null +++ b/assets/i18n.html-979c3eb8.js @@ -0,0 +1,41 @@ +import{_ as i,W as p,X as l,$ as s,a0 as n,Y as e,Z as t,a1 as o,D as c}from"./framework-46b0e263.js";const u={},r=o(`

    I18n

    Site I18n Config

    To take advantage of multi-language support in VuePress, you first need to use the following file and directory structure:

    docs
    +├─ README.md
    +├─ foo.md
    +├─ nested
    +│  └─ README.md
    +└─ zh
    +   ├─ README.md
    +   ├─ foo.md
    +   └─ nested
    +      └─ README.md
    +
    `,4),d=s("code",null,"locales",-1),v=o(`
    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.

    `,2),m={class:"hint-container tip"},k=s("p",{class:"hint-container-title"},"Tips",-1),h=o(`

    Theme I18n Config

    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:

    import { defaultTheme } from "vuepress";
    +
    +export default {
    +  theme: defaultTheme({
    +    locales: {
    +      "/": {
    +        selectLanguageName: "English",
    +      },
    +      "/zh/": {
    +        selectLanguageName: "简体中文",
    +      },
    +    },
    +  }),
    +};
    +
    `,4),g={class:"hint-container tip"},f=s("p",{class:"hint-container-title"},"Tips",-1);function b(_,y){const a=c("RouterLink");return p(),l("div",null,[r,s("p",null,[n("Then, specify the "),d,n(" option in your "),e(a,{to:"/guide/configuration.html#config-file"},{default:t(()=>[n("config file")]),_:1}),n(":")]),v,s("div",m,[k,s("p",null,[n("Config reference: "),e(a,{to:"/reference/config.html#locales"},{default:t(()=>[n("locales")]),_:1})])]),h,s("div",g,[f,s("p",null,[n("Config reference: "),e(a,{to:"/reference/default-theme/config.html#locales"},{default:t(()=>[n("Default Theme > locales")]),_:1})])])])}const x=i(u,[["render",b],["__file","i18n.html.vue"]]);export{x as default}; diff --git a/assets/i18n.html-c6901264.js b/assets/i18n.html-c6901264.js new file mode 100644 index 00000000..c9dd3486 --- /dev/null +++ b/assets/i18n.html-c6901264.js @@ -0,0 +1,41 @@ +import{_ as p,W as i,X as c,$ as s,a0 as n,Y as e,Z as t,a1 as o,D as l}from"./framework-46b0e263.js";const u={},r=o(`

    多语言支持

    站点多语言配置

    要启用 VuePress 的多语言支持,首先需要使用如下的文件目录结构:

    docs
    +├─ README.md
    +├─ foo.md
    +├─ nested
    +│  └─ README.md
    +└─ zh
    +   ├─ README.md
    +   ├─ foo.md
    +   └─ nested
    +      └─ README.md
    +
    `,4),d=s("code",null,"locales",-1),v=o(`
    export default {
    +  locales: {
    +    // 键名是该语言所属的子路径
    +    // 作为特例,默认语言可以使用 '/' 作为其路径。
    +    "/": {
    +      lang: "en-US",
    +      title: "VuePress",
    +      description: "Vue-powered Static Site Generator",
    +    },
    +    "/zh/": {
    +      lang: "zh-CN",
    +      title: "VuePress",
    +      description: "Vue 驱动的静态网站生成器",
    +    },
    +  },
    +};
    +

    如果一个语言没有声明 lang, title, description 或者 head ,VuePress 将会尝试使用顶层配置的对应值。如果每个语言都声明了这些值,那么顶层配置中的对应值可以被省略。

    `,2),k={class:"hint-container tip"},m=s("p",{class:"hint-container-title"},"提示",-1),h=o(`

    主题多语言配置

    VuePress 没有限制主题如何提供多语言支持,因此每个主题可能会有不同的多语言配置方式,而且部分主题可能不会提供多语言支持。建议你查看主题本身的文档来获取更详细的指引。

    如果你使用的是默认主题,那么它提供多语言支持的方式和上述是一致的:

    import { defaultTheme } from "vuepress";
    +
    +export default {
    +  theme: defaultTheme({
    +    locales: {
    +      "/": {
    +        selectLanguageName: "English",
    +      },
    +      "/zh/": {
    +        selectLanguageName: "简体中文",
    +      },
    +    },
    +  }),
    +};
    +
    `,4),b={class:"hint-container tip"},g=s("p",{class:"hint-container-title"},"提示",-1);function _(f,q){const a=l("RouterLink");return i(),c("div",null,[r,s("p",null,[n("然后,在你的 "),e(a,{to:"/zh/guide/configuration.html#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"},{default:t(()=>[n("配置文件")]),_:1}),n(" 中设置 "),d,n(" 选项:")]),v,s("div",k,[m,s("p",null,[n("配置参考: "),e(a,{to:"/zh/reference/config.html#locales"},{default:t(()=>[n("locales")]),_:1})])]),h,s("div",b,[g,s("p",null,[n("配置参考: "),e(a,{to:"/zh/reference/default-theme/config.html#locales"},{default:t(()=>[n("默认主题 > locales")]),_:1})])])])}const x=p(u,[["render",_],["__file","i18n.html.vue"]]);export{x as default}; diff --git a/assets/i18n.html-cd078675.js b/assets/i18n.html-cd078675.js new file mode 100644 index 00000000..6d01f6fc --- /dev/null +++ b/assets/i18n.html-cd078675.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-acb10be2","path":"/guide/i18n.html","title":"I18n","lang":"en-US","frontmatter":{"icon":"fa6-solid:language","description":"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 in y...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/guide/i18n.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/guide/i18n.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"I18n"}],["meta",{"property":"og:description","content":"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 in y..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"I18n\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.87,"words":260},"filePathRelative":"guide/i18n.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/i18n.html-d3e7282a.js b/assets/i18n.html-d3e7282a.js new file mode 100644 index 00000000..a2cdce46 --- /dev/null +++ b/assets/i18n.html-d3e7282a.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4b8f1400","path":"/zh/guide/i18n.html","title":"多语言支持","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:language","description":"站点多语言配置 要启用 VuePress 的多语言支持,首先需要使用如下的文件目录结构: 然后,在你的 配置文件 (./configuration.md#配置文件) 中设置 locales 选项: 如果一个语言没有声明 lang, title, description 或者 head ,VuePress 将会尝试使用顶层配置的对应值。如果每个语言都声明...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/guide/i18n.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/guide/i18n.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"多语言支持"}],["meta",{"property":"og:description","content":"站点多语言配置 要启用 VuePress 的多语言支持,首先需要使用如下的文件目录结构: 然后,在你的 配置文件 (./configuration.md#配置文件) 中设置 locales 选项: 如果一个语言没有声明 lang, title, description 或者 head ,VuePress 将会尝试使用顶层配置的对应值。如果每个语言都声明..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"多语言支持\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"站点多语言配置","slug":"站点多语言配置","link":"#站点多语言配置","children":[]},{"level":2,"title":"主题多语言配置","slug":"主题多语言配置","link":"#主题多语言配置","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.22,"words":367},"filePathRelative":"zh/guide/i18n.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/index.html-01e674f5.js b/assets/index.html-01e674f5.js new file mode 100644 index 00000000..d70d3c4a --- /dev/null +++ b/assets/index.html-01e674f5.js @@ -0,0 +1 @@ +import{_ as e,W as o,X as a,a1 as t}from"./framework-46b0e263.js";const r={},n=t('

    介绍

    Cookbook 的目的是什么?

    • 我们在 指南 中介绍了基本概念,但你可能不知道怎么才能了解得更深入。
    • 我们在 参考 中列出了 API ,但你可能不知道如何充分利用它们。

    于是就有了 Cookbook 。

    每个案例都会针对某个特定的方面,通过提供更详细的示例来向你展示 VuePress 的用法和其他可能性。

    ',5),s=[n];function c(i,d){return o(),a("div",null,s)}const l=e(r,[["render",c],["__file","index.html.vue"]]);export{l as default}; diff --git a/assets/index.html-1c40c637.js b/assets/index.html-1c40c637.js new file mode 100644 index 00000000..772f7885 --- /dev/null +++ b/assets/index.html-1c40c637.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-43e2b7cf","path":"/reference/default-theme/","title":"Default Theme","lang":"en-US","frontmatter":{"title":"Default Theme","article":false,"feed":false,"sitemap":false,"description":"","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/default-theme/"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/default-theme/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Default Theme"}],["meta",{"property":"og:type","content":"website"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"WebPage\\",\\"name\\":\\"Default Theme\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0.03,"words":9},"filePathRelative":null,"autoDesc":true}');export{e as data}; diff --git a/assets/index.html-1fc2b45e.js b/assets/index.html-1fc2b45e.js new file mode 100644 index 00000000..cead33c5 --- /dev/null +++ b/assets/index.html-1fc2b45e.js @@ -0,0 +1,38 @@ +import{_ as c,W as r,X as o,Y as d,Z as e,$ as s,a0 as n,D as u}from"./framework-46b0e263.js";const m={},p=s("h3",{id:"as-easy-as-1-2-3",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#as-easy-as-1-2-3","aria-hidden":"true"},"#"),n(" As Easy as 1, 2, 3")],-1),v=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"language-bash"},[s("code",null,[s("span",{class:"token comment"},"# install in your project"),n(` +`),s("span",{class:"token function"},"pnpm"),n(),s("span",{class:"token function"},"add"),n(),s("span",{class:"token parameter variable"},"-D"),n(` vuepress@next @vuepress/client@next vue + +`),s("span",{class:"token comment"},"# create a markdown file"),n(` +`),s("span",{class:"token builtin class-name"},"echo"),n(),s("span",{class:"token string"},"'# Hello VuePress'"),n(),s("span",{class:"token operator"},">"),n(` README.md + +`),s("span",{class:"token comment"},"# start writing"),n(` +`),s("span",{class:"token function"},"pnpm"),n(` vuepress dev + +`),s("span",{class:"token comment"},"# build to static files"),n(` +`),s("span",{class:"token function"},"pnpm"),n(` vuepress build +`)])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),b=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"language-bash"},[s("code",null,[s("span",{class:"token comment"},"# install in your project"),n(` +`),s("span",{class:"token function"},"yarn"),n(),s("span",{class:"token function"},"add"),n(),s("span",{class:"token parameter variable"},"-D"),n(` vuepress@next + +`),s("span",{class:"token comment"},"# create a markdown file"),n(` +`),s("span",{class:"token builtin class-name"},"echo"),n(),s("span",{class:"token string"},"'# Hello VuePress'"),n(),s("span",{class:"token operator"},">"),n(` README.md + +`),s("span",{class:"token comment"},"# start writing"),n(` +`),s("span",{class:"token function"},"yarn"),n(` vuepress dev + +`),s("span",{class:"token comment"},"# build to static files"),n(` +`),s("span",{class:"token function"},"yarn"),n(` vuepress build +`)])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),k=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"language-bash"},[s("code",null,[s("span",{class:"token comment"},"# install in your project"),n(` +`),s("span",{class:"token function"},"npm"),n(),s("span",{class:"token function"},"install"),n(),s("span",{class:"token parameter variable"},"-D"),n(` vuepress@next + +`),s("span",{class:"token comment"},"# create a markdown file"),n(` + +`),s("span",{class:"token builtin class-name"},"echo"),n(),s("span",{class:"token string"},"'# Hello VuePress'"),n(),s("span",{class:"token operator"},">"),n(` README.md + +`),s("span",{class:"token comment"},"# start writing"),n(` + +npx vuepress dev + +`),s("span",{class:"token comment"},"# build to static files"),n(` + +npx vuepress build + +`)])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1);function h(f,_){const t=u("CodeTabs");return r(),o("div",null,[p,d(t,{id:"3",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:0,"tab-id":"shell"},{tab0:e(({title:a,value:l,isActive:i})=>[v]),tab1:e(({title:a,value:l,isActive:i})=>[b]),tab2:e(({title:a,value:l,isActive:i})=>[k]),_:1})])}const x=c(m,[["render",h],["__file","index.html.vue"]]);export{x as default}; diff --git a/assets/index.html-2130e344.js b/assets/index.html-2130e344.js new file mode 100644 index 00000000..4faf065b --- /dev/null +++ b/assets/index.html-2130e344.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-16d7d7b6","path":"/zh/advanced/","title":"Advanced","lang":"en-US","frontmatter":{"title":"Advanced","article":false,"feed":false,"sitemap":false,"description":"","head":[["meta",{"property":"og:url","content":"https://vuejs.press/zh/advanced/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Advanced"}],["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\\":\\"Advanced\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0.03,"words":9},"filePathRelative":null,"autoDesc":true}');export{e as data}; diff --git a/assets/index.html-2f61641e.js b/assets/index.html-2f61641e.js new file mode 100644 index 00000000..5aafd7d4 --- /dev/null +++ b/assets/index.html-2f61641e.js @@ -0,0 +1 @@ +import{_,W as a,X as l,Y as o,Z as s,D as e}from"./framework-46b0e263.js";const r={};function i(m,p){const n=e("HopeIcon"),t=e("AutoCatalog");return a(),l("div",null,[o(t,null,{icon:s(({icon:c})=>[o(n,{icon:c},null,8,["icon"])]),_:1})])}const d=_(r,[["render",i],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-3a17c39d.js b/assets/index.html-3a17c39d.js new file mode 100644 index 00000000..9a1e3fee --- /dev/null +++ b/assets/index.html-3a17c39d.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-70e5a528","path":"/zh/reference/","title":"Reference","lang":"en-US","frontmatter":{"title":"Reference","article":false,"feed":false,"sitemap":false,"description":"","head":[["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Reference"}],["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\\":\\"Reference\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0.03,"words":9},"filePathRelative":null,"autoDesc":true}');export{e as data}; diff --git a/assets/index.html-3afbf148.js b/assets/index.html-3afbf148.js new file mode 100644 index 00000000..c99e3093 --- /dev/null +++ b/assets/index.html-3afbf148.js @@ -0,0 +1 @@ +const e=JSON.parse(`{"key":"v-03c9312a","path":"/advanced/cookbook/","title":"Introduction","lang":"en-US","frontmatter":{"icon":"fa6-solid:circle-info","description":"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 may not know ...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/advanced/cookbook/"}],["meta",{"property":"og:url","content":"https://vuejs.press/advanced/cookbook/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Introduction"}],["meta",{"property":"og:description","content":"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 may not know ..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Introduction\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.25,"words":75},"filePathRelative":"advanced/cookbook/README.md","localizedDate":"February 22, 2023","autoDesc":true}`);export{e as data}; diff --git a/assets/index.html-48204d48.js b/assets/index.html-48204d48.js new file mode 100644 index 00000000..5aafd7d4 --- /dev/null +++ b/assets/index.html-48204d48.js @@ -0,0 +1 @@ +import{_,W as a,X as l,Y as o,Z as s,D as e}from"./framework-46b0e263.js";const r={};function i(m,p){const n=e("HopeIcon"),t=e("AutoCatalog");return a(),l("div",null,[o(t,null,{icon:s(({icon:c})=>[o(n,{icon:c},null,8,["icon"])]),_:1})])}const d=_(r,[["render",i],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-5b546a26.js b/assets/index.html-5b546a26.js new file mode 100644 index 00000000..3450b762 --- /dev/null +++ b/assets/index.html-5b546a26.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2d0ad528","path":"/zh/","title":"首页","lang":"zh-CN","frontmatter":{"home":true,"icon":"fa6-solid:house","title":"首页","heroImage":"/images/hero.png","actions":[{"text":"快速上手","link":"/zh/guide/getting-started.html","type":"primary"},{"text":"项目简介","link":"/zh/guide/","type":"secondary"}],"features":[{"title":"简洁至上","icon":"fa6-solid:star","details":"以 Markdown 为中心的项目结构,以最少的配置帮助你专注于写作。"},{"title":"Vue 驱动","icon":"fa6-brands:vuejs","details":"享受 Vue 的开发体验,可以在 Markdown 中使用 Vue 组件,又可以使用 Vue 来开发自定义主题。"},{"title":"高性能","icon":"fa6-solid:bolt","details":"VuePress 会为每个页面预渲染生成静态的 HTML,同时,每个页面被加载的时候,将作为 SPA 运行。"},{"title":"主题","icon":"fa6-solid:palette","details":"提供了一个开箱即用的默认主题。你也可以挑选一个社区主题,或者创建一个你自己的主题。"},{"title":"插件","icon":"fa6-solid:plug","details":"灵活的插件API,使得插件可以为你的站点提供许多即插即用的功能。"},{"title":"打包工具","icon":"fa6-solid:boxes-packing","details":"默认的打包工具是 Vite ,也同样支持 Webpack 。选一个你喜欢的来使用吧!"}],"description":"像数 1, 2, 3 一样容易 ::: code-tabs#shell tab:active PNPM tab:active YARN tab:active NPM :::","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"首页"}],["meta",{"property":"og:description","content":"像数 1, 2, 3 一样容易 ::: code-tabs#shell tab:active PNPM tab:active YARN tab:active NPM :::"}],["meta",{"property":"og:type","content":"website"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2023-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"WebPage\\",\\"name\\":\\"首页\\",\\"description\\":\\"像数 1, 2, 3 一样容易 ::: code-tabs#shell tab:active PNPM tab:active YARN tab:active NPM :::\\"}"]]},"headers":[{"level":3,"title":"像数 1, 2, 3 一样容易","slug":"像数-1-2-3-一样容易","link":"#像数-1-2-3-一样容易","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.4,"words":421},"filePathRelative":"zh/README.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/index.html-5e4b3f7a.js b/assets/index.html-5e4b3f7a.js new file mode 100644 index 00000000..5aafd7d4 --- /dev/null +++ b/assets/index.html-5e4b3f7a.js @@ -0,0 +1 @@ +import{_,W as a,X as l,Y as o,Z as s,D as e}from"./framework-46b0e263.js";const r={};function i(m,p){const n=e("HopeIcon"),t=e("AutoCatalog");return a(),l("div",null,[o(t,null,{icon:s(({icon:c})=>[o(n,{icon:c},null,8,["icon"])]),_:1})])}const d=_(r,[["render",i],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-62511030.js b/assets/index.html-62511030.js new file mode 100644 index 00000000..a6a99e25 --- /dev/null +++ b/assets/index.html-62511030.js @@ -0,0 +1 @@ +import{_ as r,W as a,X as i,$ as t,a0 as e,Y as n,a1 as s,D as d}from"./framework-46b0e263.js";const l={},c=t("h1",{id:"introduction",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#introduction","aria-hidden":"true"},"#"),e(" Introduction")],-1),h={href:"https://en.wikipedia.org/wiki/Markdown",target:"_blank",rel:"noopener noreferrer"},u=t("p",null,"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.",-1),p=t("h2",{id:"how-it-works",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#how-it-works","aria-hidden":"true"},"#"),e(" How It Works")],-1),f={href:"https://vuejs.org/",target:"_blank",rel:"noopener noreferrer"},m={href:"https://router.vuejs.org",target:"_blank",rel:"noopener noreferrer"},g={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},w=t("p",null,"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.",-1),b={href:"https://nuxtjs.org/",target:"_blank",rel:"noopener noreferrer"},_=t("code",null,"nuxt generate",-1),v={href:"https://www.gatsbyjs.org/",target:"_blank",rel:"noopener noreferrer"},y=s('

    Why Not ...?

    Nuxt

    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

    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.

    Docsify / Docute

    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

    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.

    GitBook

    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.

    ',6);function k(V,x){const o=d("ExternalLinkIcon");return a(),i("div",null,[c,t("p",null,[e("VuePress is a markdown-centered static site generator. You can write your content (documentations, blogs, etc.) in "),t("a",h,[e("Markdown"),n(o)]),e(", then VuePress will help you to generate a static site to host them.")]),u,p,t("p",null,[e("A VuePress site is in fact a single-page application (SPA) powered by "),t("a",f,[e("Vue"),n(o)]),e(" and "),t("a",m,[e("Vue Router"),n(o)]),e(".")]),t("p",null,[e("Routes are generated according to the relative path of your markdown files. Each Markdown file is compiled into HTML with "),t("a",g,[e("markdown-it"),n(o)]),e(" 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.")]),w,t("p",null,[e("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 "),t("a",b,[e("Nuxt"),n(o)]),e("'s "),_,e(" command and other projects like "),t("a",v,[e("Gatsby"),n(o)]),e(".")]),y])}const j=r(l,[["render",k],["__file","index.html.vue"]]);export{j as default}; diff --git a/assets/index.html-78973204.js b/assets/index.html-78973204.js new file mode 100644 index 00000000..5aafd7d4 --- /dev/null +++ b/assets/index.html-78973204.js @@ -0,0 +1 @@ +import{_,W as a,X as l,Y as o,Z as s,D as e}from"./framework-46b0e263.js";const r={};function i(m,p){const n=e("HopeIcon"),t=e("AutoCatalog");return a(),l("div",null,[o(t,null,{icon:s(({icon:c})=>[o(n,{icon:c},null,8,["icon"])]),_:1})])}const d=_(r,[["render",i],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-7e872e5b.js b/assets/index.html-7e872e5b.js new file mode 100644 index 00000000..7f62b550 --- /dev/null +++ b/assets/index.html-7e872e5b.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-47357bdb","path":"/zh/guide/","title":"介绍","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:circle-info","description":"VuePress 是一个以 Markdown 为中心的静态网站生成器。你可以使用 Markdown (https://zh.wikipedia.org/wiki/Markdown) 来书写内容(如文档、博客等),然后 VuePress 会帮助你生成一个静态网站来展示它们。 VuePress 诞生的初衷是为了支持 Vue.js 及其子项目的文档需求,但是...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/guide/"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/guide/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"介绍"}],["meta",{"property":"og:description","content":"VuePress 是一个以 Markdown 为中心的静态网站生成器。你可以使用 Markdown (https://zh.wikipedia.org/wiki/Markdown) 来书写内容(如文档、博客等),然后 VuePress 会帮助你生成一个静态网站来展示它们。 VuePress 诞生的初衷是为了支持 Vue.js 及其子项目的文档需求,但是..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"介绍\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"它是如何工作的?","slug":"它是如何工作的","link":"#它是如何工作的","children":[]},{"level":2,"title":"为什么不是 ...?","slug":"为什么不是","link":"#为什么不是","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":2.81,"words":842},"filePathRelative":"zh/guide/README.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/index.html-80a01853.js b/assets/index.html-80a01853.js new file mode 100644 index 00000000..9553da34 --- /dev/null +++ b/assets/index.html-80a01853.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-fffb8e28","path":"/guide/","title":"Introduction","lang":"en-US","frontmatter":{"icon":"fa6-solid:circle-info","description":"VuePress is a markdown-centered static site generator. You can write your content (documentations, blogs, etc.) in Markdown (https://en.wikipedia.org/wiki/Markdown), then VuePre...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/guide/"}],["meta",{"property":"og:url","content":"https://vuejs.press/guide/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Introduction"}],["meta",{"property":"og:description","content":"VuePress is a markdown-centered static site generator. You can write your content (documentations, blogs, etc.) in Markdown (https://en.wikipedia.org/wiki/Markdown), then VuePre..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Introduction\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.77,"words":530},"filePathRelative":"guide/README.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/index.html-842ca072.js b/assets/index.html-842ca072.js new file mode 100644 index 00000000..2dc11258 --- /dev/null +++ b/assets/index.html-842ca072.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-d61a9282","path":"/reference/plugin/","title":"Plugin","lang":"en-US","frontmatter":{"title":"Plugin","article":false,"feed":false,"sitemap":false,"description":"","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/plugin/"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/plugin/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Plugin"}],["meta",{"property":"og:type","content":"website"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"WebPage\\",\\"name\\":\\"Plugin\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0.03,"words":9},"filePathRelative":null,"autoDesc":true}');export{e as data}; diff --git a/assets/index.html-89525fb9.js b/assets/index.html-89525fb9.js new file mode 100644 index 00000000..5aafd7d4 --- /dev/null +++ b/assets/index.html-89525fb9.js @@ -0,0 +1 @@ +import{_,W as a,X as l,Y as o,Z as s,D as e}from"./framework-46b0e263.js";const r={};function i(m,p){const n=e("HopeIcon"),t=e("AutoCatalog");return a(),l("div",null,[o(t,null,{icon:s(({icon:c})=>[o(n,{icon:c},null,8,["icon"])]),_:1})])}const d=_(r,[["render",i],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-96c02e47.js b/assets/index.html-96c02e47.js new file mode 100644 index 00000000..eb601850 --- /dev/null +++ b/assets/index.html-96c02e47.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-22a2f9fd","path":"/reference/","title":"Reference","lang":"en-US","frontmatter":{"title":"Reference","article":false,"feed":false,"sitemap":false,"description":"","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Reference"}],["meta",{"property":"og:type","content":"website"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"WebPage\\",\\"name\\":\\"Reference\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0.03,"words":9},"filePathRelative":null,"autoDesc":true}');export{e as data}; diff --git a/assets/index.html-9ac61946.js b/assets/index.html-9ac61946.js new file mode 100644 index 00000000..5aafd7d4 --- /dev/null +++ b/assets/index.html-9ac61946.js @@ -0,0 +1 @@ +import{_,W as a,X as l,Y as o,Z as s,D as e}from"./framework-46b0e263.js";const r={};function i(m,p){const n=e("HopeIcon"),t=e("AutoCatalog");return a(),l("div",null,[o(t,null,{icon:s(({icon:c})=>[o(n,{icon:c},null,8,["icon"])]),_:1})])}const d=_(r,[["render",i],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-a69c820c.js b/assets/index.html-a69c820c.js new file mode 100644 index 00000000..5aafd7d4 --- /dev/null +++ b/assets/index.html-a69c820c.js @@ -0,0 +1 @@ +import{_,W as a,X as l,Y as o,Z as s,D as e}from"./framework-46b0e263.js";const r={};function i(m,p){const n=e("HopeIcon"),t=e("AutoCatalog");return a(),l("div",null,[o(t,null,{icon:s(({icon:c})=>[o(n,{icon:c},null,8,["icon"])]),_:1})])}const d=_(r,[["render",i],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-a809ce07.js b/assets/index.html-a809ce07.js new file mode 100644 index 00000000..bdb551d0 --- /dev/null +++ b/assets/index.html-a809ce07.js @@ -0,0 +1 @@ +import{_ as o,W as s,X as a,$ as t,a0 as e,Y as n,a1 as i,D as c}from"./framework-46b0e263.js";const d={},l=t("h1",{id:"介绍",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),e(" 介绍")],-1),h={href:"https://zh.wikipedia.org/wiki/Markdown",target:"_blank",rel:"noopener noreferrer"},u=t("p",null,"VuePress 诞生的初衷是为了支持 Vue.js 及其子项目的文档需求,但是现在它已经在帮助大量用户构建他们的文档、博客和其他静态网站。",-1),p=t("h2",{id:"它是如何工作的",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#它是如何工作的","aria-hidden":"true"},"#"),e(" 它是如何工作的?")],-1),_={href:"https://vuejs.org/",target:"_blank",rel:"noopener noreferrer"},V={href:"https://router.vuejs.org",target:"_blank",rel:"noopener noreferrer"},k={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},f=t("p",null,"在开发过程中,我们启动一个常规的开发服务器 (dev-server) ,并将 VuePress 站点作为一个常规的 SPA。如果你以前使用过 Vue 的话,你在使用时会感受到非常熟悉的开发体验。",-1),x={href:"https://nuxtjs.org/",target:"_blank",rel:"noopener noreferrer"},v=t("code",null,"nuxt generate",-1),P={href:"https://www.gatsbyjs.org/",target:"_blank",rel:"noopener noreferrer"},w=i('

    为什么不是 ...?

    Nuxt

    Nuxt 是一套出色的 Vue SSR 框架, VuePress 能做的事情,Nuxt 实际上也同样能够胜任。但 Nuxt 是为构建应用程序而生的,而 VuePress 则更为轻量化并且专注在以内容为中心的静态网站上。

    VitePress

    VitePress 是 VuePress 的孪生兄弟,它同样由 Vue.js 团队创建和维护。 VitePress 甚至比 VuePress 要更轻更快,但它在灵活性和可配置性上作出了一些让步,比如它不支持插件系统。当然,如果你没有进阶的定制化需求, VitePress 已经足够支持你将你的内容部署到线上。

    这个比喻可能不是很恰当,但是你可以把 VuePress 和 VitePress 的关系看作 Laravel 和 Lumen 。

    Docsify / Docute

    这两个项目同样都是基于 Vue,然而它们都是完全的运行时驱动,因此对 SEO 不够友好。如果你并不关注 SEO,同时也不想安装大量依赖,它们仍然是非常好的选择!

    Hexo

    Hexo 一直驱动着 Vue 2.x 的文档。Hexo 最大的问题在于他的主题系统太过于静态以及过度地依赖纯字符串,而我们十分希望能够好好地利用 Vue 来处理我们的布局和交互。同时,Hexo 在配置 Markdown 渲染方面的灵活性也不是最佳的。

    GitBook

    过去我们的子项目文档一直都在使用 GitBook 。 GitBook 最大的问题在于当文件很多时,每次编辑后的重新加载时间长得令人无法忍受。它的默认主题导航结构也比较有限制性,并且,主题系统也不是 Vue 驱动的。GitBook 背后的团队如今也更专注于将其打造为一个商业产品而不是开源工具。

    ',6);function g(m,b){const r=c("ExternalLinkIcon");return s(),a("div",null,[l,t("p",null,[e("VuePress 是一个以 Markdown 为中心的静态网站生成器。你可以使用 "),t("a",h,[e("Markdown"),n(r)]),e(" 来书写内容(如文档、博客等),然后 VuePress 会帮助你生成一个静态网站来展示它们。")]),u,p,t("p",null,[e("一个 VuePress 站点本质上是一个由 "),t("a",_,[e("Vue"),n(r)]),e(" 和 "),t("a",V,[e("Vue Router"),n(r)]),e(" 驱动的单页面应用 (SPA)。")]),t("p",null,[e("路由会根据你的 Markdown 文件的相对路径来自动生成。每个 Markdown 文件都通过 "),t("a",k,[e("markdown-it"),n(r)]),e(" 编译为 HTML ,然后将其作为 Vue 组件的模板。因此,你可以在 Markdown 文件中直接使用 Vue 语法,便于你嵌入一些动态内容。")]),f,t("p",null,[e("在构建过程中,我们会为 VuePress 站点创建一个服务端渲染 (SSR) 的版本,然后通过虚拟访问每一条路径来渲染对应的 HTML 。这种做法的灵感来源于 "),t("a",x,[e("Nuxt"),n(r)]),e(" 的 "),v,e(" 命令,以及其他的一些项目,比如 "),t("a",P,[e("Gatsby"),n(r)]),e("。")]),w])}const N=o(d,[["render",g],["__file","index.html.vue"]]);export{N as default}; diff --git a/assets/index.html-a8ad45ea.js b/assets/index.html-a8ad45ea.js new file mode 100644 index 00000000..b986b7da --- /dev/null +++ b/assets/index.html-a8ad45ea.js @@ -0,0 +1 @@ +import{_ as e,W as o,X as t,a1 as n}from"./framework-46b0e263.js";const i={},a=n('

    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 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),s=[a];function r(c,h){return o(),t("div",null,s)}const l=e(i,[["render",r],["__file","index.html.vue"]]);export{l as default}; diff --git a/assets/index.html-a94da676.js b/assets/index.html-a94da676.js new file mode 100644 index 00000000..36a934b3 --- /dev/null +++ b/assets/index.html-a94da676.js @@ -0,0 +1,34 @@ +import{_ as c,W as o,X as r,Y as d,Z as e,$ as n,a0 as s,D as m}from"./framework-46b0e263.js";const u={},p=n("h3",{id:"像数-1-2-3-一样容易",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#像数-1-2-3-一样容易","aria-hidden":"true"},"#"),s(" 像数 1, 2, 3 一样容易")],-1),v=n("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token comment"},"# 在你的项目中安装"),s(` +`),n("span",{class:"token function"},"pnpm"),s(),n("span",{class:"token function"},"add"),s(),n("span",{class:"token parameter variable"},"-D"),s(` vuepress@next @vuepress/client@next vue + +`),n("span",{class:"token comment"},"# 新建一个 markdown 文件"),s(` +`),n("span",{class:"token builtin class-name"},"echo"),s(),n("span",{class:"token string"},"'# Hello VuePress'"),s(),n("span",{class:"token operator"},">"),s(` README.md + +`),n("span",{class:"token comment"},"# 开始写作"),s(` +`),n("span",{class:"token function"},"pnpm"),s(` vuepress dev + +`),n("span",{class:"token comment"},"# 构建静态文件"),s(` +`),n("span",{class:"token function"},"pnpm"),s(` vuepress build +`)])]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"})])],-1),b=n("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token comment"},"# 在你的项目中安装"),s(` +`),n("span",{class:"token function"},"yarn"),s(),n("span",{class:"token function"},"add"),s(),n("span",{class:"token parameter variable"},"-D"),s(` vuepress@next + +`),n("span",{class:"token comment"},"# 新建一个 markdown 文件"),s(` +`),n("span",{class:"token builtin class-name"},"echo"),s(),n("span",{class:"token string"},"'# Hello VuePress'"),s(),n("span",{class:"token operator"},">"),s(` README.md + +`),n("span",{class:"token comment"},"# 开始写作"),s(` +`),n("span",{class:"token function"},"yarn"),s(` vuepress dev + +`),n("span",{class:"token comment"},"# 构建静态文件"),s(` +`),n("span",{class:"token function"},"yarn"),s(` vuepress build +`)])]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"})])],-1),k=n("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[n("pre",{class:"language-bash"},[n("code",null,[n("span",{class:"token comment"},"# 在你的项目中安装"),s(` +`),n("span",{class:"token function"},"npm"),s(),n("span",{class:"token function"},"install"),s(),n("span",{class:"token parameter variable"},"-D"),s(` vuepress@next + +`),n("span",{class:"token comment"},"# 新建一个 markdown 文件"),s(` +`),n("span",{class:"token builtin class-name"},"echo"),s(),n("span",{class:"token string"},"'# Hello VuePress'"),s(),n("span",{class:"token operator"},">"),s(` README.md + +`),n("span",{class:"token comment"},"# 开始写作"),s(` +npx vuepress dev + +`),n("span",{class:"token comment"},"# 构建静态文件"),s(` +npx vuepress build +`)])]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"}),n("div",{class:"line-number"})])],-1);function h(_,f){const t=m("CodeTabs");return o(),r("div",null,[p,d(t,{id:"3",data:[{title:"PNPM"},{title:"YARN"},{title:"NPM"}],active:0,"tab-id":"shell"},{tab0:e(({title:a,value:l,isActive:i})=>[v]),tab1:e(({title:a,value:l,isActive:i})=>[b]),tab2:e(({title:a,value:l,isActive:i})=>[k]),_:1})])}const g=c(u,[["render",h],["__file","index.html.vue"]]);export{g as default}; diff --git a/assets/index.html-b5987a1c.js b/assets/index.html-b5987a1c.js new file mode 100644 index 00000000..07eedb3d --- /dev/null +++ b/assets/index.html-b5987a1c.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5b5b9870","path":"/zh/reference/plugin/","title":"Plugin","lang":"en-US","frontmatter":{"title":"Plugin","article":false,"feed":false,"sitemap":false,"description":"","head":[["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/plugin/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Plugin"}],["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\\":\\"Plugin\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0.03,"words":9},"filePathRelative":null,"autoDesc":true}');export{e as data}; diff --git a/assets/index.html-baec65eb.js b/assets/index.html-baec65eb.js new file mode 100644 index 00000000..5aafd7d4 --- /dev/null +++ b/assets/index.html-baec65eb.js @@ -0,0 +1 @@ +import{_,W as a,X as l,Y as o,Z as s,D as e}from"./framework-46b0e263.js";const r={};function i(m,p){const n=e("HopeIcon"),t=e("AutoCatalog");return a(),l("div",null,[o(t,null,{icon:s(({icon:c})=>[o(n,{icon:c},null,8,["icon"])]),_:1})])}const d=_(r,[["render",i],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-c8256226.js b/assets/index.html-c8256226.js new file mode 100644 index 00000000..23924e9d --- /dev/null +++ b/assets/index.html-c8256226.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0a7c8599","path":"/zh/advanced/cookbook/","title":"介绍","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:circle-info","description":"Cookbook 的目的是什么? 我们在 指南 中介绍了基本概念,但你可能不知道怎么才能了解得更深入。; 我们在 参考 中列出了 API ,但你可能不知道如何充分利用它们。; 于是就有了 Cookbook 。 每个案例都会针对某个特定的方面,通过提供更详细的示例来向你展示 VuePress 的用法和其他可能性。","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/advanced/cookbook/"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/advanced/cookbook/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"介绍"}],["meta",{"property":"og:description","content":"Cookbook 的目的是什么? 我们在 指南 中介绍了基本概念,但你可能不知道怎么才能了解得更深入。; 我们在 参考 中列出了 API ,但你可能不知道如何充分利用它们。; 于是就有了 Cookbook 。 每个案例都会针对某个特定的方面,通过提供更详细的示例来向你展示 VuePress 的用法和其他可能性。"}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"介绍\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Cookbook 的目的是什么?","slug":"cookbook-的目的是什么","link":"#cookbook-的目的是什么","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.38,"words":115},"filePathRelative":"zh/advanced/cookbook/README.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/index.html-ca328bf3.js b/assets/index.html-ca328bf3.js new file mode 100644 index 00000000..5aafd7d4 --- /dev/null +++ b/assets/index.html-ca328bf3.js @@ -0,0 +1 @@ +import{_,W as a,X as l,Y as o,Z as s,D as e}from"./framework-46b0e263.js";const r={};function i(m,p){const n=e("HopeIcon"),t=e("AutoCatalog");return a(),l("div",null,[o(t,null,{icon:s(({icon:c})=>[o(n,{icon:c},null,8,["icon"])]),_:1})])}const d=_(r,[["render",i],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-d2bb853d.js b/assets/index.html-d2bb853d.js new file mode 100644 index 00000000..7a2d7c0e --- /dev/null +++ b/assets/index.html-d2bb853d.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-31c4276b","path":"/zh/reference/bundler/","title":"Bundler","lang":"en-US","frontmatter":{"title":"Bundler","article":false,"feed":false,"sitemap":false,"description":"","head":[["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/bundler/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Bundler"}],["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\\":\\"Bundler\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0.03,"words":9},"filePathRelative":null,"autoDesc":true}');export{e as data}; diff --git a/assets/index.html-d88310ab.js b/assets/index.html-d88310ab.js new file mode 100644 index 00000000..468366a5 --- /dev/null +++ b/assets/index.html-d88310ab.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2b10d2fc","path":"/reference/bundler/","title":"Bundler","lang":"en-US","frontmatter":{"title":"Bundler","article":false,"feed":false,"sitemap":false,"description":"","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/bundler/"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/bundler/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Bundler"}],["meta",{"property":"og:type","content":"website"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"WebPage\\",\\"name\\":\\"Bundler\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0.03,"words":9},"filePathRelative":null,"autoDesc":true}');export{e as data}; diff --git a/assets/index.html-dc3052e6.js b/assets/index.html-dc3052e6.js new file mode 100644 index 00000000..cc05a189 --- /dev/null +++ b/assets/index.html-dc3052e6.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-98ca8604","path":"/zh/reference/default-theme/","title":"Default Theme","lang":"en-US","frontmatter":{"title":"Default Theme","article":false,"feed":false,"sitemap":false,"description":"","head":[["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/default-theme/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Default Theme"}],["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\\":\\"Default Theme\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0.03,"words":9},"filePathRelative":null,"autoDesc":true}');export{e as data}; diff --git a/assets/index.html-ee294b98.js b/assets/index.html-ee294b98.js new file mode 100644 index 00000000..b7897107 --- /dev/null +++ b/assets/index.html-ee294b98.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-638c1d18","path":"/advanced/","title":"Advanced","lang":"en-US","frontmatter":{"title":"Advanced","article":false,"feed":false,"sitemap":false,"description":"","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/advanced/"}],["meta",{"property":"og:url","content":"https://vuejs.press/advanced/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Advanced"}],["meta",{"property":"og:type","content":"website"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"WebPage\\",\\"name\\":\\"Advanced\\"}"]]},"headers":[],"git":{},"readingTime":{"minutes":0.03,"words":9},"filePathRelative":null,"autoDesc":true}');export{e as data}; diff --git a/assets/index.html-f6507965.js b/assets/index.html-f6507965.js new file mode 100644 index 00000000..5aafd7d4 --- /dev/null +++ b/assets/index.html-f6507965.js @@ -0,0 +1 @@ +import{_,W as a,X as l,Y as o,Z as s,D as e}from"./framework-46b0e263.js";const r={};function i(m,p){const n=e("HopeIcon"),t=e("AutoCatalog");return a(),l("div",null,[o(t,null,{icon:s(({icon:c})=>[o(n,{icon:c},null,8,["icon"])]),_:1})])}const d=_(r,[["render",i],["__file","index.html.vue"]]);export{d as default}; diff --git a/assets/index.html-fb5c6011.js b/assets/index.html-fb5c6011.js new file mode 100644 index 00000000..8de30cae --- /dev/null +++ b/assets/index.html-fb5c6011.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-8daa1a0e","path":"/","title":"Home","lang":"en-US","frontmatter":{"home":true,"title":"Home","icon":"fa6-solid:house","heroImage":"/images/hero.png","actions":[{"text":"Get Started","link":"/guide/getting-started.html","type":"primary"},{"text":"Introduction","link":"/guide/","type":"secondary"}],"features":[{"title":"Simplicity First","icon":"fa6-solid:star","details":"Minimal setup with markdown-centered project structure helps you focus on writing."},{"title":"Vue-Powered","icon":"fa6-brands:vuejs","details":"Enjoy the dev experience of Vue, use Vue components in markdown, and develop custom themes with Vue."},{"title":"Performant","icon":"fa6-solid:bolt","details":"VuePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded."},{"title":"Themes","icon":"fa6-solid:palette","details":"Providing a default theme out of the box. You can also choose a community theme or create your own one."},{"title":"Plugins","icon":"fa6-solid:plug","details":"Flexible plugin API, allowing plugins to provide lots of plug-and-play features for your site."},{"title":"Bundlers","icon":"fa6-solid:boxes-packing","details":"Default bundler is Vite, while Webpack is also supported. Choose the one you like!"}],"description":"As Easy as 1, 2, 3 ::: code-tabs#shell tab:active PNPM tab YARN tab NPM :::","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/"}],["meta",{"property":"og:url","content":"https://vuejs.press/"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Home"}],["meta",{"property":"og:description","content":"As Easy as 1, 2, 3 ::: code-tabs#shell tab:active PNPM tab YARN tab NPM :::"}],["meta",{"property":"og:type","content":"website"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2023-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"WebPage\\",\\"name\\":\\"Home\\",\\"description\\":\\"As Easy as 1, 2, 3 ::: code-tabs#shell tab:active PNPM tab YARN tab NPM :::\\"}"]]},"headers":[{"level":3,"title":"As Easy as 1, 2, 3","slug":"as-easy-as-1-2-3","link":"#as-easy-as-1-2-3","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.94,"words":281},"filePathRelative":"README.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/making-a-theme-extendable.html-4a2e0dc4.js b/assets/making-a-theme-extendable.html-4a2e0dc4.js new file mode 100644 index 00000000..549ed2f0 --- /dev/null +++ b/assets/making-a-theme-extendable.html-4a2e0dc4.js @@ -0,0 +1,35 @@ +import{_ as p,W as o,X as c,$ as s,a0 as n,Y as t,Z as e,a1 as l,D as u}from"./framework-46b0e263.js";const i={},r=s("h1",{id:"开发一个可继承的主题",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#开发一个可继承的主题","aria-hidden":"true"},"#"),n(" 开发一个可继承的主题")],-1),k=s("p",null,"有时用户可能希望对一个主题进行一些小改动,但是又不想 Fork 并修改整个项目。",-1),d=l(`

    布局插槽

    这种方式需要你来决定主题的哪些部分是可以被扩展的,它更适合用于一些常见的自定义需求,比如页眉或页脚。

    你只需要在你的布局文件中提供 slots ,并告诉用户如何使用它们即可:

    <template>
    +  <div class="my-theme-layout">
    +    <slot name="page-header" />
    +    <Content />
    +    <slot name="page-footer" />
    +  </div>
    +</template>
    +

    组件别名

    这种方式需要你考虑清楚你的主题的哪些组件可以被替换,并且你需要将组件拆分到合适的粒度。

    首先,为你主题的可替换组件设置 alias 别名:

    import type { Theme } from "@vuepress/core";
    +import { getDirname, path } from "@vuepress/utils";
    +
    +const __dirname = getDirname(import.meta.url);
    +
    +export const fooTheme = (options): Theme => {
    +  return {
    +    name: "vuepress-theme-foo",
    +    alias: {
    +      // 为可替换的组件设置别名
    +      "@theme/Navbar.vue": path.resolve(__dirname, "components/Navbar.vue"),
    +      "@theme/Sidebar.vue": path.resolve(__dirname, "components/Sidebar.vue"),
    +    },
    +  };
    +};
    +

    然后,在你的主题中通过别名来使用这些组件:

    <script setup lang="ts">
    +import Navbar from "@theme/Navbar.vue";
    +import Sidebar from "@theme/Sidebar.vue";
    +</script>
    +
    +<template>
    +  <div class="my-theme-layout">
    +    <Navbar />
    +    <Sidebar />
    +    <Content />
    +  </div>
    +</template>
    +

    这样,用户在继承或使用你的主题时,就可以通过覆盖 alias 来替换特定的组件了。

    `,11);function v(m,g){const a=u("RouterLink");return o(),c("div",null,[r,k,s("p",null,[n("借助于 "),t(a,{to:"/zh/reference/theme-api.html"},{default:e(()=>[n("主题 API")]),_:1}),n(" ,你可以让用户继承你的主题,允许用户对你的主题进行改动。")]),s("p",null,[n("你肯定已经知道了如何 "),t(a,{to:"/zh/reference/default-theme/extending.html"},{default:e(()=>[n("继承默认主题")]),_:1}),n(" 。接下来我们将介绍如何让你的主题像默认主题一样被用户继承。")]),d])}const h=p(i,[["render",v],["__file","making-a-theme-extendable.html.vue"]]);export{h as default}; diff --git a/assets/making-a-theme-extendable.html-8d323011.js b/assets/making-a-theme-extendable.html-8d323011.js new file mode 100644 index 00000000..eb3fdbda --- /dev/null +++ b/assets/making-a-theme-extendable.html-8d323011.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-04c514ac","path":"/zh/advanced/cookbook/making-a-theme-extendable.html","title":"开发一个可继承的主题","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:clone","description":"有时用户可能希望对一个主题进行一些小改动,但是又不想 Fork 并修改整个项目。 借助于 主题 API (../../reference/theme-api.md) ,你可以让用户继承你的主题,允许用户对你的主题进行改动。 你肯定已经知道了如何 继承默认主题 (../../reference/default-theme/extending.md) 。接...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/advanced/cookbook/making-a-theme-extendable.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/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 并修改整个项目。 借助于 主题 API (../../reference/theme-api.md) ,你可以让用户继承你的主题,允许用户对你的主题进行改动。 你肯定已经知道了如何 继承默认主题 (../../reference/default-theme/extending.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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"开发一个可继承的主题\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"布局插槽","slug":"布局插槽","link":"#布局插槽","children":[]},{"level":2,"title":"组件别名","slug":"组件别名","link":"#组件别名","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.41,"words":424},"filePathRelative":"zh/advanced/cookbook/making-a-theme-extendable.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/making-a-theme-extendable.html-9a9a0ccd.js b/assets/making-a-theme-extendable.html-9a9a0ccd.js new file mode 100644 index 00000000..929b2905 --- /dev/null +++ b/assets/making-a-theme-extendable.html-9a9a0ccd.js @@ -0,0 +1,35 @@ +import{_ as p,W as o,X as c,$ as s,a0 as n,Y as t,Z as e,a1 as l,D as u}from"./framework-46b0e263.js";const i={},r=s("h1",{id:"making-a-theme-extendable",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#making-a-theme-extendable","aria-hidden":"true"},"#"),n(" Making a Theme Extendable")],-1),k=s("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),d=l(`

    Layout Slots

    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:

    <template>
    +  <div class="my-theme-layout">
    +    <slot name="page-header" />
    +    <Content />
    +    <slot name="page-footer" />
    +  </div>
    +</template>
    +

    Component Aliases

    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 => {
    +  return {
    +    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:

    <script setup lang="ts">
    +import Navbar from "@theme/Navbar.vue";
    +import Sidebar from "@theme/Sidebar.vue";
    +</script>
    +
    +<template>
    +  <div class="my-theme-layout">
    +    <Navbar />
    +    <Sidebar />
    +    <Content />
    +  </div>
    +</template>
    +

    Then, users can replace specific components by overriding the alias when extending or using your theme.

    `,11);function m(v,g){const a=u("RouterLink");return o(),c("div",null,[r,k,s("p",null,[n("With the help of "),t(a,{to:"/reference/theme-api.html"},{default:e(()=>[n("Theme API")]),_:1}),n(", you can make your theme extendable, allowing users to make their own modifications easily.")]),s("p",null,[n("You must have known that how to "),t(a,{to:"/reference/default-theme/extending.html"},{default:e(()=>[n("extend default theme")]),_:1}),n(". Here we'll introduce how to make your own theme extendable like default theme.")]),d])}const b=p(i,[["render",m],["__file","making-a-theme-extendable.html.vue"]]);export{b as default}; diff --git a/assets/making-a-theme-extendable.html-f8f662ca.js b/assets/making-a-theme-extendable.html-f8f662ca.js new file mode 100644 index 00000000..54237581 --- /dev/null +++ b/assets/making-a-theme-extendable.html-f8f662ca.js @@ -0,0 +1 @@ +const e=JSON.parse(`{"key":"v-06adec7d","path":"/advanced/cookbook/making-a-theme-extendable.html","title":"Making a Theme Extendable","lang":"en-US","frontmatter":{"icon":"fa6-solid:clone","description":"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 Theme API (../../reference/theme-api.m...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/advanced/cookbook/making-a-theme-extendable.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/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":"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 Theme API (../../reference/theme-api.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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Making a Theme Extendable\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.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":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.96,"words":289},"filePathRelative":"advanced/cookbook/making-a-theme-extendable.md","localizedDate":"February 22, 2023","autoDesc":true}`);export{e as data}; diff --git a/assets/markdown-and-vue-sfc.html-0af2e2a9.js b/assets/markdown-and-vue-sfc.html-0af2e2a9.js new file mode 100644 index 00000000..a3ba567f --- /dev/null +++ b/assets/markdown-and-vue-sfc.html-0af2e2a9.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4e3c9b8c","path":"/advanced/cookbook/markdown-and-vue-sfc.html","title":"Markdown and Vue SFC","lang":"en-US","frontmatter":{"icon":"fa6-brands:vuejs","description":"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 and are treated as Vue SFC ...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/advanced/cookbook/markdown-and-vue-sfc.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/advanced/cookbook/markdown-and-vue-sfc.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Markdown and Vue SFC"}],["meta",{"property":"og:description","content":"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 and are treated as Vue SFC ..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Markdown and Vue SFC\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.72,"words":215},"filePathRelative":"advanced/cookbook/markdown-and-vue-sfc.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/markdown-and-vue-sfc.html-5c47f4ae.js b/assets/markdown-and-vue-sfc.html-5c47f4ae.js new file mode 100644 index 00000000..857b49da --- /dev/null +++ b/assets/markdown-and-vue-sfc.html-5c47f4ae.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-63e02eaa","path":"/zh/advanced/cookbook/markdown-and-vue-sfc.html","title":"Markdown 与 Vue SFC","lang":"zh-CN","frontmatter":{"icon":"fa6-brands:vuejs","description":"每一个 Markdown 文件,首先都会编译为 HTML ,然后转换为一个 Vue 单文件组件 (SFC) 。换句话说,你可以像写 Vue SFC 一样来写 Markdown 文件: 和 标签会直接被当作 Vue SFC 中的标签。换句话说,它们是从 标签中提升到了 SFC 的顶层。; 所有 和 标签的以外的内容,会先被编译为 HTML ,然后被当作 ...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/advanced/cookbook/markdown-and-vue-sfc.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/advanced/cookbook/markdown-and-vue-sfc.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Markdown 与 Vue SFC"}],["meta",{"property":"og:description","content":"每一个 Markdown 文件,首先都会编译为 HTML ,然后转换为一个 Vue 单文件组件 (SFC) 。换句话说,你可以像写 Vue SFC 一样来写 Markdown 文件: 和 标签会直接被当作 Vue SFC 中的标签。换句话说,它们是从 标签中提升到了 SFC 的顶层。; 所有 和 标签的以外的内容,会先被编译为 HTML ,然后被当作 ..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Markdown 与 Vue SFC\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.96,"words":287},"filePathRelative":"zh/advanced/cookbook/markdown-and-vue-sfc.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/markdown-and-vue-sfc.html-dc45e8fd.js b/assets/markdown-and-vue-sfc.html-dc45e8fd.js new file mode 100644 index 00000000..aafa3e7c --- /dev/null +++ b/assets/markdown-and-vue-sfc.html-dc45e8fd.js @@ -0,0 +1,31 @@ +import{_ as c,r as l,W as i,X as u,$ as n,a5 as t,Y as d,Z as r,a1 as k,j as v}from"./framework-46b0e263.js";const m=k(`

    Markdown and Vue SFC

    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.

    Note

    As Vue SFC can contain only one <script> element, you should avoid using more than one <script> in VuePress markdown.

    Here comes an example:

    Input

    _Hello, {{ msg }}_
    +
    +<RedDiv>
    +
    +_Current count is: {{ count }}_
    +
    +</RedDiv>
    +
    +<button @click="count++">Click Me!</button>
    +
    +<script setup>
    +import { h, ref } from "vue";
    +
    +const RedDiv = (_, ctx) =>
    +  h(
    +    "div",
    +    {
    +      class: "red-div",
    +    },
    +    ctx.slots.default()
    +  );
    +const msg = "Vue in Markdown";
    +const count = ref(0);
    +</script>
    +
    +<style>
    +.red-div {
    +  color: red;
    +}
    +</style>
    +

    Output

    `,8),g={__name:"markdown-and-vue-sfc.html",setup(b){const e=(o,s)=>v("div",{class:"red-div"},s.slots.default()),p="Vue in Markdown",a=l(0);return(o,s)=>(i(),u("div",null,[m,n("p",null,[n("em",null,"Hello, "+t(p))]),d(e,null,{default:r(()=>[n("p",null,[n("em",null,"Current count is: "+t(a.value),1)])]),_:1}),n("p",null,[n("button",{onClick:s[0]||(s[0]=f=>a.value++)},"Click Me!")])]))}},_=c(g,[["__file","markdown-and-vue-sfc.html.vue"]]);export{_ as default}; diff --git a/assets/markdown-and-vue-sfc.html-ed00f986.js b/assets/markdown-and-vue-sfc.html-ed00f986.js new file mode 100644 index 00000000..dfcec673 --- /dev/null +++ b/assets/markdown-and-vue-sfc.html-ed00f986.js @@ -0,0 +1,31 @@ +import{_ as o,r as l,W as i,X as u,$ as n,a5 as t,Y as d,Z as r,a1 as k,j as v}from"./framework-46b0e263.js";const m=k(`

    Markdown 与 Vue SFC

    每一个 Markdown 文件,首先都会编译为 HTML ,然后转换为一个 Vue 单文件组件 (SFC) 。换句话说,你可以像写 Vue SFC 一样来写 Markdown 文件:

    • <script><style> 标签会直接被当作 Vue SFC 中的标签。换句话说,它们是从 <template> 标签中提升到了 SFC 的顶层。
    • 所有 <script><style> 标签的以外的内容,会先被编译为 HTML ,然后被当作 Vue SFC 的 <template> 标签。

    注意

    由于 Vue 单文件组件只能包含一个 <script> 标签,你应该避免在 VuePress Markdown 中使用多于一个 <script> 标签。

    我们来看一个例子:

    输入

    _你好, {{ msg }}_
    +
    +<RedDiv>
    +
    +_当前计数为: {{ count }}_
    +
    +</RedDiv>
    +
    +<button @click="count++">点我!</button>
    +
    +<script setup>
    +import { h, ref } from "vue";
    +
    +const RedDiv = (_, ctx) =>
    +  h(
    +    "div",
    +    {
    +      class: "red-div",
    +    },
    +    ctx.slots.default()
    +  );
    +const msg = "Markdown 中的 Vue";
    +const count = ref(0);
    +</script>
    +
    +<style>
    +.red-div {
    +  color: red;
    +}
    +</style>
    +

    输出

    `,8),g={__name:"markdown-and-vue-sfc.html",setup(b){const e=(c,s)=>v("div",{class:"red-div"},s.slots.default()),p="Markdown 中的 Vue",a=l(0);return(c,s)=>(i(),u("div",null,[m,n("p",null,[n("em",null,"你好, "+t(p))]),d(e,null,{default:r(()=>[n("p",null,[n("em",null,"当前计数为: "+t(a.value),1)])]),_:1}),n("p",null,[n("button",{onClick:s[0]||(s[0]=_=>a.value++)},"点我!")])]))}},w=o(g,[["__file","markdown-and-vue-sfc.html.vue"]]);export{w as default}; diff --git a/assets/markdown.html-02e69834.js b/assets/markdown.html-02e69834.js new file mode 100644 index 00000000..be01a7db --- /dev/null +++ b/assets/markdown.html-02e69834.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-176c9c4a","path":"/reference/default-theme/markdown.html","title":"Markdown","lang":"en-US","frontmatter":{"icon":"fa6-brands:markdown","description":"Custom Containers Usage:; The type is required, and the title and content are optional. Supported type : tip; warning; danger; details; Alias of CodeGroup (./components.md#codeg...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/default-theme/markdown.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/default-theme/markdown.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Markdown"}],["meta",{"property":"og:description","content":"Custom Containers Usage:; The type is required, and the title and content are optional. Supported type : tip; warning; danger; details; Alias of CodeGroup (./components.md#codeg..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Markdown\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Custom Containers","slug":"custom-containers","link":"#custom-containers","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.61,"words":184},"filePathRelative":"reference/default-theme/markdown.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/markdown.html-72308ea5.js b/assets/markdown.html-72308ea5.js new file mode 100644 index 00000000..ec1a2e3a --- /dev/null +++ b/assets/markdown.html-72308ea5.js @@ -0,0 +1,59 @@ +import{_ as p,W as v,X as m,Y as e,$ as n,a0 as s,Z as a,a1 as t,D as i}from"./framework-46b0e263.js";const g={},b=n("h1",{id:"markdown",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown","aria-hidden":"true"},"#"),s(" Markdown")],-1),k=n("h2",{id:"custom-containers",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#custom-containers","aria-hidden":"true"},"#"),s(" Custom Containers")],-1),h=t(`

    Usage:

    ::: <type> [title]
    +[content]
    +:::
    +

    The type is required, and the title and content are optional.

    Supported type :

    `,4),_=n("li",null,[n("code",null,"tip")],-1),w=n("li",null,[n("code",null,"warning")],-1),f=n("li",null,[n("code",null,"danger")],-1),x=n("li",null,[n("code",null,"details")],-1),y=n("ul",null,[n("li",null,[n("code",null,"code-group")]),n("li",null,[n("code",null,"code-group-item")])],-1),T=n("li",null,[n("p",null,"Example 1 (default title):")],-1),C=t(`

    Input

    ::: tip
    +
    +This is a tip
    +
    +:::
    +
    +::: warning
    +
    +This is a warning
    +
    +:::
    +
    +::: danger
    +
    +This is a dangerous warning
    +
    +:::
    +
    +::: details
    +This is a details block
    +
    +:::
    +

    Output

    Tips

    This is a tip

    Note

    This is a warning

    Warning

    This is a dangerous warning

    Details

    This is a details block

    • Example 2 (custom title):

    Input

    ::: danger STOP
    +Danger zone, do not proceed
    +
    +:::
    +
    +::: details Click me to view the code
    +
    +\`\`\`ts
    +console.log("Hello, VuePress!");
    +\`\`\`
    +
    +:::
    +

    Output

    STOP

    Danger zone, do not proceed

    Click me to view the code
    console.log("Hello, VuePress!");
    +
    • Example 3 (code group alias):

    Input

    :::: code-group
    +::: code-group-item FOO
    +
    +\`\`\`ts
    +const foo = "foo";
    +\`\`\`
    +
    +:::
    +
    +::: code-group-item BAR
    +
    +\`\`\`ts
    +const bar = "bar";
    +\`\`\`
    +
    +:::
    +
    +::::
    +

    Output

    `,17),q=n("div",{class:"language-typescript line-numbers-mode","data-ext":"ts"},[n("pre",{class:"language-typescript"},[n("code",null,[n("span",{class:"token keyword"},"const"),s(" foo "),n("span",{class:"token operator"},"="),s(),n("span",{class:"token string"},'"foo"'),n("span",{class:"token punctuation"},";"),s(` +`)])]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"})])],-1),O=n("div",{class:"language-typescript line-numbers-mode","data-ext":"ts"},[n("pre",{class:"language-typescript"},[n("code",null,[n("span",{class:"token keyword"},"const"),s(" bar "),n("span",{class:"token operator"},"="),s(),n("span",{class:"token string"},'"bar"'),n("span",{class:"token punctuation"},";"),s(` +`)])]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"})])],-1);function B(N,V){const d=i("NpmBadge"),l=i("RouterLink"),o=i("CodeTabs");return v(),m("div",null,[b,e(d,{package:"@vuepress/theme-default"}),k,n("ul",null,[n("li",null,[h,n("ul",null,[_,w,f,x,n("li",null,[s("Alias of "),e(l,{to:"/reference/default-theme/components.html#codegroup"},{default:a(()=>[s("CodeGroup")]),_:1}),s(" and "),e(l,{to:"/reference/default-theme/components.html#codegroupitem"},{default:a(()=>[s("CodeGroupItem")]),_:1}),s(": "),y])])]),T]),C,e(o,{id:"129",data:[{title:"FOO"},{title:"BAR"}]},{tab0:a(({title:c,value:r,isActive:u})=>[q]),tab1:a(({title:c,value:r,isActive:u})=>[O]),_:1})])}const D=p(g,[["render",B],["__file","markdown.html.vue"]]);export{D as default}; diff --git a/assets/markdown.html-8eab8112.js b/assets/markdown.html-8eab8112.js new file mode 100644 index 00000000..f3144668 --- /dev/null +++ b/assets/markdown.html-8eab8112.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-c78c5de8","path":"/zh/reference/default-theme/markdown.html","title":"Markdown","lang":"zh-CN","frontmatter":{"icon":"fa6-brands:markdown","description":"自定义容器 使用:; type 是必需的, title 和 content 是可选的。 支持的 type 有: tip; warning; danger; details; CodeGroup (./components.md#codegroup) 和 CodeGroupItem (./components.md#codegroupitem) 的别名:...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/default-theme/markdown.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/default-theme/markdown.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Markdown"}],["meta",{"property":"og:description","content":"自定义容器 使用:; type 是必需的, title 和 content 是可选的。 支持的 type 有: tip; warning; danger; details; CodeGroup (./components.md#codegroup) 和 CodeGroupItem (./components.md#codegroupitem) 的别名:..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Markdown\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"自定义容器","slug":"自定义容器","link":"#自定义容器","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.78,"words":234},"filePathRelative":"zh/reference/default-theme/markdown.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/markdown.html-aac5e40a.js b/assets/markdown.html-aac5e40a.js new file mode 100644 index 00000000..e54a32f0 --- /dev/null +++ b/assets/markdown.html-aac5e40a.js @@ -0,0 +1,131 @@ +import{_ as k,W as c,X as r,$ as n,a0 as s,Y as a,Z as e,a2 as m,a3 as v,a4 as h,a1 as i,D as p,a5 as g}from"./framework-46b0e263.js";const b={},_=n("h1",{id:"markdown",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown","aria-hidden":"true"},"#"),s(" Markdown")],-1),f={href:"https://commonmark.org/help/",target:"_blank",rel:"noopener noreferrer"},w=n("h2",{id:"语法扩展",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#语法扩展","aria-hidden":"true"},"#"),s(" 语法扩展")],-1),x={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},q={href:"https://github.com/markdown-it/markdown-it#syntax-extensions",target:"_blank",rel:"noopener noreferrer"},M=n("p",null,"本章节将会介绍 VuePress 内置支持的 Markdown 语法扩展。",-1),y=n("h3",{id:"内置",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#内置","aria-hidden":"true"},"#"),s(" 内置")],-1),j=n("p",null,"由 markdown-it 内置支持:",-1),z={href:"https://help.github.com/articles/organizing-information-with-tables/",target:"_blank",rel:"noopener noreferrer"},E={href:"https://help.github.com/articles/basic-writing-and-formatting-syntax/#styling-text",target:"_blank",rel:"noopener noreferrer"},L=n("h3",{id:"标题锚点",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#标题锚点","aria-hidden":"true"},"#"),s(" 标题锚点")],-1),V=n("p",null,[s("你可能已经注意到,当你把鼠标放在各个章节的标题上时,会显示出一个 "),n("code",null,"#"),s(" 锚点。点击这个 "),n("code",null,"#"),s(" 锚点,可以直接跳转到对应章节。")],-1),T={class:"hint-container tip"},R=n("p",{class:"hint-container-title"},"提示",-1),P={href:"https://github.com/valeriangalliat/markdown-it-anchor",target:"_blank",rel:"noopener noreferrer"},A=n("h3",{id:"链接",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#链接","aria-hidden":"true"},"#"),s(" 链接")],-1),B={href:"https://spec.commonmark.org/0.29/#link-reference-definitions",target:"_blank",rel:"noopener noreferrer"},C=i(`

    以我们文档的源文件为例:

    └─ docs
    +   └─ zh
    +      ├─ guide
    +      │  ├─ getting-started.md
    +      │  ├─ markdown.md    # <- 我们在这里
    +      │  └─ README.md
    +      ├─ reference
    +      │  └─ config.md
    +      └─ README.md
    +

    原始 Markdown

    <!-- 相对路径 -->
    +
    +[首页](../README.md)  
    +[配置参考](../reference/config.md)  
    +[快速上手](./getting-started.md)
    +
    +<!-- 绝对路径 -->
    +
    +[指南](/zh/guide/README.md)  
    +[配置参考 > markdown.links](/zh/reference/config.md#links)
    +
    +<!-- URL -->
    +
    +[GitHub](https://github.com)
    +

    转换为

    <template>
    +  <RouterLink to="/zh/">首页</RouterLink>
    +  <RouterLink to="/zh/reference/config.html">配置参考</RouterLink>
    +  <RouterLink to="/zh/guide/getting-started.html">快速上手</RouterLink>
    +  <RouterLink to="/zh/guide/">指南</RouterLink>
    +  <RouterLink to="/zh/reference/config.html#links"
    +    >配置参考 &gt; markdown.links</RouterLink
    +  >
    +  <a href="https://github.com" target="_blank" rel="noopener noreferrer"
    +    >GitHub</a
    +  >
    +</template>
    +

    渲染为

    `,7),D=n("br",null,null,-1),H=n("br",null,null,-1),S=n("br",null,null,-1),F=n("br",null,null,-1),N=n("br",null,null,-1),U={href:"https://github.com",target:"_blank",rel:"noopener noreferrer"},O=n("p",null,[n("strong",null,"解释")],-1),G=n("li",null,[s("内部链接会被转换为 "),n("code",null,""),s(" 以便进行 SPA 导航。")],-1),I=n("code",null,".md",-1),J=n("li",null,[s("外部链接会被添加 "),n("code",null,'target="_blank" rel="noopener noreferrer"'),s(" 属性。")],-1),W=n("p",null,[n("strong",null,"建议")],-1),X=n("p",null,"对于指向内部 Markdown 文件的链接,尽可能使用相对路径而不是绝对路径。",-1),Y=n("ul",null,[n("li",null,"相对路径是指向目标文件的有效链接,在你的编辑器或者代码仓库中浏览源文件时也可以正确跳转。"),n("li",null,"相对路径在不同 locales 下都是一致的,这样在翻译你的内容时就不需要修改 locale 路径了。")],-1),Z={class:"hint-container tip"},$=n("p",{class:"hint-container-title"},"提示",-1),K=n("p",null,"链接扩展是由我们的内置插件支持的。",-1),Q=n("h3",{id:"emoji",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#emoji","aria-hidden":"true"},"#"),s(" Emoji 🎉")],-1),nn=n("p",null,[s("你可以在你的 Markdown 内容中输入 "),n("code",null,":EMOJICODE:"),s(" 来添加 Emoji 表情。")],-1),sn={href:"https://github.com/ikatyang/emoji-cheat-sheet",target:"_blank",rel:"noopener noreferrer"},an=n("p",null,[n("strong",null,"输入")],-1),en=n("div",{class:"language-markdown line-numbers-mode","data-ext":"md"},[n("pre",{class:"language-markdown"},[n("code",null,`VuePress 2 已经发布 :tada: ! +`)]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"})])],-1),tn=n("p",null,[n("strong",null,"输出")],-1),on=n("p",null,"VuePress 2 已经发布 🎉 !",-1),ln={class:"hint-container tip"},pn=n("p",{class:"hint-container-title"},"提示",-1),cn={href:"https://github.com/markdown-it/markdown-it-emoji",target:"_blank",rel:"noopener noreferrer"},rn=i(`

    目录

    如果你想要把当前页面的目录添加到 Markdown 内容中,你可以使用 [[toc]] 语法。

    输入

    [[toc]]
    +

    输出

    `,5),dn={class:"table-of-contents"},un=n("p",null,[s("目录中的标题将会链接到对应的 "),n("a",{href:"#%E6%A0%87%E9%A2%98%E9%94%9A%E7%82%B9"},"标题锚点"),s(",因此如果你禁用了标题锚点,可能会影响目录的功能。")],-1),kn={class:"hint-container tip"},mn=n("p",{class:"hint-container-title"},"提示",-1),vn={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc",target:"_blank",rel:"noopener noreferrer"},hn=i(`

    代码块

    下列代码块扩展是在 Node 端进行 Markdown 解析的时候实现的。这意味着代码块并不会在客户端被处理。

    行高亮

    你可以在代码块添加行数范围标记,来为对应代码行进行高亮:

    输入

    \`\`\`ts{1,6-8}
    +import { defaultTheme, defineUserConfig } from 'vuepress'
    +
    +export default defineUserConfig({
    +  title: '你好, VuePress',
    +
    +  theme: defaultTheme({
    +    logo: 'https://vuejs.org/images/logo.png',
    +  }),
    +})
    +\`\`\`
    +

    输出

    import { defaultTheme, defineUserConfig } from 'vuepress'
    +
    +export default defineUserConfig({
    +  title: '你好, VuePress',
    +
    +  theme: defaultTheme({
    +    logo: 'https://vuejs.org/images/logo.png',
    +  }),
    +})
    +
     




     
     
     

    行数范围标记的例子:

    • 行数范围: {5-8}
    • 多个单行: {4,7,9}
    • 组合: {4,7-13,16,23-27,40}
    `,10),gn={class:"hint-container tip"},bn=n("p",{class:"hint-container-title"},"提示",-1),_n={href:"https://github.com/egoist/markdown-it-highlight-lines",target:"_blank",rel:"noopener noreferrer"},fn=i(`

    行号

    你肯定已经注意到在代码块的最左侧会展示行号。这个功能是默认启用的,你可以通过配置来禁用它。

    你可以在代码块添加 :line-numbers / :no-line-numbers 标记来覆盖配置项中的设置。

    输入

    \`\`\`ts
    +// 行号默认是启用的
    +const line2 = "This is line 2";
    +const line3 = "This is line 3";
    +\`\`\`
    +
    +\`\`\`ts:no-line-numbers
    +// 行号被禁用
    +const line2 = 'This is line 2'
    +const line3 = 'This is line 3'
    +\`\`\`
    +

    输出

    // 行号默认是启用的
    +const line2 = "This is line 2";
    +const line3 = "This is line 3";
    +
    // 行号被禁用
    +const line2 = 'This is line 2'
    +const line3 = 'This is line 3'
    +
    `,8),wn={class:"hint-container tip"},xn=n("p",{class:"hint-container-title"},"提示",-1),qn=n("p",null,"行号扩展是由我们的内置插件支持的。",-1),Mn=n("h4",{id:"添加-v-pre",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#添加-v-pre","aria-hidden":"true"},"#"),s(" 添加 v-pre")],-1),yn=n("p",null,[s("由于 "),n("a",{href:"#%E6%A8%A1%E6%9D%BF%E8%AF%AD%E6%B3%95"},"模板语法可以在 Markdown 中使用"),s(",它也同样可以在代码块中生效。")],-1),jn={href:"https://v3.vuejs.org/api/directives.html#v-pre",target:"_blank",rel:"noopener noreferrer"},zn=i(`

    你可以在代码块添加 :v-pre / :no-v-pre 标记来覆盖配置项中的设置。

    注意

    模板语法的字符有可能会被语法高亮器解析,比如 "Mustache" 语法(即双花括号)。因此,就像下面的例子一样,在某些语言中 :no-v-pre 可能并不能生效。

    如果你无论如何都想在这种语言中使用 Vue 语法,你可以尝试禁用默认的语法高亮,然后在客户端实现你的自定义代码高亮。

    输入

    \`\`\`md
    +<!-- 默认情况下,这里会被保持原样 -->
    +
    +1 + 2 + 3 = {{ 1 + 2 + 3 }}
    +\`\`\`
    +
    +\`\`\`md:no-v-pre
    +<!-- 这里会被 Vue 编译 -->
    +1 + 2 + 3 = {{ 1 + 2 + 3 }}
    +\`\`\`
    +
    +\`\`\`js:no-v-pre
    +// 由于 JS 代码高亮,这里不会被正确编译
    +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }}
    +\`\`\`
    +

    输出

    <!-- 默认情况下,这里会被保持原样 -->
    +
    +1 + 2 + 3 = {{ 1 + 2 + 3 }}
    +
    <!-- 这里会被 Vue 编译 -->
    +1 + 2 + 3 = 6
    +
    `,7),En=i(`
    // 由于 JS 代码高亮,这里不会被正确编译
    +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }}
    +
    `,1),Ln={class:"hint-container tip"},Vn=n("p",{class:"hint-container-title"},"提示",-1),Tn=n("p",null,"v-pre 扩展是由我们的内置插件支持的。",-1),Rn=i(`

    导入代码块

    你可以使用下面的语法,从文件中导入代码块:

    <!-- 最简单的语法 -->
    +
    +@[code](../foo.js)
    +

    如果你只想导入这个文件的一部分:

    <!-- 仅导入第 1 行至第 10 行 -->
    +
    +@[code{1-10}](../foo.js)
    +

    代码语言会根据文件扩展名进行推断,但我们建议你显式指定:

    <!-- 指定代码语言 -->
    +
    +@[code js](../foo.js)
    +

    实际上,[] 内的第二部分会被作为代码块标记来处理,因此在上面 代码块 章节中提到的语法在这里都可以支持:

    <!-- 行高亮 -->
    +
    +@[code js{2,4-5}](../foo.js)
    +

    下面是一个复杂的例子:

    • 导入 '../foo.js' 文件的第 3 行至第 10 行
    • 指定语言为 'js'
    • 对导入代码的第 3 行进行高亮,即 '../foo.js' 文件的第 5 行
    • 禁用行号
    @[code{3-10} js{3}:no-line-numbers](../foo.js)
    +

    需要注意的是,路径别名在导入代码语法中不会生效。你可以通过下面的配置来自行处理路径别名:

    import { getDirname, path } from "@vuepress/utils";
    +
    +const __dirname = getDirname(import.meta.url);
    +
    +export default {
    +  markdown: {
    +    importCode: {
    +      handleImportPath: (str) =>
    +        str.replace(/^@src/, path.resolve(__dirname, "path/to/src")),
    +    },
    +  },
    +};
    +
    <!-- 会被解析至 'path/to/src/foo.js' -->
    +
    +@[code](@src/foo.js)
    +
    `,15),Pn={class:"hint-container tip"},An=n("p",{class:"hint-container-title"},"提示",-1),Bn=n("p",null,"导入代码扩展是由我们的内置插件支持的。",-1),Cn=n("h2",{id:"在-markdown-中使用-vue",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#在-markdown-中使用-vue","aria-hidden":"true"},"#"),s(" 在 Markdown 中使用 Vue")],-1),Dn=n("p",null,"这一章节会介绍 Vue 在 Markdown 中一些基本用法。",-1),Hn=n("h3",{id:"模板语法",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#模板语法","aria-hidden":"true"},"#"),s(" 模板语法")],-1),Sn=n("p",null,"我们知道:",-1),Fn=n("ul",null,[n("li",null,"Markdown 中允许使用 HTML。"),n("li",null,"Vue 模板语法是和 HTML 兼容的。")],-1),Nn={href:"https://v3.vuejs.org/guide/template-syntax.html",target:"_blank",rel:"noopener noreferrer"},Un=i(`

    输入

    一加一等于: {{ 1 + 1 }}
    +
    +<span v-for="i in 3"> span: {{ i }} </span>
    +

    输出

    一加一等于: 2

    `,4),On=i('

    组件

    你可以在 Markdown 中直接使用 Vue 组件。

    输入

    这是默认主题内置的 `<Badge />` 组件 <Badge text="演示" />\n

    输出

    ',5),Gn=n("code",null,"",-1),In={class:"hint-container tip"},Jn=n("p",{class:"hint-container-title"},"提示",-1),Wn=n("h2",{id:"注意事项",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#注意事项","aria-hidden":"true"},"#"),s(" 注意事项")],-1),Xn=n("h3",{id:"非标准的-html-标签",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#非标准的-html-标签","aria-hidden":"true"},"#"),s(" 非标准的 HTML 标签")],-1),Yn=n("p",null,"非标准的 HTML 标签不会被 Vue 模板编译器识别成原生 HTML 标签。相反,Vue 会尝试将这些标签解析为 Vue 组件,而显然这些组件通常是不存在的。 例如:",-1),Zn={href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center",target:"_blank",rel:"noopener noreferrer"},$n={href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font",target:"_blank",rel:"noopener noreferrer"},Kn={href:"https://developer.mozilla.org/zh-CN/docs/Web/MathML",target:"_blank",rel:"noopener noreferrer"},Qn=n("p",null,"如果你无论如何都要使用这些标签的话,可以尝试下面两种方法之一:",-1),ns={href:"https://v3.cn.vuejs.org/api/directives.html#v-pre",target:"_blank",rel:"noopener noreferrer"},ss={href:"https://v3.vuejs.org/api/application-config.html#compileroptions",target:"_blank",rel:"noopener noreferrer"},as=n("code",null,"@bundler-webpack",-1),es=n("code",null,"@bundler-vite",-1);function ts(os,ls){const o=p("ExternalLinkIcon"),t=p("RouterLink"),l=p("router-link"),d=p("Badge");return c(),r("div",null,[_,n("p",null,[s("在阅读本章节之前,请确保你已经对 Markdown 有所了解。如果你还不了解 Markdown ,请先学习一些 "),n("a",f,[s("Markdown 教程"),a(o)]),s("。")]),w,n("p",null,[s("VuePress 会使用 "),n("a",x,[s("markdown-it"),a(o)]),s(" 来解析 Markdown 内容,因此可以借助于 markdown-it 插件来实现 "),n("a",q,[s("语法扩展"),a(o)]),s(" 。")]),M,n("p",null,[s("你也可以通过 "),a(t,{to:"/zh/reference/config.html#markdown"},{default:e(()=>[s("markdown")]),_:1}),s(" 和 "),a(t,{to:"/zh/reference/plugin-api.html#extendsmarkdown"},{default:e(()=>[s("extendsMarkdown")]),_:1}),s(" 来配置这些内置扩展、加载更多 markdown-it 插件、实现你自己的扩展等。")]),y,j,n("ul",null,[n("li",null,[n("a",z,[s("表格"),a(o)]),s(" (GFM)")]),n("li",null,[n("a",E,[s("删除线"),a(o)]),s(" (GFM)")])]),L,V,n("div",T,[R,n("p",null,[s("标题锚点扩展由 "),n("a",P,[s("markdown-it-anchor"),a(o)]),s(" 支持。")]),n("p",null,[s("配置参考: "),a(t,{to:"/zh/reference/config.html#markdown-anchor"},{default:e(()=>[s("markdown.anchor")]),_:1})])]),A,n("p",null,[s("在你使用 Markdown 的 "),n("a",B,[s("链接语法"),a(o)]),s(" 时, VuePress 会为你进行一些转换。")]),C,n("p",null,[a(t,{to:"/zh/"},{default:e(()=>[s("首页")]),_:1}),D,a(t,{to:"/zh/reference/config.html"},{default:e(()=>[s("配置参考")]),_:1}),H,a(t,{to:"/zh/guide/getting-started.html"},{default:e(()=>[s("快速上手")]),_:1}),S,a(t,{to:"/zh/guide/"},{default:e(()=>[s("指南")]),_:1}),F,a(t,{to:"/zh/reference/config.html#links"},{default:e(()=>[s("配置参考 > markdown.links")]),_:1}),N,n("a",U,[s("GitHub"),a(o)])]),O,n("ul",null,[G,n("li",null,[s("指向 "),I,s(" 文件的内部链接会被转换为目标页面的 "),a(t,{to:"/zh/guide/page.html#%E8%B7%AF%E7%94%B1"},{default:e(()=>[s("路由路径")]),_:1}),s(",并且支持绝对路径和相对路径。")]),J]),W,X,Y,n("div",Z,[$,K,n("p",null,[s("配置参考: "),a(t,{to:"/zh/reference/config.html#markdown-links"},{default:e(()=>[s("markdown.links")]),_:1})])]),Q,nn,n("p",null,[s("前往 "),n("a",sn,[s("emoji-cheat-sheet"),a(o)]),s(" 来查看所有可用的 Emoji 表情和对应代码。")]),an,en,tn,on,n("div",ln,[pn,n("p",null,[s("Emoji 扩展由 "),n("a",cn,[s("markdown-it-emoji"),a(o)]),s(" 支持。")]),n("p",null,[s("配置参考: "),a(t,{to:"/zh/reference/config.html#markdown-emoji"},{default:e(()=>[s("markdown.emoji")]),_:1})])]),rn,n("nav",dn,[n("ul",null,[n("li",null,[a(l,{to:"#语法扩展"},{default:e(()=>[s("语法扩展")]),_:1}),n("ul",null,[n("li",null,[a(l,{to:"#内置"},{default:e(()=>[s("内置")]),_:1})]),n("li",null,[a(l,{to:"#标题锚点"},{default:e(()=>[s("标题锚点")]),_:1})]),n("li",null,[a(l,{to:"#链接"},{default:e(()=>[s("链接")]),_:1})]),n("li",null,[a(l,{to:"#emoji"},{default:e(()=>[s("Emoji 🎉")]),_:1})]),n("li",null,[a(l,{to:"#目录"},{default:e(()=>[s("目录")]),_:1})]),n("li",null,[a(l,{to:"#代码块"},{default:e(()=>[s("代码块")]),_:1})]),n("li",null,[a(l,{to:"#导入代码块"},{default:e(()=>[s("导入代码块")]),_:1})])])]),n("li",null,[a(l,{to:"#在-markdown-中使用-vue"},{default:e(()=>[s("在 Markdown 中使用 Vue")]),_:1}),n("ul",null,[n("li",null,[a(l,{to:"#模板语法"},{default:e(()=>[s("模板语法")]),_:1})]),n("li",null,[a(l,{to:"#组件"},{default:e(()=>[s("组件")]),_:1})])])]),n("li",null,[a(l,{to:"#注意事项"},{default:e(()=>[s("注意事项")]),_:1}),n("ul",null,[n("li",null,[a(l,{to:"#非标准的-html-标签"},{default:e(()=>[s("非标准的 HTML 标签")]),_:1})])])])])]),un,n("div",kn,[mn,n("p",null,[s("目录扩展由 "),n("a",vn,[s("@mdit-vue/plugin-toc"),a(o)]),s(" 支持。")]),n("p",null,[s("配置参考: "),a(t,{to:"/zh/reference/config.html#markdown-toc"},{default:e(()=>[s("markdown.toc")]),_:1})])]),hn,n("div",gn,[bn,n("p",null,[s("行高亮扩展是由我们的内置插件支持的,该扩展 Fork 并修改自 "),n("a",_n,[s("markdown-it-highlight-lines"),a(o)]),s("。")]),n("p",null,[s("配置参考: "),a(t,{to:"/zh/reference/config.html#markdown-code-highlightlines"},{default:e(()=>[s("markdown.code.highlightLines")]),_:1})])]),fn,n("div",wn,[xn,qn,n("p",null,[s("配置参考: "),a(t,{to:"/zh/reference/config.html#markdown-code-linenumbers"},{default:e(()=>[s("markdown.code.lineNumbers")]),_:1})])]),Mn,yn,n("p",null,[s("为了避免你的代码块被 Vue 编译, VuePress 默认会在你的代码块添加 "),n("a",jn,[s("v-pre"),a(o)]),s(" 指令。这一默认行为可以在配置中关闭。")]),zn,m(` +在 JS 代码块上使用 :no-v-pre 的话,会在使用 shiki 时遇到一些潜在的问题,所以这里 +我们实际上没有使用 :no-v-pre ,只是作为一个错误用法的示例。 +`),En,n("div",Ln,[Vn,Tn,n("p",null,[s("配置参考: "),a(t,{to:"/zh/reference/config.html#markdown-code-vpre-block"},{default:e(()=>[s("markdown.code.vPre.block")]),_:1})])]),Rn,n("div",Pn,[An,Bn,n("p",null,[s("配置参考: "),a(t,{to:"/zh/reference/config.html#markdown-importcode"},{default:e(()=>[s("markdown.importCode")]),_:1})])]),Cn,Dn,n("p",null,[s("可以前往 "),a(t,{to:"/zh/advanced/cookbook/markdown-and-vue-sfc.html"},{default:e(()=>[s("Cookbook > Markdown 和 Vue SFC")]),_:1}),s(" 来了解更多内容。")]),Hn,Sn,Fn,n("p",null,[s("这意味着, Markdown 中允许直接使用 "),n("a",Nn,[s("Vue 模板语法"),a(o)]),s("。")]),Un,n("p",null,[(c(),r(v,null,h(3,u=>n("span",null," span: "+g(u),1)),64))]),On,n("p",null,[s("这是默认主题内置的 "),Gn,s(" 组件 "),a(d,{text:"演示"})]),n("div",In,[Jn,n("p",null,[s("前往 "),a(t,{to:"/zh/reference/components.html"},{default:e(()=>[s("内置组件")]),_:1}),s(" 查看所有内置组件。")]),n("p",null,[s("前往 "),a(t,{to:"/zh/reference/default-theme/components.html"},{default:e(()=>[s("默认主题 > 内置组件")]),_:1}),s(" 查看默认主题中的所有内置组件。")])]),Wn,Xn,Yn,n("ul",null,[n("li",null,[s("已废弃的 HTML 标签,比如 "),n("a",Zn,[s("
    "),a(o)]),s(" 和 "),n("a",$n,[s(""),a(o)]),s(" 等。")]),n("li",null,[n("a",Kn,[s("MathML 标签"),a(o)]),s(",它们可能会被一些 markdown-it 的 LaTeX 插件用到。")])]),Qn,n("ul",null,[n("li",null,[s("添加一个 "),n("a",ns,[s("v-pre"),a(o)]),s(" 指令来跳过这个元素和它的子元素的编译过程。注意所有的模板语法也都会失效。")]),n("li",null,[s("设置 "),n("a",ss,[s("compilerOptions.isCustomElement"),a(o)]),s(" 来告诉 Vue 模板编译器不要尝试作为组件来解析它们。 "),n("ul",null,[n("li",null,[s("对于 "),as,s(" ,设置 "),a(t,{to:"/zh/reference/bundler/webpack.html#vue"},{default:e(()=>[s("vue.compilerOptions")]),_:1})]),n("li",null,[s("对于 "),es,s(" ,设置 "),a(t,{to:"/zh/reference/bundler/vite.html#vuepluginoptions"},{default:e(()=>[s("vuePluginOptions.template.compilerOptions")]),_:1})])])])])])}const ps=k(b,[["render",ts],["__file","markdown.html.vue"]]);export{ps as default}; diff --git a/assets/markdown.html-c9777236.js b/assets/markdown.html-c9777236.js new file mode 100644 index 00000000..4dfaf5d2 --- /dev/null +++ b/assets/markdown.html-c9777236.js @@ -0,0 +1,130 @@ +import{_ as m,W as c,X as r,$ as n,a0 as s,Y as e,Z as a,a2 as k,a3 as h,a4 as g,a1 as i,D as p,a5 as v}from"./framework-46b0e263.js";const b={},f=n("h1",{id:"markdown",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown","aria-hidden":"true"},"#"),s(" Markdown")],-1),_={href:"https://commonmark.org/help/",target:"_blank",rel:"noopener noreferrer"},w=n("h2",{id:"syntax-extensions",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#syntax-extensions","aria-hidden":"true"},"#"),s(" Syntax Extensions")],-1),y={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},x={href:"https://github.com/markdown-it/markdown-it#syntax-extensions",target:"_blank",rel:"noopener noreferrer"},T=n("p",null,"This section will introduce built-in Markdown syntax extensions of VuePress.",-1),C=n("h3",{id:"embedded",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#embedded","aria-hidden":"true"},"#"),s(" Embedded")],-1),q=n("p",null,"Embedded by markdown-it:",-1),j={href:"https://help.github.com/articles/organizing-information-with-tables/",target:"_blank",rel:"noopener noreferrer"},M={href:"https://help.github.com/articles/basic-writing-and-formatting-syntax/#styling-text",target:"_blank",rel:"noopener noreferrer"},L=n("h3",{id:"header-anchors",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#header-anchors","aria-hidden":"true"},"#"),s(" Header Anchors")],-1),R=n("p",null,[s("You might have noticed that, a "),n("code",null,"#"),s(" anchor is displayed when you hover the mouse on the headers of each section. By clicking the "),n("code",null,"#"),s(" anchor, you can jump to the section directly.")],-1),V={class:"hint-container tip"},E=n("p",{class:"hint-container-title"},"Tips",-1),H={href:"https://github.com/valeriangalliat/markdown-it-anchor",target:"_blank",rel:"noopener noreferrer"},I=n("h3",{id:"links",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#links","aria-hidden":"true"},"#"),s(" Links")],-1),S={href:"https://spec.commonmark.org/0.29/#link-reference-definitions",target:"_blank",rel:"noopener noreferrer"},O=i(`

    Take our documentation source files as an example:

    └─ docs
    +   ├─ guide
    +   │  ├─ getting-started.md
    +   │  ├─ markdown.md    # <- Here we are
    +   │  └─ README.md
    +   ├─ reference
    +   │  └─ config.md
    +   └─ README.md
    +

    Raw Markdown

    <!-- relative path -->
    +
    +[Home](../README.md)  
    +[Config Reference](../reference/config.md)  
    +[Getting Started](./getting-started.md)
    +
    +<!-- absolute path -->
    +
    +[Guide](/guide/README.md)  
    +[Config Reference > markdown.links](/reference/config.md#links)
    +
    +<!-- URL -->
    +
    +[GitHub](https://github.com)
    +

    Converted to

    <template>
    +  <RouterLink to="/">Home</RouterLink>
    +  <RouterLink to="/reference/config.html">Config Reference</RouterLink>
    +  <RouterLink to="/guide/getting-started.html">Getting Started</RouterLink>
    +  <RouterLink to="/guide/">Guide</RouterLink>
    +  <RouterLink to="/reference/config.html#links"
    +    >Config Reference &gt; markdown.links</RouterLink
    +  >
    +  <a href="https://github.com" target="_blank" rel="noopener noreferrer"
    +    >GitHub</a
    +  >
    +</template>
    +

    Rendered as

    `,7),B=n("br",null,null,-1),P=n("br",null,null,-1),N=n("br",null,null,-1),D=n("br",null,null,-1),G=n("br",null,null,-1),U={href:"https://github.com",target:"_blank",rel:"noopener noreferrer"},Y=n("p",null,[n("strong",null,"Explanation")],-1),A=n("li",null,[s("Internal links will be converted to "),n("code",null,""),s(" for SPA navigation.")],-1),F=n("code",null,".md",-1),W=n("li",null,[s("External links will get "),n("code",null,'target="_blank" rel="noopener noreferrer"'),s(" attrs.")],-1),z=n("p",null,[n("strong",null,"Suggestion")],-1),J=n("p",null,"Try to use relative paths instead of absolute paths for internal links to markdown files.",-1),X=n("ul",null,[n("li",null,"Relative paths are a valid links to the target files, and they can navigate correctly when browsing the source files in your editor or repository."),n("li",null,"Relative paths are consistent in different locales, so you don't need to change the locale path when translating your content.")],-1),Z={class:"hint-container tip"},$=n("p",{class:"hint-container-title"},"Tips",-1),K=n("p",null,"This links extension is supported by our built-in plugin.",-1),Q=n("h3",{id:"emoji",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#emoji","aria-hidden":"true"},"#"),s(" Emoji 🎉")],-1),nn=n("p",null,[s("You can add emoji to your Markdown content by typing "),n("code",null,":EMOJICODE:"),s(".")],-1),sn={href:"https://github.com/ikatyang/emoji-cheat-sheet",target:"_blank",rel:"noopener noreferrer"},en=n("p",null,[n("strong",null,"Input")],-1),an=n("div",{class:"language-markdown line-numbers-mode","data-ext":"md"},[n("pre",{class:"language-markdown"},[n("code",null,`VuePress 2 is out :tada: ! +`)]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"})])],-1),tn=n("p",null,[n("strong",null,"Output")],-1),on=n("p",null,"VuePress 2 is out 🎉 !",-1),ln={class:"hint-container tip"},pn=n("p",{class:"hint-container-title"},"Tips",-1),cn={href:"https://github.com/markdown-it/markdown-it-emoji",target:"_blank",rel:"noopener noreferrer"},rn=i(`

    Table of Contents

    If you want to put the table of contents (TOC) of your current page inside your Markdown content, you can use the [[toc]] syntax.

    Input

    [[toc]]
    +

    Output

    `,5),dn={class:"table-of-contents"},un=n("p",null,[s("The headers in TOC will link to the corresponding "),n("a",{href:"#header-anchors"},"header anchors"),s(", so TOC won't work well if you disable header anchors.")],-1),mn={class:"hint-container tip"},kn=n("p",{class:"hint-container-title"},"Tips",-1),hn={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc",target:"_blank",rel:"noopener noreferrer"},gn=i(`

    Code Blocks

    Following code blocks extensions are implemented during markdown parsing in Node side. That means, the code blocks won't be processed in client side.

    Line Highlighting

    You can highlight specified lines of your code blocks by adding line ranges mark in your fenced code blocks:

    Input

    \`\`\`ts{1,6-8}
    +import { defaultTheme, defineUserConfig } from 'vuepress'
    +
    +export default defineUserConfig({
    +  title: 'Hello, VuePress',
    +
    +  theme: defaultTheme({
    +    logo: 'https://vuejs.org/images/logo.png',
    +  }),
    +})
    +\`\`\`
    +

    Output

    import { defaultTheme, defineUserConfig } from 'vuepress'
    +
    +export default defineUserConfig({
    +  title: 'Hello, VuePress',
    +
    +  theme: defaultTheme({
    +    logo: 'https://vuejs.org/images/logo.png',
    +  }),
    +})
    +
     




     
     
     

    Examples for line ranges mark:

    • Line ranges: {5-8}
    • Multiple single lines: {4,7,9}
    • Combined: {4,7-13,16,23-27,40}
    `,10),vn={class:"hint-container tip"},bn=n("p",{class:"hint-container-title"},"Tips",-1),fn={href:"https://github.com/egoist/markdown-it-highlight-lines",target:"_blank",rel:"noopener noreferrer"},_n=i(`

    Line Numbers

    You must have noticed that the number of lines is displayed on the left side of code blocks. This is enabled by default and you can disable it in config.

    You can add :line-numbers / :no-line-numbers mark in your fenced code blocks to override the value set in config.

    Input

    \`\`\`ts
    +// line-numbers is enabled by default
    +const line2 = "This is line 2";
    +const line3 = "This is line 3";
    +\`\`\`
    +
    +\`\`\`ts:no-line-numbers
    +// line-numbers is disabled
    +const line2 = 'This is line 2'
    +const line3 = 'This is line 3'
    +\`\`\`
    +

    Output

    // line-numbers is enabled by default
    +const line2 = "This is line 2";
    +const line3 = "This is line 3";
    +
    // line-numbers is disabled
    +const line2 = 'This is line 2'
    +const line3 = 'This is line 3'
    +
    `,8),wn={class:"hint-container tip"},yn=n("p",{class:"hint-container-title"},"Tips",-1),xn=n("p",null,"This line numbers extension is supported by our built-in plugin.",-1),Tn=n("h4",{id:"wrap-with-v-pre",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#wrap-with-v-pre","aria-hidden":"true"},"#"),s(" Wrap with v-pre")],-1),Cn=n("p",null,[s("As "),n("a",{href:"#template-syntax"},"template syntax is allowed in Markdown"),s(", it would also work in code blocks, too.")],-1),qn={href:"https://vuejs.org/api/built-in-directives.html#v-pre",target:"_blank",rel:"noopener noreferrer"},jn=i(`

    You can add :v-pre / :no-v-pre mark in your fenced code blocks to override the value set in config.

    Note

    The template syntax characters, for example, the "Mustache" syntax (double curly braces) might be parsed by the syntax highlighter. Thus, as the following example, :no-v-pre might not work well in some languages.

    If you want to make Vue syntax work in those languages anyway, try to disable the default syntax highlighting and implement your own syntax highlighting in client side.

    Input

    \`\`\`md
    +<!-- This will be kept as is by default -->
    +
    +1 + 2 + 3 = {{ 1 + 2 + 3 }}
    +\`\`\`
    +
    +\`\`\`md:no-v-pre
    +<!-- This will be compiled by Vue -->
    +1 + 2 + 3 = {{ 1 + 2 + 3 }}
    +\`\`\`
    +
    +\`\`\`js:no-v-pre
    +// This won't be compiled correctly because of js syntax highlighting
    +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }}
    +\`\`\`
    +

    Output

    <!-- This will be kept as is -->
    +
    +1 + 2 + 3 = {{ 1 + 2 + 3 }}
    +
    <!-- This will be compiled by Vue -->
    +1 + 2 + 3 = 6
    +
    `,7),Mn=i(`
    // This won't be compiled correctly because of js syntax highlighting
    +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }}
    +
    `,1),Ln={class:"hint-container tip"},Rn=n("p",{class:"hint-container-title"},"Tips",-1),Vn=n("p",null,"This v-pre extension is supported by our built-in plugin.",-1),En=i(`

    Import Code Blocks

    You can import code blocks from files with following syntax:

    <!-- minimal syntax -->
    +
    +@[code](../foo.js)
    +

    If you want to partially import the file:

    <!-- partial import, from line 1 to line 10 -->
    +
    +@[code{1-10}](../foo.js)
    +

    The code language is inferred from the file extension, while it is recommended to specify it explicitly:

    <!-- specify the code language -->
    +
    +@[code js](../foo.js)
    +

    In fact, the second part inside the [] will be treated as the mark of the code fence, so it supports all the syntax mentioned in the above Code Blocks section:

    <!-- line highlighting -->
    +
    +@[code js{2,4-5}](../foo.js)
    +

    Here is a complex example:

    • import line 3 to line 10 of the '../foo.js' file
    • specify the language as 'js'
    • highlight line 3 of the imported code, i.e. line 5 of the '../foo.js' file
    • disable line numbers
    @[code{3-10} js{3}:no-line-numbers](../foo.js)
    +

    Notice that path aliases are not available in import code syntax. You can use following config to handle path alias yourself:

    import { getDirname, path } from "@vuepress/utils";
    +
    +const __dirname = getDirname(import.meta.url);
    +
    +export default {
    +  markdown: {
    +    importCode: {
    +      handleImportPath: (str) =>
    +        str.replace(/^@src/, path.resolve(__dirname, "path/to/src")),
    +    },
    +  },
    +};
    +
    <!-- it will be resolved to 'path/to/src/foo.js' -->
    +
    +@[code](@src/foo.js)
    +
    `,15),Hn={class:"hint-container tip"},In=n("p",{class:"hint-container-title"},"Tips",-1),Sn=n("p",null,"This import code extension is supported by our built-in plugin.",-1),On=n("h2",{id:"using-vue-in-markdown",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#using-vue-in-markdown","aria-hidden":"true"},"#"),s(" Using Vue in Markdown")],-1),Bn=n("p",null,"This section will introduce some basic usage of Vue in Markdown.",-1),Pn=n("h3",{id:"template-syntax",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#template-syntax","aria-hidden":"true"},"#"),s(" Template Syntax")],-1),Nn=n("p",null,"As we know:",-1),Dn=n("ul",null,[n("li",null,"HTML is allowed in Markdown."),n("li",null,"Vue template syntax is compatible with HTML.")],-1),Gn={href:"https://vuejs.org/guide/essentials/template-syntax.html",target:"_blank",rel:"noopener noreferrer"},Un=i(`

    Input

    One plus one equals: {{ 1 + 1 }}
    +
    +<span v-for="i in 3"> span: {{ i }} </span>
    +

    Output

    One plus one equals: 2

    `,4),Yn=i('

    Components

    You can use Vue components directly in Markdown.

    Input

    This is default theme built-in `<Badge />` component <Badge text="demo" />\n

    Output

    ',5),An=n("code",null,"",-1),Fn={class:"hint-container tip"},Wn=n("p",{class:"hint-container-title"},"Tips",-1),zn=n("h2",{id:"cautions",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#cautions","aria-hidden":"true"},"#"),s(" Cautions")],-1),Jn=n("h3",{id:"non-standard-html-tags",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#non-standard-html-tags","aria-hidden":"true"},"#"),s(" Non-Standard HTML Tags")],-1),Xn=n("p",null,"Non-standard HTML tags would not be recognized as native HTML tags by Vue template compiler. Instead, Vue will try to resolve those tags as Vue components, and obviously these components usually don't exist. For example:",-1),Zn={href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center",target:"_blank",rel:"noopener noreferrer"},$n={href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font",target:"_blank",rel:"noopener noreferrer"},Kn={href:"https://developer.mozilla.org/en-US/docs/Web/MathML",target:"_blank",rel:"noopener noreferrer"},Qn=n("p",null,"If you want to use those tags anyway, try either of the following workarounds:",-1),ns={href:"https://vuejs.org/api/built-in-directives.html#v-pre",target:"_blank",rel:"noopener noreferrer"},ss={href:"https://vuejs.org/api/application.html#app-config-compileroptions",target:"_blank",rel:"noopener noreferrer"},es=n("code",null,"@bundler-webpack",-1),as=n("code",null,"@bundler-vite",-1);function ts(os,ls){const o=p("ExternalLinkIcon"),t=p("RouterLink"),l=p("router-link"),d=p("Badge");return c(),r("div",null,[f,n("p",null,[s("Make sure you already know Markdown well before reading this section. If not, please learn some "),n("a",_,[s("Markdown tutorials"),e(o)]),s(" first.")]),w,n("p",null,[s("The Markdown content in VuePress will be parsed by "),n("a",y,[s("markdown-it"),e(o)]),s(", which supports "),n("a",x,[s("syntax extensions"),e(o)]),s(" via markdown-it plugins.")]),T,n("p",null,[s("You can also configure those built-in extensions, load more markdown-it plugins and implement your own extensions via "),e(t,{to:"/reference/config.html#markdown"},{default:a(()=>[s("markdown")]),_:1}),s(" option and "),e(t,{to:"/reference/plugin-api.html#extendsmarkdown"},{default:a(()=>[s("extendsMarkdown")]),_:1}),s(" option.")]),C,q,n("ul",null,[n("li",null,[n("a",j,[s("Tables"),e(o)]),s(" (GFM)")]),n("li",null,[n("a",M,[s("Strikethrough"),e(o)]),s(" (GFM)")])]),L,R,n("div",V,[E,n("p",null,[s("This header anchors extension is supported by "),n("a",H,[s("markdown-it-anchor"),e(o)]),s(".")]),n("p",null,[s("Config reference: "),e(t,{to:"/reference/config.html#markdown-anchor"},{default:a(()=>[s("markdown.anchor")]),_:1})])]),I,n("p",null,[s("When using Markdown "),n("a",S,[s("link syntax"),e(o)]),s(", VuePress will implement some conversions for you.")]),O,n("p",null,[e(t,{to:"/"},{default:a(()=>[s("Home")]),_:1}),B,e(t,{to:"/reference/config.html"},{default:a(()=>[s("Config Reference")]),_:1}),P,e(t,{to:"/guide/getting-started.html"},{default:a(()=>[s("Getting Started")]),_:1}),N,e(t,{to:"/guide/"},{default:a(()=>[s("Guide")]),_:1}),D,e(t,{to:"/reference/config.html#links"},{default:a(()=>[s("Config Reference > markdown.links")]),_:1}),G,n("a",U,[s("GitHub"),e(o)])]),Y,n("ul",null,[A,n("li",null,[s("Internal links to "),F,s(" files will be converted to the "),e(t,{to:"/guide/page.html#routing"},{default:a(()=>[s("page route path")]),_:1}),s(", and both absolute path and relative path are supported.")]),W]),z,J,X,n("div",Z,[$,K,n("p",null,[s("Config reference: "),e(t,{to:"/reference/config.html#markdown-links"},{default:a(()=>[s("markdown.links")]),_:1})])]),Q,nn,n("p",null,[s("For a full list of available emoji and codes, check out "),n("a",sn,[s("emoji-cheat-sheet"),e(o)]),s(".")]),en,an,tn,on,n("div",ln,[pn,n("p",null,[s("This emoji extension is supported by "),n("a",cn,[s("markdown-it-emoji"),e(o)]),s(".")]),n("p",null,[s("Config reference: "),e(t,{to:"/reference/config.html#markdown-emoji"},{default:a(()=>[s("markdown.emoji")]),_:1})])]),rn,n("nav",dn,[n("ul",null,[n("li",null,[e(l,{to:"#syntax-extensions"},{default:a(()=>[s("Syntax Extensions")]),_:1}),n("ul",null,[n("li",null,[e(l,{to:"#embedded"},{default:a(()=>[s("Embedded")]),_:1})]),n("li",null,[e(l,{to:"#header-anchors"},{default:a(()=>[s("Header Anchors")]),_:1})]),n("li",null,[e(l,{to:"#links"},{default:a(()=>[s("Links")]),_:1})]),n("li",null,[e(l,{to:"#emoji"},{default:a(()=>[s("Emoji 🎉")]),_:1})]),n("li",null,[e(l,{to:"#table-of-contents"},{default:a(()=>[s("Table of Contents")]),_:1})]),n("li",null,[e(l,{to:"#code-blocks"},{default:a(()=>[s("Code Blocks")]),_:1})]),n("li",null,[e(l,{to:"#import-code-blocks"},{default:a(()=>[s("Import Code Blocks")]),_:1})])])]),n("li",null,[e(l,{to:"#using-vue-in-markdown"},{default:a(()=>[s("Using Vue in Markdown")]),_:1}),n("ul",null,[n("li",null,[e(l,{to:"#template-syntax"},{default:a(()=>[s("Template Syntax")]),_:1})]),n("li",null,[e(l,{to:"#components"},{default:a(()=>[s("Components")]),_:1})])])]),n("li",null,[e(l,{to:"#cautions"},{default:a(()=>[s("Cautions")]),_:1}),n("ul",null,[n("li",null,[e(l,{to:"#non-standard-html-tags"},{default:a(()=>[s("Non-Standard HTML Tags")]),_:1})])])])])]),un,n("div",mn,[kn,n("p",null,[s("This toc extension is supported by "),n("a",hn,[s("@mdit-vue/plugin-toc"),e(o)]),s(".")]),n("p",null,[s("Config reference: "),e(t,{to:"/reference/config.html#markdown-toc"},{default:a(()=>[s("markdown.toc")]),_:1})])]),gn,n("div",vn,[bn,n("p",null,[s("This line highlighting extension is supported by our built-in plugin, which is forked and modified from "),n("a",fn,[s("markdown-it-highlight-lines"),e(o)]),s(".")]),n("p",null,[s("Config reference: "),e(t,{to:"/reference/config.html#markdown-code-highlightlines"},{default:a(()=>[s("markdown.code.highlightLines")]),_:1})])]),_n,n("div",wn,[yn,xn,n("p",null,[s("Config reference: "),e(t,{to:"/reference/config.html#markdown-code-linenumbers"},{default:a(()=>[s("markdown.code.lineNumbers")]),_:1})])]),Tn,Cn,n("p",null,[s("To avoid your code blocks being compiled by Vue, VuePress will add "),n("a",qn,[s("v-pre"),e(o)]),s(" directive to your code blocks by default, which can be disabled in config.")]),jn,k(` +using :no-v-pre on JS code blocks has potential issue with shiki, so we are +not actually using :no-v-pre here, just as an example of incorrect usage +`),Mn,n("div",Ln,[Rn,Vn,n("p",null,[s("Config reference: "),e(t,{to:"/reference/config.html#markdown-code-vpre-block"},{default:a(()=>[s("markdown.code.vPre.block")]),_:1})])]),En,n("div",Hn,[In,Sn,n("p",null,[s("Config reference: "),e(t,{to:"/reference/config.html#markdown-importcode"},{default:a(()=>[s("markdown.importCode")]),_:1})])]),On,Bn,n("p",null,[s("Check out "),e(t,{to:"/advanced/cookbook/markdown-and-vue-sfc.html"},{default:a(()=>[s("Cookbook > Markdown and Vue SFC")]),_:1}),s(" for more details.")]),Pn,Nn,Dn,n("p",null,[s("That means, "),n("a",Gn,[s("Vue template syntax"),e(o)]),s(" is allowed in Markdown.")]),Un,n("p",null,[(c(),r(h,null,g(3,u=>n("span",null," span: "+v(u),1)),64))]),Yn,n("p",null,[s("This is default theme built-in "),An,s(" component "),e(d,{text:"demo"})]),n("div",Fn,[Wn,n("p",null,[s("Check out the "),e(t,{to:"/reference/components.html"},{default:a(()=>[s("Built-in Components")]),_:1}),s(" for a full list of built-in components.")]),n("p",null,[s("Check out the "),e(t,{to:"/reference/default-theme/components.html"},{default:a(()=>[s("Default Theme > Built-in Components")]),_:1}),s(" for a full list of default theme built-in components.")])]),zn,Jn,Xn,n("ul",null,[n("li",null,[s("Deprecated HTML tags such as "),n("a",Zn,[s("
    "),e(o)]),s(" and "),n("a",$n,[s(""),e(o)]),s(".")]),n("li",null,[n("a",Kn,[s("MathML tags"),e(o)]),s(", which might be used by some markdown-it LaTeX plugin.")])]),Qn,n("ul",null,[n("li",null,[s("Adding a "),n("a",ns,[s("v-pre"),e(o)]),s(" directive to skip the compilation of the element and its children. Notice that the template syntax would also be invalid.")]),n("li",null,[s("Using "),n("a",ss,[s("compilerOptions.isCustomElement"),e(o)]),s(" to tell Vue template compiler not try to resolve them as components. "),n("ul",null,[n("li",null,[s("For "),es,s(", set "),e(t,{to:"/reference/bundler/webpack.html#vue"},{default:a(()=>[s("vue.compilerOptions")]),_:1})]),n("li",null,[s("For "),as,s(", set "),e(t,{to:"/reference/bundler/vite.html#vuepluginoptions"},{default:a(()=>[s("vuePluginOptions.template.compilerOptions")]),_:1})])])])])])}const ps=m(b,[["render",ts],["__file","markdown.html.vue"]]);export{ps as default}; diff --git a/assets/markdown.html-daca0316.js b/assets/markdown.html-daca0316.js new file mode 100644 index 00000000..efad1b81 --- /dev/null +++ b/assets/markdown.html-daca0316.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0978b044","path":"/guide/markdown.html","title":"Markdown","lang":"en-US","frontmatter":{"icon":"fa6-brands:markdown","description":"Make sure you already know Markdown well before reading this section. If not, please learn some Markdown tutorials (https://commonmark.org/help/) first. Syntax Extensions The Ma...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/guide/markdown.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/guide/markdown.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Markdown"}],["meta",{"property":"og:description","content":"Make sure you already know Markdown well before reading this section. If not, please learn some Markdown tutorials (https://commonmark.org/help/) first. Syntax Extensions The 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":"2023-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Markdown\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Syntax Extensions","slug":"syntax-extensions","link":"#syntax-extensions","children":[{"level":3,"title":"Embedded","slug":"embedded","link":"#embedded","children":[]},{"level":3,"title":"Header Anchors","slug":"header-anchors","link":"#header-anchors","children":[]},{"level":3,"title":"Links","slug":"links","link":"#links","children":[]},{"level":3,"title":"Emoji 🎉","slug":"emoji","link":"#emoji","children":[]},{"level":3,"title":"Table of Contents","slug":"table-of-contents","link":"#table-of-contents","children":[]},{"level":3,"title":"Code Blocks","slug":"code-blocks","link":"#code-blocks","children":[]},{"level":3,"title":"Import Code Blocks","slug":"import-code-blocks","link":"#import-code-blocks","children":[]}]},{"level":2,"title":"Using Vue in Markdown","slug":"using-vue-in-markdown","link":"#using-vue-in-markdown","children":[{"level":3,"title":"Template Syntax","slug":"template-syntax","link":"#template-syntax","children":[]},{"level":3,"title":"Components","slug":"components","link":"#components","children":[]}]},{"level":2,"title":"Cautions","slug":"cautions","link":"#cautions","children":[{"level":3,"title":"Non-Standard HTML Tags","slug":"non-standard-html-tags","link":"#non-standard-html-tags","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":6.08,"words":1825},"filePathRelative":"guide/markdown.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/markdown.html-f0b871b8.js b/assets/markdown.html-f0b871b8.js new file mode 100644 index 00000000..48019c88 --- /dev/null +++ b/assets/markdown.html-f0b871b8.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6a0a3d62","path":"/zh/guide/markdown.html","title":"Markdown","lang":"zh-CN","frontmatter":{"icon":"fa6-brands:markdown","description":"在阅读本章节之前,请确保你已经对 Markdown 有所了解。如果你还不了解 Markdown ,请先学习一些 Markdown 教程 (https://commonmark.org/help/)。 语法扩展 VuePress 会使用 markdown-it (https://github.com/markdown-it/markdown-it) 来解...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/guide/markdown.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/guide/markdown.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Markdown"}],["meta",{"property":"og:description","content":"在阅读本章节之前,请确保你已经对 Markdown 有所了解。如果你还不了解 Markdown ,请先学习一些 Markdown 教程 (https://commonmark.org/help/)。 语法扩展 VuePress 会使用 markdown-it (https://github.com/markdown-it/markdown-it) 来解..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Markdown\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"语法扩展","slug":"语法扩展","link":"#语法扩展","children":[{"level":3,"title":"内置","slug":"内置","link":"#内置","children":[]},{"level":3,"title":"标题锚点","slug":"标题锚点","link":"#标题锚点","children":[]},{"level":3,"title":"链接","slug":"链接","link":"#链接","children":[]},{"level":3,"title":"Emoji 🎉","slug":"emoji","link":"#emoji","children":[]},{"level":3,"title":"目录","slug":"目录","link":"#目录","children":[]},{"level":3,"title":"代码块","slug":"代码块","link":"#代码块","children":[]},{"level":3,"title":"导入代码块","slug":"导入代码块","link":"#导入代码块","children":[]}]},{"level":2,"title":"在 Markdown 中使用 Vue","slug":"在-markdown-中使用-vue","link":"#在-markdown-中使用-vue","children":[{"level":3,"title":"模板语法","slug":"模板语法","link":"#模板语法","children":[]},{"level":3,"title":"组件","slug":"组件","link":"#组件","children":[]}]},{"level":2,"title":"注意事项","slug":"注意事项","link":"#注意事项","children":[{"level":3,"title":"非标准的 HTML 标签","slug":"非标准的-html-标签","link":"#非标准的-html-标签","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":8.43,"words":2530},"filePathRelative":"zh/guide/markdown.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/markdown.html-f26fa0b6.js b/assets/markdown.html-f26fa0b6.js new file mode 100644 index 00000000..c479605b --- /dev/null +++ b/assets/markdown.html-f26fa0b6.js @@ -0,0 +1,59 @@ +import{_ as p,W as v,X as m,Y as e,$ as n,Z as a,a0 as s,a1 as t,D as i}from"./framework-46b0e263.js";const b={},g=n("h1",{id:"markdown",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown","aria-hidden":"true"},"#"),s(" Markdown")],-1),k=n("h2",{id:"自定义容器",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#自定义容器","aria-hidden":"true"},"#"),s(" 自定义容器")],-1),h=t(`

    使用:

    ::: <type> [title]
    +[content]
    +:::
    +

    type 是必需的, titlecontent 是可选的。

    支持的 type 有:

    `,4),_=n("li",null,[n("code",null,"tip")],-1),f=n("li",null,[n("code",null,"warning")],-1),w=n("li",null,[n("code",null,"danger")],-1),y=n("li",null,[n("code",null,"details")],-1),x=n("ul",null,[n("li",null,[n("code",null,"code-group")]),n("li",null,[n("code",null,"code-group-item")])],-1),q=n("li",null,[n("p",null,"示例 1 (默认标题):")],-1),B=t(`

    输入

    ::: tip
    +
    +这是一个提示
    +
    +:::
    +
    +::: warning
    +
    +这是一个警告
    +
    +:::
    +
    +::: danger
    +
    +这是一个危险警告
    +
    +:::
    +
    +::: details
    +这是一个 details 标签
    +
    +:::
    +

    输出

    提示

    这是一个提示

    注意

    这是一个警告

    警告

    这是一个危险警告

    详情

    这是一个 details 标签

    • 示例 2 (自定义标题):

    输入

    ::: danger STOP
    +危险区域,禁止通行
    +
    +:::
    +
    +::: details 点击查看代码
    +
    +\`\`\`ts
    +console.log("你好,VuePress!");
    +\`\`\`
    +
    +:::
    +

    输出

    STOP

    危险区域,禁止通行

    点击查看代码
    console.log("你好,VuePress!");
    +
    • 示例 3 (Code Group 别名):

    输入

    :::: code-group
    +::: code-group-item FOO
    +
    +\`\`\`ts
    +const foo = "foo";
    +\`\`\`
    +
    +:::
    +
    +::: code-group-item BAR
    +
    +\`\`\`ts
    +const bar = "bar";
    +\`\`\`
    +
    +:::
    +
    +::::
    +

    输出

    `,17),C=n("div",{class:"language-typescript line-numbers-mode","data-ext":"ts"},[n("pre",{class:"language-typescript"},[n("code",null,[n("span",{class:"token keyword"},"const"),s(" foo "),n("span",{class:"token operator"},"="),s(),n("span",{class:"token string"},'"foo"'),n("span",{class:"token punctuation"},";"),s(` +`)])]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"})])],-1),N=n("div",{class:"language-typescript line-numbers-mode","data-ext":"ts"},[n("pre",{class:"language-typescript"},[n("code",null,[n("span",{class:"token keyword"},"const"),s(" bar "),n("span",{class:"token operator"},"="),s(),n("span",{class:"token string"},'"bar"'),n("span",{class:"token punctuation"},";"),s(` +`)])]),n("div",{class:"line-numbers","aria-hidden":"true"},[n("div",{class:"line-number"})])],-1);function O(V,T){const d=i("NpmBadge"),l=i("RouterLink"),c=i("CodeTabs");return v(),m("div",null,[g,e(d,{package:"@vuepress/theme-default"}),k,n("ul",null,[n("li",null,[h,n("ul",null,[_,f,w,y,n("li",null,[e(l,{to:"/zh/reference/default-theme/components.html#codegroup"},{default:a(()=>[s("CodeGroup")]),_:1}),s(" 和 "),e(l,{to:"/zh/reference/default-theme/components.html#codegroupitem"},{default:a(()=>[s("CodeGroupItem")]),_:1}),s(" 的别名: "),x])])]),q]),B,e(c,{id:"129",data:[{title:"FOO"},{title:"BAR"}]},{tab0:a(({title:o,value:r,isActive:u})=>[C]),tab1:a(({title:o,value:r,isActive:u})=>[N]),_:1})])}const P=p(b,[["render",O],["__file","markdown.html.vue"]]);export{P as default}; diff --git a/assets/medium-zoom.html-7c5262ed.js b/assets/medium-zoom.html-7c5262ed.js new file mode 100644 index 00000000..9181e18d --- /dev/null +++ b/assets/medium-zoom.html-7c5262ed.js @@ -0,0 +1,26 @@ +import{_ as p,W as l,X as c,Y as a,$ as n,a0 as s,a1 as o,D as t}from"./framework-46b0e263.js";const u={},d=n("h1",{id:"medium-zoom",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#medium-zoom","aria-hidden":"true"},"#"),s(" medium-zoom")],-1),r={href:"https://github.com/francoischalifour/medium-zoom#readme",target:"_blank",rel:"noopener noreferrer"},m=o(`

    该插件已经集成到默认主题中。

    使用方法

    npm i -D @vuepress/plugin-medium-zoom@next
    +
    import { mediumZoomPlugin } from "@vuepress/plugin-medium-zoom";
    +
    +export default {
    +  plugins: [
    +    mediumZoomPlugin({
    +      // 配置项
    +    }),
    +  ],
    +};
    +

    配置项

    selector

    • 类型: string

    • 默认值: ':not(a) > img'

    • 详情:

      可缩放的图片的选择器。

      默认情况下,该插件会使 <a> 标签以外的所有图片都支持缩放。

    delay

    • 类型: number

    • 默认值: 500

    • 详情:

      以毫秒为单位的延迟。

      在切换路由进入一个新页面时,该插件会在一定延迟后才使页面内的图片支持缩放。

    zoomOptions

    `,10),h=n("li",null,[n("p",null,[s("类型: "),n("code",null,"Object")])],-1),k=n("li",null,[n("p",null,"详情:"),n("p",null,"medium-zoom 的配置项。")],-1),v=n("p",null,"参考:",-1),b={href:"https://github.com/francoischalifour/medium-zoom#options",target:"_blank",rel:"noopener noreferrer"},_=o('

    样式

    你可以通过 zoomOptions 对大部分的缩放样式进行自定义,不过作为补充,该插件同样提供了一些 CSS 变量:

    File not found

    Composition API

    useMediumZoom

    ',5),f=n("p",null,"详情:",-1),g=n("code",null,"Zoom",-1),z={href:"https://github.com/francoischalifour/medium-zoom#methods",target:"_blank",rel:"noopener noreferrer"},x=n("p",null,"该插件会在切换路由进入当前页面时使图片支持缩放。但如果你要动态添加新图片,那么你可能就需要这个方法来让这些新图片也支持缩放。",-1),y=n("p",null,[s("该插件在 "),n("code",null,"Zoom"),s(" 实例上额外添加了一个 "),n("code",null,"refresh"),s(" 方法,它将使用 "),n("a",{href:"#selector"},"selector"),s(" 作为默认参数,先调用 "),n("code",null,"zoom.detach()"),s(" 再调用 "),n("code",null,"zoom.attach()"),s(" ,便于你快速刷新当前页面图片的缩放状态。")],-1),w=n("li",null,[n("p",null,"示例:")],-1),Z=o(`
    import { nextTick } from "vue";
    +import { useMediumZoom } from "@vuepress/plugin-medium-zoom/client";
    +
    +export default {
    +  setup() {
    +    const zoom = useMediumZoom();
    +
    +    // ... 进行了一些操作,在当前页面添加了新的图片
    +
    +    // 此时你可能需要手动调用 \`refresh\` 来让这些新图片支持缩放
    +    nextTick(() => {
    +      zoom.refresh();
    +    });
    +  },
    +};
    +
    `,1);function q(N,B){const i=t("NpmBadge"),e=t("ExternalLinkIcon");return l(),c("div",null,[d,a(i,{package:"@vuepress/plugin-medium-zoom"}),n("p",null,[s("将 "),n("a",r,[s("medium-zoom"),a(e)]),s(" 集成到 VuePress 中,为图片提供可缩放的功能。")]),m,n("ul",null,[h,k,n("li",null,[v,n("ul",null,[n("li",null,[n("a",b,[s("medium-zoom > Options"),a(e)])])])])]),_,n("ul",null,[n("li",null,[f,n("p",null,[s("返回该插件使用的 "),g,s(" 实例,便于你直接使用实例上的 "),n("a",z,[s("methods"),a(e)]),s(" 。")]),x,y]),w]),Z])}const O=p(u,[["render",q],["__file","medium-zoom.html.vue"]]);export{O as default}; diff --git a/assets/medium-zoom.html-926244f2.js b/assets/medium-zoom.html-926244f2.js new file mode 100644 index 00000000..3eac8909 --- /dev/null +++ b/assets/medium-zoom.html-926244f2.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2ad6454d","path":"/reference/plugin/medium-zoom.html","title":"medium-zoom","lang":"en-US","frontmatter":{"description":"Integrate medium-zoom (https://github.com/francoischalifour/medium-zoom#readme) into VuePress, which can provide the ability to zoom images. This plugin has been integrated into...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/plugin/medium-zoom.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/plugin/medium-zoom.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"medium-zoom"}],["meta",{"property":"og:description","content":"Integrate medium-zoom (https://github.com/francoischalifour/medium-zoom#readme) into VuePress, which can provide the ability to zoom images. This plugin has been integrated into..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"medium-zoom\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"selector","slug":"selector","link":"#selector","children":[]},{"level":3,"title":"delay","slug":"delay","link":"#delay","children":[]},{"level":3,"title":"zoomOptions","slug":"zoomoptions","link":"#zoomoptions","children":[]}]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]},{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"useMediumZoom","slug":"usemediumzoom","link":"#usemediumzoom","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.03,"words":310},"filePathRelative":"reference/plugin/medium-zoom.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/medium-zoom.html-b884d404.js b/assets/medium-zoom.html-b884d404.js new file mode 100644 index 00000000..5ceda26d --- /dev/null +++ b/assets/medium-zoom.html-b884d404.js @@ -0,0 +1 @@ +const e=JSON.parse(`{"key":"v-32cfa4fe","path":"/zh/reference/plugin/medium-zoom.html","title":"medium-zoom","lang":"zh-CN","frontmatter":{"description":"将 medium-zoom (https://github.com/francoischalifour/medium-zoom#readme) 集成到 VuePress 中,为图片提供可缩放的功能。 该插件已经集成到默认主题中。 使用方法 配置项 selector 类型: string; 默认值: ':not(a) > img'; 详情:; 可缩放的图...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/plugin/medium-zoom.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/plugin/medium-zoom.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"medium-zoom"}],["meta",{"property":"og:description","content":"将 medium-zoom (https://github.com/francoischalifour/medium-zoom#readme) 集成到 VuePress 中,为图片提供可缩放的功能。 该插件已经集成到默认主题中。 使用方法 配置项 selector 类型: string; 默认值: ':not(a) > img'; 详情:; 可缩放的图..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"medium-zoom\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"selector","slug":"selector","link":"#selector","children":[]},{"level":3,"title":"delay","slug":"delay","link":"#delay","children":[]},{"level":3,"title":"zoomOptions","slug":"zoomoptions","link":"#zoomoptions","children":[]}]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]},{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"useMediumZoom","slug":"usemediumzoom","link":"#usemediumzoom","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.57,"words":471},"filePathRelative":"zh/reference/plugin/medium-zoom.md","localizedDate":"2023年2月22日","autoDesc":true}`);export{e as data}; diff --git a/assets/medium-zoom.html-bf739c54.js b/assets/medium-zoom.html-bf739c54.js new file mode 100644 index 00000000..30488b67 --- /dev/null +++ b/assets/medium-zoom.html-bf739c54.js @@ -0,0 +1,26 @@ +import{_ as l,W as p,X as c,Y as a,$ as n,a0 as s,a1 as o,D as t}from"./framework-46b0e263.js";const u={},d=n("h1",{id:"medium-zoom",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#medium-zoom","aria-hidden":"true"},"#"),s(" medium-zoom")],-1),r={href:"https://github.com/francoischalifour/medium-zoom#readme",target:"_blank",rel:"noopener noreferrer"},m=o(`

    This plugin has been integrated into the default theme.

    Usage

    npm i -D @vuepress/plugin-medium-zoom@next
    +
    import { mediumZoomPlugin } from "@vuepress/plugin-medium-zoom";
    +
    +export default {
    +  plugins: [
    +    mediumZoomPlugin({
    +      // options
    +    }),
    +  ],
    +};
    +

    Options

    selector

    • Type: string

    • Default: ':not(a) > img'

    • Details:

      Selector of zoomable images.

      By default this plugin will make all images zoomable except those inside <a> tags.

    delay

    • Type: number

    • Default: 500

    • Details:

      Delay in milliseconds.

      After navigating to a new page, this plugin will make images zoomable with a delay.

    zoomOptions

    `,10),h=n("li",null,[n("p",null,[s("Type: "),n("code",null,"Object")])],-1),k=n("li",null,[n("p",null,"Details:"),n("p",null,"Options for medium-zoom.")],-1),v=n("p",null,"Also see:",-1),g={href:"https://github.com/francoischalifour/medium-zoom#options",target:"_blank",rel:"noopener noreferrer"},b=o('

    Styles

    You can customize most of the zoom styles via zoomOptions, while this plugin also provides some CSS variables for additional customization:

    File not found

    Composition API

    useMediumZoom

    ',5),f=n("p",null,"Details:",-1),_=n("code",null,"Zoom",-1),y={href:"https://github.com/francoischalifour/medium-zoom#methods",target:"_blank",rel:"noopener noreferrer"},z=n("p",null,"This plugin will make images zoomable after navigating to current page. But if you are going to add new images dynamically, you may need this method to make those new images zoomable, too.",-1),x=n("p",null,[s("This plugin adds an extra "),n("code",null,"refresh"),s(" method on the "),n("code",null,"Zoom"),s(" instance, which will call "),n("code",null,"zoom.detach()"),s(" then "),n("code",null,"zoom.attach()"),s(" with the "),n("a",{href:"#selector"},"selector"),s(" as the default parameter. It will help you to refresh the zoomable images for current page.")],-1),w=n("li",null,[n("p",null,"Example:")],-1),D=o(`
    import { nextTick } from "vue";
    +import { useMediumZoom } from "@vuepress/plugin-medium-zoom/client";
    +
    +export default {
    +  setup() {
    +    const zoom = useMediumZoom();
    +
    +    // ... do something to add new images in current page
    +
    +    // then you may need to call \`refresh\` manually to make those new images zoomable
    +    nextTick(() => {
    +      zoom.refresh();
    +    });
    +  },
    +};
    +
    `,1);function T(Z,B){const i=t("NpmBadge"),e=t("ExternalLinkIcon");return p(),c("div",null,[d,a(i,{package:"@vuepress/plugin-medium-zoom"}),n("p",null,[s("Integrate "),n("a",r,[s("medium-zoom"),a(e)]),s(" into VuePress, which can provide the ability to zoom images.")]),m,n("ul",null,[h,k,n("li",null,[v,n("ul",null,[n("li",null,[n("a",g,[s("medium-zoom > Options"),a(e)])])])])]),b,n("ul",null,[n("li",null,[f,n("p",null,[s("Returns the "),_,s(" instance that used by this plugin, so that you can use the instance "),n("a",y,[s("methods"),a(e)]),s(" directly.")]),z,x]),w]),D])}const N=l(u,[["render",T],["__file","medium-zoom.html.vue"]]);export{N as default}; diff --git a/assets/migration.html-2aa2394a.js b/assets/migration.html-2aa2394a.js new file mode 100644 index 00000000..ecfe6817 --- /dev/null +++ b/assets/migration.html-2aa2394a.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-d0112c92","path":"/guide/migration.html","title":"Migrating from v1","lang":"en-US","frontmatter":{"icon":"fa6-solid:code-compare","description":"Plugins and themes of VuePress v1 are not compatible with VuePress v2. You need to update them to corresponding v2 version. Some major changes and enhancements of VuePress v2: V...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/guide/migration.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/guide/migration.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Migrating from v1"}],["meta",{"property":"og:description","content":"Plugins and themes of VuePress v1 are not compatible with VuePress v2. You need to update them to corresponding v2 version. Some major changes and enhancements of VuePress v2: V..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Migrating from v1\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"For Users","slug":"for-users","link":"#for-users","children":[{"level":3,"title":"User Config Change","slug":"user-config-change","link":"#user-config-change","children":[]},{"level":3,"title":"Frontmatter Change","slug":"frontmatter-change","link":"#frontmatter-change","children":[]},{"level":3,"title":"Permalink Patterns Change","slug":"permalink-patterns-change","link":"#permalink-patterns-change","children":[]},{"level":3,"title":"Palette System Change","slug":"palette-system-change","link":"#palette-system-change","children":[]},{"level":3,"title":"Conventional Files Change","slug":"conventional-files-change","link":"#conventional-files-change","children":[]},{"level":3,"title":"Markdown slot Change","slug":"markdown-slot-change","link":"#markdown-slot-change","children":[]},{"level":3,"title":"CLI Change","slug":"cli-change","link":"#cli-change","children":[]},{"level":3,"title":"Default Theme Change","slug":"default-theme-change","link":"#default-theme-change","children":[]},{"level":3,"title":"Official Plugins Change","slug":"official-plugins-change","link":"#official-plugins-change","children":[]},{"level":3,"title":"Community Themes and Plugins","slug":"community-themes-and-plugins","link":"#community-themes-and-plugins","children":[]}]},{"level":2,"title":"For Plugin Authors","slug":"for-plugin-authors","link":"#for-plugin-authors","children":[{"level":3,"title":"Plugin API Change","slug":"plugin-api-change","link":"#plugin-api-change","children":[]}]},{"level":2,"title":"For Theme Authors","slug":"for-theme-authors","link":"#for-theme-authors","children":[{"level":3,"title":"Theme API Change","slug":"theme-api-change","link":"#theme-api-change","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":5.52,"words":1657},"filePathRelative":"guide/migration.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/migration.html-41dd8c51.js b/assets/migration.html-41dd8c51.js new file mode 100644 index 00000000..bc1d190a --- /dev/null +++ b/assets/migration.html-41dd8c51.js @@ -0,0 +1,72 @@ +import{_ as i,W as d,X as o,$ as n,a0 as e,Y as a,Z as t,a1 as l,D as c}from"./framework-46b0e263.js";const r={},p=l(`

    从 v1 迁移

    注意

    VuePress v1 的插件和主题与 VuePress v2 不兼容。你需要将它们升级到与 v2 对应的版本。

    VuePress v2 的一些主要改动和优化:

    • VuePress v2 现在使用 Vue 3 ,因此你要保证你的组件和其他客户端文件是适用于 Vue 3 的。
    • VuePress v2 是使用 TypeScript 开发的,因此它现在提供了更好的类型支持。我们强烈推荐你使用 TypeScript 来开发插件和主题。 VuePress 配置文件也同样支持 TypeScript ,你可以直接使用 .vuepress/config.ts
    • VuePress v2 支持使用 Webpack 和 Vite 作为打包工具。现在默认的打包工具是 Vite ,但你仍然可以选择使用 Webpack 。你甚至可以在开发模式使用 Vite 来获取更好的开发体验,而在构建模式使用 Webpack 来获取更好的浏览器兼容性。
    • VuePress v2 现在是纯 ESM 包, CommonJS 格式的配置文件不再被支持。

    VuePress v2 的核心思想和流程是和 v1 一致的,但 v2 API 经过了重新设计,更加标准化。因此在将现有的 v1 项目迁移至 v2 时,你很可能会遇到一些 Breaking Changes 。本指南将帮助你将 v1 的站点 / 插件 / 主题迁移至 v2 。

    • 如果你是一个普通用户,你需要阅读 给用户 的指南。
    • 如果你是一个插件作者,你需要阅读 给插件作者 的指南。
    • 如果你是一个主题作者,你需要阅读 给主题作者 的指南。

    给用户

    用户配置变更

    配置文件应该使用 ESM 格式, CommonJS 格式的配置文件已不再支持。

    // .vuepress/config.js
    +
    +- module.exports = {
    +-   // 用户配置
    +- }
    +
    ++ export default {
    ++   // 用户配置
    ++ }
    +

    theme

    不再支持通过字符串使用主题。需要直接引入主题。

    - module.exports = {
    +-   theme: '@vuepress/theme-default',
    +-   themeConfig: {
    +-     // 默认主题配置
    +-   },
    +- }
    +
    ++ import { defaultTheme } from 'vuepress'
    ++ export default {
    ++   theme: defaultTheme({
    ++     // 默认主题配置
    ++   })
    ++ }
    +

    themeConfig

    移除。直接向主题传入配置。

    plugins

    不再支持通过字符串使用插件。需要直接引入插件。

    - module.exports = {
    +-   plugins: [
    +-     [
    +-       '@vuepress/plugin-google-analytics',
    +-       {
    +-         id: 'G-XXXXXXXXXX',
    +-       },
    +-     ],
    +-   ],
    +- }
    +
    ++ import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
    ++ export default {
    ++   plugins: [
    ++     googleAnalyticsPlugin({
    ++         id: 'G-XXXXXXXXXX',
    ++     }),
    ++   ],
    ++ }
    +

    shouldPrefetch

    默认值从 () => true 更改为 true

    extraWatchFiles

    移除。

    `,22),u=n("h4",{id:"patterns",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#patterns","aria-hidden":"true"},"#"),e(" patterns")],-1),h=n("p",null,[e("重命名为 "),n("code",null,"pagePatterns"),e(" 。")],-1),k=n("h4",{id:"markdown-linenumbers",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-linenumbers","aria-hidden":"true"},"#"),e(" markdown.lineNumbers")],-1),m=n("p",null,[e("默认值从 "),n("code",null,"false"),e(" 更改为 "),n("code",null,"true"),e(" 。")],-1),f=n("h4",{id:"markdown-pagesuffix",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-pagesuffix","aria-hidden":"true"},"#"),e(" markdown.pageSuffix")],-1),v=n("p",null,"移除。",-1),_=n("h4",{id:"markdown-externallinks",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-externallinks","aria-hidden":"true"},"#"),e(" markdown.externalLinks")],-1),b=n("h4",{id:"markdown-toc",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-toc","aria-hidden":"true"},"#"),e(" markdown.toc")],-1),g=n("p",null,"有改动。",-1),x=n("h4",{id:"markdown-plugins",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-plugins","aria-hidden":"true"},"#"),e(" markdown.plugins")],-1),w=n("p",null,"移除。",-1),y=n("h4",{id:"markdown-extendmarkdown",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-extendmarkdown","aria-hidden":"true"},"#"),e(" markdown.extendMarkdown")],-1),C=n("p",null,"移除。",-1),B=n("h4",{id:"markdown-extractheaders",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-extractheaders","aria-hidden":"true"},"#"),e(" markdown.extractHeaders")],-1),P=l(`

    Webpack 相关配置

    所有 Webpack 相关的配置都移动至 @vuepress/bundler-webpack 的配置项中,包括:

    • postcss
    • stylus
    • scss
    • sass
    • less
    • chainWebpack
    • configureWebpack
    • evergreen:默认值从 false 更改为 true
    - module.exports = {
    +-   sass: { /* ... */ },
    +- }
    +
    ++ import { webpackBundler } from '@vuepress/bundler-webpack'
    ++ export default {
    ++   bundler: webpackBundler({
    ++     sass: { /* ... */ },
    ++   }),
    ++ }
    +
    `,4),z=n("h3",{id:"frontmatter-变更",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#frontmatter-变更","aria-hidden":"true"},"#"),e(" Frontmatter 变更")],-1),S=n("h4",{id:"meta",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#meta","aria-hidden":"true"},"#"),e(" meta")],-1),E=n("p",null,"移除。",-1),V=l(`
    head:
    +  - - meta
    +    - name: foo
    +      content: bar
    +  - - link
    +    - rel: canonical
    +      href: foobar
    +  - - script
    +    - {}
    +    - console.log('hello from frontmatter');
    +

    和以下结构相同:

    // .vuepress/config.ts
    +export default {
    +  // ...
    +  head: [
    +    ["meta", { name: "foo", content: "bar" }],
    +    ["link", { rel: "canonical", href: "foobar" }],
    +    ["script", {}, \`console.log('hello from frontmatter');\`],
    +  ],
    +  // ...
    +};
    +

    永久链接 Patterns 变更

    • :i_month:移除
    • :i_day:移除
    • :minutes:移除(v1 文档中未列出)
    • :seconds:移除(v1 文档中未列出)
    • :regular:重命名为 :raw
    `,5),X=n("h3",{id:"调色板系统变更",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#调色板系统变更","aria-hidden":"true"},"#"),e(" 调色板系统变更")],-1),A=n("p",null,[e("VuePress v1 的 Stylus 调色板系统 (即 "),n("code",null,"styles/palette.styl"),e(" 和 "),n("code",null,"styles/index.styl"),e(") 不再由 VuePress Core 默认提供支持。")],-1),q=n("p",null,"主题作者可以使用自己的方式来为用户提供自定义样式的能力,而不必被限制在 Stylus 当中。",-1),W=n("h3",{id:"约定文件变更",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#约定文件变更","aria-hidden":"true"},"#"),e(" 约定文件变更")],-1),F=n("h4",{id:"vuepress-enhanceapp-js",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vuepress-enhanceapp-js","aria-hidden":"true"},"#"),e(" .vuepress/enhanceApp.js")],-1),H=n("p",null,[e("重命名为 "),n("code",null,".vuepress/client.{js,ts}"),e(" ,使用方法也有改动。")],-1),j=n("h4",{id:"vuepress-components",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vuepress-components","aria-hidden":"true"},"#"),e(" .vuepress/components/")],-1),M=n("p",null,"在该目录下的文件不会被自动注册为 Vue 组件。",-1),I=n("code",null,".vuepress/client.{js,ts}",-1),D=n("h4",{id:"vuepress-theme",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vuepress-theme","aria-hidden":"true"},"#"),e(" .vuepress/theme/")],-1),T=n("p",null,"即使该目录存在,也不会被隐式默认当作本地主题目录。",-1),G=l('

    Markdown 插槽变更

    Markdown 插槽不再被支持。

    CLI 变更

    eject 命令

    移除。

    cache 选项

    • -c, --cache [cache]:修改为 --cache <cache> ,意味着 -c 不再是 cache 选项的缩写,并且 cache 选项的值不再是可选的。
    • --no-cache:重命名为 --clean-cache

    默认主题变更

    内置组件

    • <CodeGroup /><CodeBlock /> 重命名为 <CodeGroup /><CodeGroupItem />
    • <Badge />
      • $badgeErrorColor 调色板变量重命名为 $badgeDangerColor
      • type Prop 现在只接受 tipwarningdanger

    调色板系统

    默认主题的调色板系统迁移为 SASS 和 CSS 变量。

    ',12),N=n("h4",{id:"主题配置",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#主题配置","aria-hidden":"true"},"#"),e(" 主题配置")],-1),L=n("p",null,"默认主题的配置有大量变更,建议你阅读 v2 的默认主题配置参考文档来进行迁移。",-1),$=l('

    官方插件变更

    查看 v2 版本的官方插件文档。

    社区主题和插件

    v1 的主题和插件和 v2 并不兼容。

    请确保你在使用的主题和插件已经支持 v2 ,并前往它们各自的文档查看迁移指南。

    给插件作者

    一些主要的 Breaking Changes :

    ',7),J=n("li",null,"你不能再在你的插件中使用其他插件了,这避免了很多由于插件嵌套引发的问题。如果你的插件依赖于别的插件,你可以在文档中列出他们,并让用户手动引入。或者,你也可以向用户提供一个插件数组以方便使用。",-1),R=n("li",null,[e("大部分 v1 Hook 都在 v2 中存在等效的 Hook 或实现方式。唯一的例外是 "),n("code",null,"extendsCli"),e(" ,它被移除了。")],-1),O=l('

    插件 API 变更

    • plugins:移除
    • ready:重命名为 onPrepared
    • updated:重命名为 onWatched
    • generated:重命名为 onGenerated
    • additionalPages:移除,改为在 onInitialized Hook 中使用 app.pages.push(createPage())
    • clientDynamicModules:移除,改为在 onPrepared Hook 中使用 app.writeTemp()
    • enhanceAppFiles:移除,使用 clientConfigFile Hook
    • globalUIComponents:移除,使用 clientConfigFile Hook
    • clientRootMixin:移除,使用 clientConfigFile Hook
    • extendMarkdown:重命名为 extendsMarkdown
    • chainMarkdown:移除
    • extendPageData:重命名为 extendsPage
    • extendsCli:移除
    • configureWebpack:移除
    • chainWebpack:移除
    • beforeDevServer:移除
    • afterDevServer:移除
    ',2),U=n("h2",{id:"给主题作者",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#给主题作者","aria-hidden":"true"},"#"),e(" 给主题作者")],-1),Y=n("p",null,[e("请先浏览 "),n("a",{href:"#%E6%8F%92%E4%BB%B6-api-%E5%8F%98%E6%9B%B4"},"插件 API 变更"),e(" 和 "),n("a",{href:"#%E4%B8%BB%E9%A2%98-api-%E5%8F%98%E6%9B%B4"},"主题 API 变更"),e("。")],-1),Z=n("p",null,"虽然我们不允许在插件中使用其他插件了,但是你仍然可以在你的主题中使用插件。",-1),K=n("p",null,"一些主要的 Breaking Changes :",-1),Q=n("strong",null,"主题目录结构约定",-1),ee=n("li",null,[n("code",null,"theme/enhanceApp.js"),e(" 文件不会被隐式作为 Client App Enhance 文件。你需要在 "),n("code",null,"clientConfigFile"),e(" Hook 中显式指定它。")],-1),ne=n("code",null,"theme/global-components/",-1),se=n("code",null,"clientConfigFile",-1),ae=l("
  • theme/layouts/ 目录下的文件不会被自动注册为布局组件。你需要在 clientConfigFile 中通过 layouts 来显式指定。
  • theme/templates/ 目录下的文件不会被自动用作 dev / ssr 的模板。你需要通过 templateBuildtemplateDev 配置项来显式指定。
  • 你始终需要提供一个合法的 JS 入口文件,不要再使用 "main": "layouts/Layout.vue" 作为主题入口。
  • ",3),te=n("code",null,"themeConfig",-1),le=n("code",null,"this.$site.themeConfig",-1),ie=n("code",null,"themeConfig",-1),de=n("code",null,"useThemeData",-1),oe=n("li",null,[e("考虑到可扩展性, "),n("code",null,"this.$site.pages"),e(" 不再可用。")],-1),ce=n("h3",{id:"主题-api-变更",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#主题-api-变更","aria-hidden":"true"},"#"),e(" 主题 API 变更")],-1),re=n("h4",{id:"layouts",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#layouts","aria-hidden":"true"},"#"),e(" layouts")],-1),pe=n("p",null,"移除。",-1),ue=n("p",null,"现在你需要在客户端配置文件中设置布局组件。",-1),he=n("h4",{id:"extend",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#extend","aria-hidden":"true"},"#"),e(" extend")],-1),ke=n("p",null,[e("重命名为 "),n("code",null,"extends"),e(" 。")],-1),me=n("p",null,[e("你仍然可以通过 "),n("code",null,"extends: parentTheme()"),e(" 来继承一个父主题,这将会继承其插件和布局等。")],-1),fe=n("code",null,"@theme",-1),ve=n("code",null,"@parent-theme",-1);function _e(be,ge){const s=c("RouterLink");return d(),o("div",null,[p,n("p",null,[e("你可以手动在 "),a(s,{to:"/zh/reference/plugin-api.html#onwatched"},{default:t(()=>[e("onWatched")]),_:1}),e(" Hook 中监听文件变化。")]),u,h,k,n("p",null,[e("移动至 "),a(s,{to:"/zh/reference/config.html#markdown-code-linenumbers"},{default:t(()=>[e("markdown.code.lineNumbers")]),_:1}),e(" 。")]),m,f,v,_,n("p",null,[e("移动至 "),a(s,{to:"/zh/reference/config.html#markdown-links"},{default:t(()=>[e("markdown.links.externalAttrs")]),_:1}),e(" 。")]),b,g,n("p",null,[e("参考 "),a(s,{to:"/zh/reference/config.html#markdown-toc"},{default:t(()=>[e("配置 > markdown.toc")]),_:1})]),x,w,n("p",null,[e("在 "),a(s,{to:"/zh/reference/plugin-api.html#extendsmarkdown"},{default:t(()=>[e("extendsMarkdown")]),_:1}),e(" Hook 中使用 markdown-it 插件。")]),y,C,n("p",null,[e("使用 "),a(s,{to:"/zh/reference/plugin-api.html#extendsmarkdown"},{default:t(()=>[e("extendsMarkdown")]),_:1}),e(" Hook 。")]),B,n("p",null,[e("移动至 "),a(s,{to:"/zh/reference/config.html#markdown-headers"},{default:t(()=>[e("markdown.headers")]),_:1}),e(" 。")]),P,n("p",null,[e("请参考 "),a(s,{to:"/zh/guide/bundler.html"},{default:t(()=>[e("指南 > Bundler")]),_:1}),e(" 。")]),z,S,E,n("p",null,[e("改为使用 "),a(s,{to:"/zh/reference/frontmatter.html#head"},{default:t(()=>[e("head")]),_:1}),e(" 。例如:")]),V,n("p",null,[e("参考 "),a(s,{to:"/zh/reference/frontmatter.html#permalinkpattern"},{default:t(()=>[e("Frontmatter > permalinkPattern")]),_:1}),e(" 。")]),X,A,n("p",null,[e("调色板系统提取到了 "),a(s,{to:"/zh/reference/plugin/palette.html"},{default:t(()=>[e("@vuepress/plugin-palette")]),_:1}),e(" 当中。")]),q,n("p",null,[e("如果你使用的是默认主题,那么调色板系统仍然存在,但改为使用 SASS ,并且大部分变量都迁移为 CSS 变量。参考 "),a(s,{to:"/zh/reference/default-theme/styles.html"},{default:t(()=>[e("默认主题 > 样式")]),_:1}),e(" 。")]),W,F,H,n("p",null,[e("参考 "),a(s,{to:"/zh/advanced/cookbook/usage-of-client-config.html"},{default:t(()=>[e("深入 > Cookbook > 客户端配置的使用方法")]),_:1}),e(" 。")]),j,M,n("p",null,[e("你需要使用 "),a(s,{to:"/zh/reference/plugin/register-components.html"},{default:t(()=>[e("@vuepress/plugin-register-components")]),_:1}),e(" ,或者在 "),I,e(" 中手动注册你的组件。")]),D,T,n("p",null,[e("你需要在 "),a(s,{to:"/zh/reference/config.html#theme"},{default:t(()=>[e("theme")]),_:1}),e(" 配置项中显式引入并使用本地主题。")]),G,n("p",null,[e("参考 "),a(s,{to:"/zh/reference/default-theme/styles.html"},{default:t(()=>[e("默认主题 > 样式")]),_:1}),e(" 。")]),N,L,n("p",null,[e("参考 "),a(s,{to:"/zh/reference/default-theme/config.html"},{default:t(()=>[e("默认主题 > 配置")]),_:1}),e(" 。")]),$,n("ul",null,[J,R,n("li",null,[e("Webpack 相关的 Hook 都被移除了,因为 VuePress Core 已经和 Webpack 解耦了。你可以尝试使用 "),a(s,{to:"/zh/reference/plugin-api.html#extendsbundleroptions"},{default:t(()=>[e("extendsBundlerOptions")]),_:1}),e(" Hook 来进行相似的操作,但要注意应适配所有不同的打包工具。")])]),n("p",null,[e("你可以参考 "),a(s,{to:"/zh/advanced/plugin.html"},{default:t(()=>[e("深入 > 开发插件")]),_:1}),e(" 来了解如何开发一个 v2 插件。")]),O,n("p",null,[e("参考 "),a(s,{to:"/zh/reference/plugin-api.html"},{default:t(()=>[e("插件 API")]),_:1}),e(" 。")]),U,Y,Z,K,n("ul",null,[n("li",null,[e("所谓的 "),Q,e(" 不再存在。 "),n("ul",null,[ee,n("li",null,[ne,e(" 目录下的文件不会被自动注册为 Vue 组件。你需要使用 "),a(s,{to:"/zh/reference/plugin/register-components.html"},{default:t(()=>[e("@vuepress/plugin-register-components")]),_:1}),e(" ,或者在 "),se,e(" 中手动注册组件。")]),ae])]),n("li",null,[te,e(" 已经从用户配置和站点数据中移除。如果你想要像 v1 一样通过 "),le,e(" 来访问 "),ie,e(" ,我们现在建议使用 "),a(s,{to:"/zh/reference/plugin/theme-data.html"},{default:t(()=>[e("@vuepress/plugin-theme-data")]),_:1}),e(" 插件和它提供的 Composition API "),de,e(" 。")]),n("li",null,[e("Stylus 不再是默认的 CSS 预处理器,并且 Stylus 调色板系统不再被默认支持。如果你仍然想要使用和 v1 类似的调色板系统,可以使用 "),a(s,{to:"/zh/reference/plugin/palette.html"},{default:t(()=>[e("@vuepress/plugin-palette")]),_:1}),e(" 。")]),n("li",null,[e("由 Prism.js 提供的 Markdown 代码块的语法高亮不再被默认支持。你可以选择使用 "),a(s,{to:"/zh/reference/plugin/prismjs.html"},{default:t(()=>[e("@vuepress/plugin-prismjs")]),_:1}),e(" 或 "),a(s,{to:"/zh/reference/plugin/shiki.html"},{default:t(()=>[e("@vuepress/plugin-shiki")]),_:1}),e(" ,或者用你自己的方式实现语法高亮。")]),oe]),n("p",null,[e("你可以参考 "),a(s,{to:"/zh/advanced/theme.html"},{default:t(()=>[e("深入 > 开发主题")]),_:1}),e(" 来了解如何开发一个 v2 主题。")]),ce,re,pe,ue,n("p",null,[e("参考 "),a(s,{to:"/zh/advanced/theme.html"},{default:t(()=>[e("深入 > 开发主题")]),_:1}),e(" 。")]),he,ke,me,n("p",null,[e("你可以参考 "),a(s,{to:"/zh/reference/default-theme/extending.html"},{default:t(()=>[e("默认主题 > 继承")]),_:1}),e(" 来了解如何继承默认主题。")]),n("p",null,[fe,e(" 和 "),ve,e(" 别名默认被移除了,但你仍然可以使用类似的方式来开发一个可继承的主题,参考 "),a(s,{to:"/zh/advanced/cookbook/making-a-theme-extendable.html"},{default:t(()=>[e("深入 > Cookbook > 开发一个可继承的主题")]),_:1}),e(" 。")])])}const we=i(r,[["render",_e],["__file","migration.html.vue"]]);export{we as default}; diff --git a/assets/migration.html-cc0874ae.js b/assets/migration.html-cc0874ae.js new file mode 100644 index 00000000..4fb51b17 --- /dev/null +++ b/assets/migration.html-cc0874ae.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-81b14334","path":"/zh/guide/migration.html","title":"从 v1 迁移","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:code-compare","description":"VuePress v1 的插件和主题与 VuePress v2 不兼容。你需要将它们升级到与 v2 对应的版本。 VuePress v2 的一些主要改动和优化: VuePress v2 现在使用 Vue 3 ,因此你要保证你的组件和其他客户端文件是适用于 Vue 3 的。; VuePress v2 是使用 TypeScript 开发的,因此它现在提供了...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/guide/migration.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/guide/migration.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"从 v1 迁移"}],["meta",{"property":"og:description","content":"VuePress v1 的插件和主题与 VuePress v2 不兼容。你需要将它们升级到与 v2 对应的版本。 VuePress v2 的一些主要改动和优化: VuePress v2 现在使用 Vue 3 ,因此你要保证你的组件和其他客户端文件是适用于 Vue 3 的。; VuePress v2 是使用 TypeScript 开发的,因此它现在提供了..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"从 v1 迁移\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"给用户","slug":"给用户","link":"#给用户","children":[{"level":3,"title":"用户配置变更","slug":"用户配置变更","link":"#用户配置变更","children":[]},{"level":3,"title":"Frontmatter 变更","slug":"frontmatter-变更","link":"#frontmatter-变更","children":[]},{"level":3,"title":"永久链接 Patterns 变更","slug":"永久链接-patterns-变更","link":"#永久链接-patterns-变更","children":[]},{"level":3,"title":"调色板系统变更","slug":"调色板系统变更","link":"#调色板系统变更","children":[]},{"level":3,"title":"约定文件变更","slug":"约定文件变更","link":"#约定文件变更","children":[]},{"level":3,"title":"Markdown 插槽变更","slug":"markdown-插槽变更","link":"#markdown-插槽变更","children":[]},{"level":3,"title":"CLI 变更","slug":"cli-变更","link":"#cli-变更","children":[]},{"level":3,"title":"默认主题变更","slug":"默认主题变更","link":"#默认主题变更","children":[]},{"level":3,"title":"官方插件变更","slug":"官方插件变更","link":"#官方插件变更","children":[]},{"level":3,"title":"社区主题和插件","slug":"社区主题和插件","link":"#社区主题和插件","children":[]}]},{"level":2,"title":"给插件作者","slug":"给插件作者","link":"#给插件作者","children":[{"level":3,"title":"插件 API 变更","slug":"插件-api-变更","link":"#插件-api-变更","children":[]}]},{"level":2,"title":"给主题作者","slug":"给主题作者","link":"#给主题作者","children":[{"level":3,"title":"主题 API 变更","slug":"主题-api-变更","link":"#主题-api-变更","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":8.02,"words":2405},"filePathRelative":"zh/guide/migration.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/migration.html-feaf251f.js b/assets/migration.html-feaf251f.js new file mode 100644 index 00000000..deb70629 --- /dev/null +++ b/assets/migration.html-feaf251f.js @@ -0,0 +1,72 @@ +import{_ as o,W as l,X as d,$ as n,a0 as e,Y as s,Z as t,a1 as i,D as r}from"./framework-46b0e263.js";const c={},p=i(`

    Migrating from v1

    Note

    Plugins and themes of VuePress v1 are not compatible with VuePress v2. You need to update them to corresponding v2 version.

    Some major changes and enhancements of VuePress v2:

    • VuePress v2 is now using Vue 3, so make sure your components and other client files are compatible with Vue 3.
    • VuePress v2 is developed with TypeScript, so it provides better TS support now. It's highly recommended to use TypeScript to develop plugins and themes. VuePress config file also supports TypeScript, and you can use .vuepress/config.ts directly.
    • VuePress v2 supports both Webpack and Vite as bundler. Now Vite is the default bundler, while you can still choose to use Webpack. You can even use Vite in dev mode to get better development experience, and use Webpack in build mode to get better browser compatibility.
    • VuePress v2 is now released as pure ESM packages, and CommonJS config files are no longer supported.

    Core ideas and processes of VuePress v2 are the same with v1, while v2 API has been re-designed and becomes more normalized. So you might encounter breaking changes when migrating an existing v1 project to v2. This guide is here to help you migrating v1 sites / plugins / themes to v2.

    For Users

    User Config Change

    Config file should be in ESM format, and CommonJS format config file is no longer supported.

    // .vuepress/config.js
    +
    +- module.exports = {
    +-   // user config
    +- }
    +
    ++ export default {
    ++   // user config
    ++ }
    +

    theme

    Using a theme via string is not supported. Import the theme directly.

    - module.exports = {
    +-   theme: '@vuepress/theme-default',
    +-   themeConfig: {
    +-     // default theme config
    +-   },
    +- }
    +
    ++ import { defaultTheme } from 'vuepress'
    ++ export default {
    ++   theme: defaultTheme({
    ++     // default theme config
    ++   })
    ++ }
    +

    themeConfig

    Removed. Set config to the theme directly.

    plugins

    Using a plugin via string is not supported. Import the plugin directly.

    - module.exports = {
    +-   plugins: [
    +-     [
    +-       '@vuepress/plugin-google-analytics',
    +-       {
    +-         id: 'G-XXXXXXXXXX',
    +-       },
    +-     ],
    +-   ],
    +- }
    +
    ++ import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
    ++ export default {
    ++   plugins: [
    ++     googleAnalyticsPlugin({
    ++         id: 'G-XXXXXXXXXX',
    ++     }),
    ++   ],
    ++ }
    +

    shouldPrefetch

    Default value is changed from () => true to true.

    extraWatchFiles

    Removed.

    `,22),u=n("h4",{id:"patterns",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#patterns","aria-hidden":"true"},"#"),e(" patterns")],-1),h=n("p",null,[e("Renamed to "),n("code",null,"pagePatterns")],-1),m=n("h4",{id:"markdown-linenumbers",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-linenumbers","aria-hidden":"true"},"#"),e(" markdown.lineNumbers")],-1),f=n("p",null,[e("Default value is changed from "),n("code",null,"false"),e(" to "),n("code",null,"true"),e(".")],-1),g=n("h4",{id:"markdown-pagesuffix",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-pagesuffix","aria-hidden":"true"},"#"),e(" markdown.pageSuffix")],-1),v=n("p",null,"Removed.",-1),k=n("h4",{id:"markdown-externallinks",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-externallinks","aria-hidden":"true"},"#"),e(" markdown.externalLinks")],-1),b=n("h4",{id:"markdown-toc",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-toc","aria-hidden":"true"},"#"),e(" markdown.toc")],-1),_=n("p",null,"Changed.",-1),x=n("h4",{id:"markdown-plugins",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-plugins","aria-hidden":"true"},"#"),e(" markdown.plugins")],-1),y=n("p",null,"Removed.",-1),w=n("h4",{id:"markdown-extendmarkdown",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-extendmarkdown","aria-hidden":"true"},"#"),e(" markdown.extendMarkdown")],-1),C=n("p",null,"Removed.",-1),P=n("h4",{id:"markdown-extractheaders",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-extractheaders","aria-hidden":"true"},"#"),e(" markdown.extractHeaders")],-1),S=i(`

    All webpack related configs are moved to options of @vuepress/bundler-webpack, including:

    • postcss
    • stylus
    • scss
    • sass
    • less
    • chainWebpack
    • configureWebpack
    • evergreen: default value is changed from false to true
    - module.exports = {
    +-   sass: { /* ... */ },
    +- }
    +
    ++ import { webpackBundler } from '@vuepress/bundler-webpack'
    ++ export default {
    ++   bundler: webpackBundler({
    ++     sass: { /* ... */ },
    ++   }),
    ++ }
    +
    `,4),T=n("h3",{id:"frontmatter-change",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#frontmatter-change","aria-hidden":"true"},"#"),e(" Frontmatter Change")],-1),A=n("h4",{id:"meta",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#meta","aria-hidden":"true"},"#"),e(" meta")],-1),V=n("p",null,"Removed.",-1),F=i(`
    head:
    +  - - meta
    +    - name: foo
    +      content: bar
    +  - - link
    +    - rel: canonical
    +      href: foobar
    +  - - script
    +    - {}
    +    - console.log('hello from frontmatter');
    +

    Has the same structure with:

    // .vuepress/config.ts
    +export default {
    +  // ...
    +  head: [
    +    ["meta", { name: "foo", content: "bar" }],
    +    ["link", { rel: "canonical", href: "foobar" }],
    +    ["script", {}, \`console.log('hello from frontmatter');\`],
    +  ],
    +  // ...
    +};
    +
    • :i_month: removed
    • :i_day: removed
    • :minutes: removed (undocumented in v1)
    • :seconds: removed (undocumented in v1)
    • :regular: renamed to :raw
    `,5),X=n("h3",{id:"palette-system-change",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#palette-system-change","aria-hidden":"true"},"#"),e(" Palette System Change")],-1),q=n("p",null,[e("The stylus palette system of VuePress v1 (i.e. "),n("code",null,"styles/palette.styl"),e(" and "),n("code",null,"styles/index.styl"),e(") is no longer provided by VuePress Core.")],-1),M=n("p",null,"Theme authors can use their own way to allow users to customize styles, and not be limited with stylus.",-1),j=n("h3",{id:"conventional-files-change",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#conventional-files-change","aria-hidden":"true"},"#"),e(" Conventional Files Change")],-1),I=n("h4",{id:"vuepress-enhanceapp-js",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vuepress-enhanceapp-js","aria-hidden":"true"},"#"),e(" .vuepress/enhanceApp.js")],-1),D=n("p",null,[e("Renamed to "),n("code",null,".vuepress/client.{js,ts}"),e(", and the usage has been changed, too.")],-1),W=n("h4",{id:"vuepress-components",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vuepress-components","aria-hidden":"true"},"#"),e(" .vuepress/components/")],-1),Y=n("p",null,"Files in this directory will not be registered as Vue components automatically.",-1),R=n("code",null,".vuepress/client.{js,ts}",-1),B=n("h4",{id:"vuepress-theme",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vuepress-theme","aria-hidden":"true"},"#"),e(" .vuepress/theme/")],-1),N=n("p",null,"This directory will not be used as local theme implicitly if it is existed.",-1),U=i('

    Markdown slot Change

    Markdown slot is no longer supported.

    CLI Change

    eject command

    Removed.

    cache options

    • -c, --cache [cache]: changed to --cache <cache>, which means that the shorthand -c is not for cache option, and the value of cache option is not optional.
    • --no-cache: renamed to --clean-cache .

    Default Theme Change

    Built-in Components

    • <CodeGroup /> and <CodeBlock /> renamed to <CodeGroup /> and <CodeGroupItem />
    • <Badge />
      • $badgeErrorColor palette variable renamed to $badgeDangerColor
      • type prop only accepts tip, warning and danger now

    Palette System

    The palette system of default theme has migrated to SASS and CSS variables.

    ',12),G=n("h4",{id:"theme-config",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#theme-config","aria-hidden":"true"},"#"),e(" Theme Config")],-1),E=n("p",null,"Default theme config has been changed a lot. You'd better check the config reference of v2 default theme to migrate it properly.",-1),L=i('

    Official Plugins Change

    Check the v2 docs of official plugins.

    Community Themes and Plugins

    Themes and plugins of v1 are not compatible with v2.

    Please make sure that those themes and plugins you are using have supported v2, and refer to their own documentation for migration guide.

    For Plugin Authors

    Some major breaking changes:

    ',7),$=n("li",null,"You cannot use other plugins in your plugin anymore, which avoids lots of potential issues caused by plugin nesting. If your plugin depends on other plugins, you could list them in the docs to ask users import them manually. Alternatively, you can provide users with an array of plugins for convenience.",-1),z=n("li",null,[e("Most of the v1 hooks have equivalents in v2. The only exception is "),n("code",null,"extendsCli"),e(", which has been removed.")],-1),H=i('

    Plugin API Change

    • plugins: removed
    • ready: renamed to onPrepared
    • updated: renamed to onWatched
    • generated: renamed to onGenerated
    • additionalPages: removed, use app.pages.push(createPage()) in onInitialized hook
    • clientDynamicModules: removed, use app.writeTemp() in onPrepared hook
    • enhanceAppFiles: removed, use clientConfigFile hook
    • globalUIComponents: removed, use clientConfigFile hook
    • clientRootMixin: removed, use clientConfigFile hook
    • extendMarkdown: renamed to extendsMarkdown
    • chainMarkdown: removed
    • extendPageData: renamed to extendsPage
    • extendsCli: removed
    • configureWebpack: removed
    • chainWebpack: removed
    • beforeDevServer: removed
    • afterDevServer: removed
    ',2),J=n("h2",{id:"for-theme-authors",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#for-theme-authors","aria-hidden":"true"},"#"),e(" For Theme Authors")],-1),O=n("p",null,"Although we do not allow using other plugins in a plugin anymore, you can still use plugins in your theme.",-1),Z=n("p",null,"Some major breaking changes:",-1),K=n("strong",null,"conventional theme directory structure",-1),Q=n("li",null,[e("The file "),n("code",null,"theme/enhanceApp.js"),e(" will not be used as client app enhance file implicitly. You need to specify it explicitly in "),n("code",null,"clientConfigFile"),e(" hook.")],-1),ee=n("code",null,"theme/global-components/",-1),ne=n("code",null,"clientConfigFile",-1),ae=i("
  • Files in theme/layouts/ directory will not be registered as layout components automatically. You need to specify it explicitly in layouts option in clientConfigFile.
  • Files in theme/templates/ directory will not be used as dev / ssr template automatically. You need to specify theme explicitly in templateBuild and templateDev option.
  • Always provide a valid js entry file, and do not use "main": "layouts/Layout.vue" as the theme entry anymore.
  • ",3),se=n("code",null,"themeConfig",-1),te=n("code",null,"themeConfig",-1),ie=n("code",null,"this.$site.themeConfig",-1),oe=n("code",null,"useThemeData",-1),le=n("li",null,[e("For scalability concerns, "),n("code",null,"this.$site.pages"),e(" is not available any more.")],-1),de=n("h3",{id:"theme-api-change",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#theme-api-change","aria-hidden":"true"},"#"),e(" Theme API Change")],-1),re=n("h4",{id:"layouts",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#layouts","aria-hidden":"true"},"#"),e(" layouts")],-1),ce=n("p",null,"Removed.",-1),pe=n("p",null,"Now you need to specify layout component in the client config file of your theme.",-1),ue=n("h4",{id:"extend",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#extend","aria-hidden":"true"},"#"),e(" extend")],-1),he=n("p",null,[e("Renamed to "),n("code",null,"extends"),e(".")],-1),me=n("p",null,[e("You can still inherit a parent theme with "),n("code",null,"extends: parentTheme()"),e(", which will extends the plugins, layouts, etc.")],-1),fe=n("code",null,"@theme",-1),ge=n("code",null,"@parent-theme",-1);function ve(ke,be){const a=r("RouterLink");return l(),d("div",null,[p,n("p",null,[e("You can watch files manually in "),s(a,{to:"/reference/plugin-api.html#onwatched"},{default:t(()=>[e("onWatched")]),_:1}),e(" hook.")]),u,h,m,n("p",null,[e("Moved to "),s(a,{to:"/reference/config.html#markdown-code-linenumbers"},{default:t(()=>[e("markdown.code.lineNumbers")]),_:1}),e(".")]),f,g,v,k,n("p",null,[e("Moved to "),s(a,{to:"/reference/config.html#markdown-links"},{default:t(()=>[e("markdown.links.externalAttrs")]),_:1}),e(".")]),b,_,n("p",null,[e("See "),s(a,{to:"/reference/config.html#markdown-toc"},{default:t(()=>[e("Config > markdown.toc")]),_:1})]),x,y,n("p",null,[e("Use markdown-it plugins in "),s(a,{to:"/reference/plugin-api.html#extendsmarkdown"},{default:t(()=>[e("extendsMarkdown")]),_:1}),e(" hook.")]),w,C,n("p",null,[e("Use "),s(a,{to:"/reference/plugin-api.html#extendsmarkdown"},{default:t(()=>[e("extendsMarkdown")]),_:1}),e(" hook.")]),P,n("p",null,[e("Moved to "),s(a,{to:"/reference/config.html#markdown-headers"},{default:t(()=>[e("markdown.headers")]),_:1}),e(".")]),S,n("p",null,[e("Please refer to "),s(a,{to:"/guide/bundler.html"},{default:t(()=>[e("Guide > Bundler")]),_:1}),e(".")]),T,A,V,n("p",null,[e("Use "),s(a,{to:"/reference/frontmatter.html#head"},{default:t(()=>[e("head")]),_:1}),e(" instead. For example:")]),F,n("p",null,[e("See "),s(a,{to:"/reference/frontmatter.html#permalinkpattern"},{default:t(()=>[e("Frontmatter > permalinkPattern")]),_:1}),e(".")]),X,q,n("p",null,[e("The palette system is extracted to "),s(a,{to:"/reference/plugin/palette.html"},{default:t(()=>[e("@vuepress/plugin-palette")]),_:1}),e(".")]),M,n("p",null,[e("If you are using default theme, the palette system is still available but migrated to SASS, while most variables have been migrated to CSS variables. See "),s(a,{to:"/reference/default-theme/styles.html"},{default:t(()=>[e("Default Theme > Styles")]),_:1}),e(".")]),j,I,D,n("p",null,[e("See "),s(a,{to:"/advanced/cookbook/usage-of-client-config.html"},{default:t(()=>[e("Advanced > Cookbook > Usage of Client Config")]),_:1}),e(".")]),W,Y,n("p",null,[e("You need to use "),s(a,{to:"/reference/plugin/register-components.html"},{default:t(()=>[e("@vuepress/plugin-register-components")]),_:1}),e(", or register your components manually in "),R,e(".")]),B,N,n("p",null,[e("You need to import and set your local theme via "),s(a,{to:"/reference/config.html#theme"},{default:t(()=>[e("theme")]),_:1}),e(" option.")]),U,n("p",null,[e("See "),s(a,{to:"/reference/default-theme/styles.html"},{default:t(()=>[e("Default Theme > Styles")]),_:1}),e(".")]),G,E,n("p",null,[e("See "),s(a,{to:"/reference/default-theme/config.html"},{default:t(()=>[e("Default Theme > Config")]),_:1}),e(".")]),L,n("ul",null,[$,z,n("li",null,[e("Webpack related hooks are removed, because VuePress Core has decoupled with webpack. You can try to use "),s(a,{to:"/reference/plugin-api.html#extendsbundleroptions"},{default:t(()=>[e("extendsBundlerOptions")]),_:1}),e(" hook for similar purpose, and make sure to work with all bundlers.")])]),n("p",null,[e("For more detailed guide about how to write a plugin in v2, see "),s(a,{to:"/advanced/plugin.html"},{default:t(()=>[e("Advanced > Writing a Plugin")]),_:1}),e(".")]),H,n("p",null,[e("See "),s(a,{to:"/reference/plugin-api.html"},{default:t(()=>[e("Plugin API")]),_:1}),e(".")]),J,O,Z,n("ul",null,[n("li",null,[e("There is no "),K,e(" anymore. "),n("ul",null,[Q,n("li",null,[e("Files in "),ee,e(" directory will not be registered as Vue components automatically. You need to use "),s(a,{to:"/reference/plugin/register-components.html"},{default:t(()=>[e("@vuepress/plugin-register-components")]),_:1}),e(", or register components manually in "),ne,e(".")]),ae])]),n("li",null,[se,e(" is removed from user config and site data. To access the "),te,e(" as you would via "),ie,e(" in v1, we now recommend using the "),s(a,{to:"/reference/plugin/theme-data.html"},{default:t(()=>[e("@vuepress/plugin-theme-data")]),_:1}),e(" plugin and its "),oe,e(" composition API.")]),n("li",null,[e("Stylus is no longer the default CSS pre-processor, and the stylus palette system is not embedded. If you still want to use similar palette system as v1, "),s(a,{to:"/reference/plugin/palette.html"},{default:t(()=>[e("@vuepress/plugin-palette")]),_:1}),e(" may help.")]),n("li",null,[e("Markdown code blocks syntax highlighting by Prism.js is not embedded by default. You can use either "),s(a,{to:"/reference/plugin/prismjs.html"},{default:t(()=>[e("@vuepress/plugin-prismjs")]),_:1}),e(" or "),s(a,{to:"/reference/plugin/shiki.html"},{default:t(()=>[e("@vuepress/plugin-shiki")]),_:1}),e(", or implement syntax highlighting in your own way.")]),le]),n("p",null,[e("For more detailed guide about how to write a theme in v2, see "),s(a,{to:"/advanced/theme.html"},{default:t(()=>[e("Advanced > Writing a Theme")]),_:1}),e(".")]),de,re,ce,pe,n("p",null,[e("See "),s(a,{to:"/advanced/theme.html"},{default:t(()=>[e("Advanced > Writing a theme")]),_:1}),e(".")]),ue,he,me,n("p",null,[e("You can refer to "),s(a,{to:"/reference/default-theme/extending.html"},{default:t(()=>[e("Default Theme > Extending")]),_:1}),e(" for how to extend default theme.")]),n("p",null,[e("The "),fe,e(" and "),ge,e(" aliases are removed by default, but you can still make a extendable theme with similar approach, see "),s(a,{to:"/advanced/cookbook/making-a-theme-extendable.html"},{default:t(()=>[e("Advanced > Cookbook > Making a Theme Extendable")]),_:1}),e(".")])])}const xe=o(c,[["render",ve],["__file","migration.html.vue"]]);export{xe as default}; diff --git a/assets/node-api.html-18ff42ee.js b/assets/node-api.html-18ff42ee.js new file mode 100644 index 00000000..0738a450 --- /dev/null +++ b/assets/node-api.html-18ff42ee.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4986678d","path":"/reference/node-api.html","title":"Node API","lang":"en-US","frontmatter":{"icon":"fa6-brands:node-js","description":"Node API is provided by @vuepress/core (https://www.npmjs.com/package/@vuepress/core) package. It is a dependency of the vuepress (https://www.npmjs.com/package/vuepress) packag...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/node-api.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/node-api.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Node API"}],["meta",{"property":"og:description","content":"Node API is provided by @vuepress/core (https://www.npmjs.com/package/@vuepress/core) package. It is a dependency of the vuepress (https://www.npmjs.com/package/vuepress) packag..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Node API\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"App","slug":"app","link":"#app","children":[{"level":3,"title":"createBuildApp","slug":"createbuildapp","link":"#createbuildapp","children":[]},{"level":3,"title":"createDevApp","slug":"createdevapp","link":"#createdevapp","children":[]}]},{"level":2,"title":"App Properties","slug":"app-properties","link":"#app-properties","children":[{"level":3,"title":"options","slug":"options","link":"#options","children":[]},{"level":3,"title":"siteData","slug":"sitedata","link":"#sitedata","children":[]},{"level":3,"title":"version","slug":"version","link":"#version","children":[]},{"level":3,"title":"env.isBuild","slug":"env-isbuild","link":"#env-isbuild","children":[]},{"level":3,"title":"env.isDev","slug":"env-isdev","link":"#env-isdev","children":[]},{"level":3,"title":"env.isDebug","slug":"env-isdebug","link":"#env-isdebug","children":[]},{"level":3,"title":"markdown","slug":"markdown","link":"#markdown","children":[]},{"level":3,"title":"pages","slug":"pages","link":"#pages","children":[]}]},{"level":2,"title":"App Methods","slug":"app-methods","link":"#app-methods","children":[{"level":3,"title":"dir","slug":"dir","link":"#dir","children":[]},{"level":3,"title":"writeTemp","slug":"writetemp","link":"#writetemp","children":[]},{"level":3,"title":"init","slug":"init","link":"#init","children":[]},{"level":3,"title":"prepare","slug":"prepare","link":"#prepare","children":[]},{"level":3,"title":"build","slug":"build","link":"#build","children":[]},{"level":3,"title":"dev","slug":"dev","link":"#dev","children":[]}]},{"level":2,"title":"Page","slug":"page","link":"#page","children":[{"level":3,"title":"createPage","slug":"createpage","link":"#createpage","children":[]}]},{"level":2,"title":"Page Properties","slug":"page-properties","link":"#page-properties","children":[{"level":3,"title":"key","slug":"key","link":"#key","children":[]},{"level":3,"title":"path","slug":"path","link":"#path","children":[]},{"level":3,"title":"title","slug":"title","link":"#title","children":[]},{"level":3,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":3,"title":"frontmatter","slug":"frontmatter","link":"#frontmatter","children":[]},{"level":3,"title":"headers","slug":"headers","link":"#headers","children":[]},{"level":3,"title":"data","slug":"data","link":"#data","children":[]},{"level":3,"title":"content","slug":"content","link":"#content","children":[]},{"level":3,"title":"contentRendered","slug":"contentrendered","link":"#contentrendered","children":[]},{"level":3,"title":"date","slug":"date","link":"#date","children":[]},{"level":3,"title":"deps","slug":"deps","link":"#deps","children":[]},{"level":3,"title":"links","slug":"links","link":"#links","children":[]},{"level":3,"title":"pathInferred","slug":"pathinferred","link":"#pathinferred","children":[]},{"level":3,"title":"pathLocale","slug":"pathlocale","link":"#pathlocale","children":[]},{"level":3,"title":"permalink","slug":"permalink","link":"#permalink","children":[]},{"level":3,"title":"routeMeta","slug":"routemeta","link":"#routemeta","children":[]},{"level":3,"title":"sfcBlocks","slug":"sfcblocks","link":"#sfcblocks","children":[]},{"level":3,"title":"slug","slug":"slug","link":"#slug","children":[]},{"level":3,"title":"filePath","slug":"filepath","link":"#filepath","children":[]},{"level":3,"title":"filePathRelative","slug":"filepathrelative","link":"#filepathrelative","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":5.11,"words":1532},"filePathRelative":"reference/node-api.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/node-api.html-3f616fc7.js b/assets/node-api.html-3f616fc7.js new file mode 100644 index 00000000..c34d6c43 --- /dev/null +++ b/assets/node-api.html-3f616fc7.js @@ -0,0 +1,104 @@ +import{_ as c,W as u,X as d,Y as s,$ as n,a0 as a,Z as t,a1 as l,D as i}from"./framework-46b0e263.js";const r={},h=n("h1",{id:"node-api",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#node-api","aria-hidden":"true"},"#"),a(" Node API")],-1),k={href:"https://www.npmjs.com/package/@vuepress/core",target:"_blank",rel:"noopener noreferrer"},v={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},m=l(`
    npm i -D @vuepress/core@next
    +

    App

    `,2),b=l(`

    BuildAppDevApp 除了 builddev 方法外,拥有一样的属性和方法。

    createBuildApp

    • 函数签名:
    const createBuildApp: (config: AppConfig) => BuildApp;
    +
    • 参数:
    参数类型描述
    configAppConfig创建 VuePress App 的选项。
    • 详情:

      创建一个 Build 模式的 App 实例,用于构建静态文件。

    • 示例:

    const build = async () => {
    +  const app = createBuildApp({
    +    // ...配置项
    +  });
    +
    +  // 初始化和准备
    +  await app.init();
    +  await app.prepare();
    +
    +  // 构建
    +  await app.build();
    +
    +  // 处理 onGenerated hook
    +  await app.pluginApi.hooks.onGenerated.process(app);
    +};
    +

    createDevApp

    • 函数签名:
    const createDevApp: (config: AppConfig) => DevApp;
    +
    • 参数:
    参数类型描述
    configAppConfig创建 VuePress App 的选项。
    • 详情:

      创建一个 Dev 模式的 App 实例,用于启动开发服务器。

    • 示例:

    const dev = async () => {
    +  const app = createDevApp({
    +    // ...配置项
    +  });
    +
    +  // 初始化和准备
    +  await app.init();
    +  await app.prepare();
    +
    +  // 启动开发服务器
    +  const closeDevServer = await app.dev();
    +
    +  // 准备文件监听器
    +  const watchers = [];
    +
    +  // 重启开发服务器
    +  const restart = async () => {
    +    await Promise.all([
    +      // 关闭所有监听器
    +      ...watchers.map((item) => item.close()),
    +      // 关闭当前的开发服务器
    +      closeDevServer(),
    +    ]);
    +    await dev();
    +  };
    +
    +  // 处理 onWatched hook
    +  await app.pluginApi.hooks.onWatched.process(app, watchers, restart);
    +};
    +

    App 属性

    options

    • 类型: AppOptions

    • 详情:

      VuePress App 的配置项。

      这些配置项来自于 createBuildApp / createDevAppconfig 参数,但所有可选的字段都填充上了默认值。

    siteData

    `,21),g=n("li",null,[n("p",null,[a("类型: "),n("code",null,"SiteData")])],-1),_=n("p",null,"详情:",-1),f=l('

    version

    • 类型: string

    • 详情:

      VuePress App 的版本,即 @vuepress/core 包的版本。

    env.isBuild

    • 类型: boolean

    • 详情:

      用于判断 App 是否运行在 Build 模式的环境标记,即当前 App 是否是 BuildApp 实例。

    env.isDev

    • 类型: boolean

    • 详情:

      用于判断 App 是否运行在 Dev 模式的环境标记,即当前 App 是否是 DevApp 实例。

    env.isDebug

    • 类型: boolean

    • 详情:

      用于判断 App 是否开启 Debug 模式的环境标记。

    markdown

    ',9),y=n("li",null,[n("p",null,[a("类型: "),n("code",null,"MarkdownIt")])],-1),w=n("p",null,"详情:",-1),P={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},x=n("h3",{id:"pages",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#pages","aria-hidden":"true"},"#"),a(" pages")],-1),A=n("li",null,[n("p",null,[a("类型: "),n("code",null,"Page[]")])],-1),B=n("p",null,"详情:",-1),E=n("p",null,[n("a",{href:"#page"},"Page"),a(" 对象数组。")],-1),z=l(`

    App 方法

    dir

    • 工具函数:

      • dir.cache(): 解析至缓存目录
      • dir.temp(): 解析至临时文件目录
      • dir.source(): 解析至源文件目录
      • dir.dest(): 解析至输出目录
      • dir.client(): 解析至 @vuepress/client 目录
      • dir.public(): 解析至 Public 文件目录
    • 函数签名:

    type AppDirFunction = (...args: string[]) => string;
    +
    • 详情:

      用于解析对应目录下的文件绝对路径的一些工具函数。

      如果你不传入任何参数,就会返回对应目录的绝对路径。

    • 示例:

    // 解析 \`\${sourceDir}/README.md\` 文件的绝对路径
    +const homeSourceFile = app.dir.source("README.md");
    +

    writeTemp

    • 函数签名:
    writeTemp(file: string, content: string): Promise<string>
    +
    • 参数:
    参数类型描述
    filestring要写入的临时文件的路径,相对于临时文件目录。
    contentstring要写入的临时文件路径的内容。
    • 详情:

      用于写入临时文件的方法。

      写入的文件可以在客户端文件中通过 @temp 别名来引入。

    • 示例:

    export default {
    +  // 在 onPrepared hook 中写入临时文件
    +  async onPrepared() {
    +    await app.writeTemp("foo.js", "export const foo = 'bar'");
    +  },
    +};
    +
    // 在客户端文件中引入临时文件
    +import { foo } from "@temp/foo";
    +

    init

    • 函数签名:
    init(): Promise<void>
    +
    `,17),D=n("li",null,[n("p",null,"详情:"),n("p",null,"初始化 VuePress App 。")],-1),M=n("p",null,"参考:",-1),I=l(`

    prepare

    • 函数签名:
    prepare(): Promise<void>
    +
    `,3),F=n("li",null,[n("p",null,"详情:"),n("p",null,"准备客户端临时文件。")],-1),R=n("p",null,"参考:",-1),q=l(`

    build

    • 函数签名:
    build(): Promise<void>
    +
    `,3),N=n("li",null,[n("p",null,"详情:"),n("p",null,"生成静态站点文件。"),n("p",null,[a("该方法仅在 "),n("a",{href:"#createbuildapp"},"BuildApp"),a(" 中可用。")])],-1),V=n("p",null,"参考:",-1),C=l(`

    dev

    • 函数签名:
    dev(): Promise<() => Promise<void>>
    +
    `,3),H=n("li",null,[n("p",null,"详情:"),n("p",null,"启动开发服务器。"),n("p",null,[a("该方法仅在 "),n("a",{href:"#createdevapp"},"DevApp"),a(" 中可用。")])],-1),L=n("p",null,"参考:",-1),S=l(`

    Page

    createPage

    • 函数签名:
    const createPage: (app: App, options: PageOptions) => Promise<Page>;
    +
    • 参数:
    参数类型描述
    appAppVuePress App 实例。
    optionsPageOptions创建 VuePress Page 的选项。
    • 详情:

      创建一个 VuePress Page 对象。

    • 示例:

    import { createPage } from "@vuepress/core";
    +
    +export default {
    +  // 在 onInitialized hook 中创建一个额外页面
    +  async onInitialized(app) {
    +    app.pages.push(
    +      await createPage(app, {
    +        path: "/foo.html",
    +        frontmatter: {
    +          layout: "Layout",
    +        },
    +        content: \`\\
    +# 某个 Page
    +
    +你好,世界。
    +\`,
    +      })
    +    );
    +  },
    +};
    +
    `,8),j=n("li",null,[n("a",{href:"#pages"},"Node API > App 属性 > pages")],-1),T=n("h2",{id:"page-属性",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#page-属性","aria-hidden":"true"},"#"),a(" Page 属性")],-1),O=n("h3",{id:"key",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#key","aria-hidden":"true"},"#"),a(" key")],-1),W=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string")])],-1),G=n("p",null,"详情:",-1),$=n("p",null,"该 Page 的标识。",-1),K={href:"https://router.vuejs.org/api/#name-2",target:"_blank",rel:"noopener noreferrer"},U=n("p",null,"参考:",-1),X=n("h3",{id:"path",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#path","aria-hidden":"true"},"#"),a(" path")],-1),Y=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string")])],-1),Z=n("li",null,[n("p",null,"详情:"),n("p",null,"该 Page 的路由路径。")],-1),J=n("p",null,"参考:",-1),Q=n("li",null,[n("a",{href:"#pathinferred"},"Node API > Page 属性 > pathInferred")],-1),nn=n("h3",{id:"title",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#title","aria-hidden":"true"},"#"),a(" title")],-1),an=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string")])],-1),sn=n("li",null,[n("p",null,"详情:"),n("p",null,"该 Page 的标题。")],-1),en=n("p",null,"参考:",-1),tn=n("h3",{id:"lang",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#lang","aria-hidden":"true"},"#"),a(" lang")],-1),ln=l("
  • 类型: string

  • 详情:

    该 Page 的语言。

  • 示例:

    • 'en-US'
    • 'zh-CN'
  • ",3),pn=n("p",null,"参考:",-1),on=n("h3",{id:"frontmatter",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),a(" frontmatter")],-1),cn=n("li",null,[n("p",null,[a("类型: "),n("code",null,"PageFrontmatter")])],-1),un=n("li",null,[n("p",null,"详情:"),n("p",null,"该 Page 的 Frontmatter 。")],-1),dn=n("p",null,"参考:",-1),rn=l(`

    headers

    • 类型: PageHeader[]
    interface PageHeader {
    +  level: number;
    +  title: string;
    +  slug: string;
    +  children: PageHeader[];
    +}
    +
    `,3),hn=n("li",null,[n("p",null,"详情:"),n("p",null,"该 Page 的小标题。")],-1),kn=n("p",null,"参考:",-1),vn=l(`

    data

    • 类型: PageData
    interface PageData {
    +  key: string;
    +  path: string;
    +  title: string;
    +  lang: string;
    +  frontmatter: PageFrontmatter;
    +  headers: PageHeader[];
    +}
    +
    `,3),mn=n("li",null,[n("p",null,"详情:"),n("p",null,"该 Page 的数据。"),n("p",null,"Page 数据可以在客户端代码中使用。")],-1),bn=n("p",null,"参考:",-1),gn=l('

    content

    • 类型: string

    • 详情:

      该 Page 的未经渲染的原始内容。

    contentRendered

    • 类型: string

    • 详情:

      该 Page 的渲染后的内容。

    date

    ',5),_n=l("
  • 类型: string

  • 详情:

    该 Page 的日期,遵从 'yyyy-MM-dd' 格式。

  • 示例:

    • '0000-00-00'
    • '2021-08-16'
  • ",3),fn=n("p",null,"参考:",-1),yn=n("h3",{id:"deps",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#deps","aria-hidden":"true"},"#"),a(" deps")],-1),wn=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string[]")])],-1),Pn=n("li",null,[n("p",null,"详情:"),n("p",null,"该 Page 的依赖。"),n("p",null,[a("举例来说,如果在页面中导入了代码片段,那么被导入文件的绝对路径就会被添加到 "),n("code",null,"deps"),a(" 中。")])],-1),xn=n("p",null,"参考:",-1),An=l(`
    • 类型: MarkdownLink[]
    interface MarkdownLink {
    +  raw: string;
    +  relative: string;
    +  absolute: string;
    +}
    +
    • 详情:

      该 Page 中的链接。

    pathInferred

    `,5),Bn=l('
  • 类型: string | null

  • 详情:

    该 Page 根据文件路径推断出的路由路径。

    默认情况下,路由路径是根据 Markdown 源文件的相对文件路径推断出来的。然而,用户可能会显式指定页面路由,比如通过 permalink 来指定该页面最终使用的路由路径。因此我们在 Page 属性中保留推断出来的路径,以便于你在某些情况下可能会用到它。

    如果该 Page 不是来自于 Markdown 源文件,那么该属性会为 null

  • 示例:

    • '/'
    • '/foo.html'
  • ',3),En=n("p",null,"参考:",-1),zn=n("li",null,[n("a",{href:"#path"},"Node API > Page 属性 > path")],-1),Dn=n("h3",{id:"pathlocale",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#pathlocale","aria-hidden":"true"},"#"),a(" pathLocale")],-1),Mn=l("
  • 类型: string

  • 详情:

    该 Page 路由路径的 Locale 前缀。

    它是根据页面的 Markdown 源文件相对路径、以及用户配置的 locales 的键推断得到的。

  • 示例:

    • '/'
    • '/en/'
    • '/zh/'
  • ",3),In=n("p",null,"参考:",-1),Fn=n("h3",{id:"permalink",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#permalink","aria-hidden":"true"},"#"),a(" permalink")],-1),Rn=n("li",null,[n("p",null,[a("类型: "),n("code",null,"string | null")])],-1),qn=n("li",null,[n("p",null,"详情:"),n("p",null,"该 Page 的永久链接。")],-1),Nn=n("p",null,"参考:",-1),Vn=n("h3",{id:"routemeta",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#routemeta","aria-hidden":"true"},"#"),a(" routeMeta")],-1),Cn=n("li",null,[n("p",null,[a("类型: "),n("code",null,"Record")])],-1),Hn=n("li",null,[n("p",null,"详情:"),n("p",null,"附加到 vue-router 路由记录上的额外数据。")],-1),Ln=n("p",null,"参考:",-1),Sn={href:"https://router.vuejs.org/zh/api/#meta",target:"_blank",rel:"noopener noreferrer"},jn=l('

    Route Meta 和 Page Data 的区别是什么?

    Route MetaPage Data 都可以在客户端代码中使用。然而, Route Meta 是附加在路由记录上的,因此当用户进入你的站点时,所有页面的 Route Meta 都会立即被加载。相比之下, Page Data 是存储在单独的文件中的,只有在用户进入对应页面时才会被加载。

    因此,不建议在 Route Meta 中存储大量的信息,否则在站点有很多页面时,将会影响站点的初始加载速度。

    sfcBlocks

    ',2),Tn=n("li",null,[n("p",null,[a("类型: "),n("code",null,"MarkdownSfcBlocks")])],-1),On=n("li",null,[n("p",null,"详情:"),n("p",null,"该 Page 中提取出的 Vue SFC Blocks 。")],-1),Wn=n("p",null,"参考:",-1),Gn=l('

    slug

    • 类型: string

    • 详情:

      该 Page 的 Slug 。

      它是根据页面的 Markdown 源文件的文件名推断得到的。

    filePath

    • 类型: string | null

    • 详情:

      该 Page 的 Markdown 源文件的绝对路径。

      如果该 Page 不是来自于 Markdown 源文件,那么该属性会为 null

    filePathRelative

    • 类型: string | null

    • 详情:

      该 Page 的 Markdown 源文件的相对路径。

      如果该 Page 不是来自于 Markdown 源文件,那么该属性会为 null

    ',6);function $n(Kn,Un){const o=i("NpmBadge"),p=i("ExternalLinkIcon"),e=i("RouterLink");return u(),d("div",null,[h,s(o,{package:"@vuepress/core"}),n("p",null,[a("Node API 是由 "),n("a",k,[a("@vuepress/core"),s(p)]),a(" 包提供的。它是 "),n("a",v,[a("vuepress"),s(p)]),a(" 包的依赖之一,当然你也可以单独安装它:")]),m,n("p",null,[s(e,{to:"/zh/reference/plugin-api.html"},{default:t(()=>[a("插件 API")]),_:1}),a(" 的所有 Hooks 中都可以获取到 App 实例。")]),b,n("ul",null,[g,n("li",null,[_,n("p",null,[a("由用户设置的站点数据,包含所有的 "),s(e,{to:"/zh/reference/config.html#%E7%AB%99%E7%82%B9%E9%85%8D%E7%BD%AE"},{default:t(()=>[a("站点配置")]),_:1}),a(" ,可以在客户端代码中使用。")])])]),f,n("ul",null,[y,n("li",null,[w,n("p",null,[a("用于解析 Markdown 内容的 "),n("a",P,[a("markdown-it"),s(p)]),a(" 实例。")]),n("p",null,[a("它仅在 "),s(e,{to:"/zh/reference/plugin-api.html#oninitialized"},{default:t(()=>[a("onInitialized")]),_:1}),a(" 以及之后的 Hooks 中才可用。")])])]),x,n("ul",null,[A,n("li",null,[B,E,n("p",null,[a("它仅在 "),s(e,{to:"/zh/reference/plugin-api.html#oninitialized"},{default:t(()=>[a("onInitialized")]),_:1}),a(" 以及之后的 Hooks 中才可用。")])])]),z,n("ul",null,[D,n("li",null,[M,n("ul",null,[n("li",null,[s(e,{to:"/zh/advanced/architecture.html#%E6%A0%B8%E5%BF%83%E6%B5%81%E7%A8%8B%E4%B8%8E-hooks"},{default:t(()=>[a("深入 > 架构 > 核心流程与 Hooks")]),_:1})])])])]),I,n("ul",null,[F,n("li",null,[R,n("ul",null,[n("li",null,[s(e,{to:"/zh/advanced/architecture.html#%E6%A0%B8%E5%BF%83%E6%B5%81%E7%A8%8B%E4%B8%8E-hooks"},{default:t(()=>[a("深入 > 架构 > 核心流程与 Hooks")]),_:1})])])])]),q,n("ul",null,[N,n("li",null,[V,n("ul",null,[n("li",null,[s(e,{to:"/zh/advanced/architecture.html#%E6%A0%B8%E5%BF%83%E6%B5%81%E7%A8%8B%E4%B8%8E-hooks"},{default:t(()=>[a("深入 > 架构 > 核心流程与 Hooks")]),_:1})])])])]),C,n("ul",null,[H,n("li",null,[L,n("ul",null,[n("li",null,[s(e,{to:"/zh/advanced/architecture.html#%E6%A0%B8%E5%BF%83%E6%B5%81%E7%A8%8B%E4%B8%8E-hooks"},{default:t(()=>[a("深入 > 架构 > 核心流程与 Hooks")]),_:1})])])])]),S,n("ul",null,[n("li",null,[a("参考: "),n("ul",null,[j,n("li",null,[s(e,{to:"/zh/advanced/cookbook/adding-extra-pages.html"},{default:t(()=>[a("Cookbook > 添加额外页面")]),_:1})])])])]),T,O,n("ul",null,[W,n("li",null,[G,$,n("p",null,[a("Page Key 会被用作页面路由的 "),n("a",K,[a("name"),s(p)]),a("。")])]),n("li",null,[U,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/components.html#content"},{default:t(()=>[a("Built-in Components > Content")]),_:1})])])])]),X,n("ul",null,[Y,Z,n("li",null,[J,n("ul",null,[n("li",null,[s(e,{to:"/zh/guide/page.html#%E8%B7%AF%E7%94%B1"},{default:t(()=>[a("指南 > 页面 > 路由")]),_:1})]),Q])])]),nn,n("ul",null,[an,sn,n("li",null,[en,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/frontmatter.html#title"},{default:t(()=>[a("Frontmatter > title")]),_:1})])])])]),tn,n("ul",null,[ln,n("li",null,[pn,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/frontmatter.html#title"},{default:t(()=>[a("Frontmatter > lang")]),_:1})])])])]),on,n("ul",null,[cn,un,n("li",null,[dn,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/frontmatter.html"},{default:t(()=>[a("Frontmatter")]),_:1})])])])]),rn,n("ul",null,[hn,n("li",null,[kn,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/config.html#markdown-headers"},{default:t(()=>[a("配置 > markdown.headers")]),_:1})])])])]),vn,n("ul",null,[mn,n("li",null,[bn,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/client-api.html#usepagedata"},{default:t(()=>[a("客户端 API > usePageData")]),_:1})]),n("li",null,[s(e,{to:"/zh/reference/plugin-api.html#extendspage"},{default:t(()=>[a("插件 API > extendsPage")]),_:1})])])])]),gn,n("ul",null,[_n,n("li",null,[fn,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/frontmatter.html#date"},{default:t(()=>[a("Frontmatter > date")]),_:1})])])])]),yn,n("ul",null,[wn,Pn,n("li",null,[xn,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/config.html#markdown-importcode"},{default:t(()=>[a("配置 > markdown.importCode")]),_:1})])])])]),An,n("ul",null,[Bn,n("li",null,[En,n("ul",null,[n("li",null,[s(e,{to:"/zh/guide/page.html#%E8%B7%AF%E7%94%B1"},{default:t(()=>[a("指南 > 页面 > 路由")]),_:1})]),zn])])]),Dn,n("ul",null,[Mn,n("li",null,[In,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/config.html#locales"},{default:t(()=>[a("配置 > locales")]),_:1})])])])]),Fn,n("ul",null,[Rn,qn,n("li",null,[Nn,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/frontmatter.html#permalink"},{default:t(()=>[a("Frontmatter > permalink")]),_:1})]),n("li",null,[s(e,{to:"/zh/reference/frontmatter.html#permalinkpattern"},{default:t(()=>[a("Frontmatter > permalinkPattern")]),_:1})])])])]),Vn,n("ul",null,[Cn,Hn,n("li",null,[Ln,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/frontmatter.html#routemeta"},{default:t(()=>[a("Frontmatter > routeMeta")]),_:1})]),n("li",null,[n("a",Sn,[a("vue-router > API 参考 > RouteRecordRaw > meta"),s(p)])])])])]),jn,n("ul",null,[Tn,On,n("li",null,[Wn,n("ul",null,[n("li",null,[s(e,{to:"/zh/reference/config.html#markdown-sfc"},{default:t(()=>[a("配置 > markdown.sfc")]),_:1})])])])]),Gn])}const Yn=c(r,[["render",$n],["__file","node-api.html.vue"]]);export{Yn as default}; diff --git a/assets/node-api.html-85bdab9d.js b/assets/node-api.html-85bdab9d.js new file mode 100644 index 00000000..3010fc06 --- /dev/null +++ b/assets/node-api.html-85bdab9d.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-e19cff04","path":"/zh/reference/node-api.html","title":"Node API","lang":"zh-CN","frontmatter":{"icon":"fa6-brands:node-js","description":"Node API 是由 @vuepress/core (https://www.npmjs.com/package/@vuepress/core) 包提供的。它是 vuepress (https://www.npmjs.com/package/vuepress) 包的依赖之一,当然你也可以单独安装它: App 插件 API (./plugin-api....","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/node-api.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/node-api.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Node API"}],["meta",{"property":"og:description","content":"Node API 是由 @vuepress/core (https://www.npmjs.com/package/@vuepress/core) 包提供的。它是 vuepress (https://www.npmjs.com/package/vuepress) 包的依赖之一,当然你也可以单独安装它: App 插件 API (./plugin-api...."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Node API\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"App","slug":"app","link":"#app","children":[{"level":3,"title":"createBuildApp","slug":"createbuildapp","link":"#createbuildapp","children":[]},{"level":3,"title":"createDevApp","slug":"createdevapp","link":"#createdevapp","children":[]}]},{"level":2,"title":"App 属性","slug":"app-属性","link":"#app-属性","children":[{"level":3,"title":"options","slug":"options","link":"#options","children":[]},{"level":3,"title":"siteData","slug":"sitedata","link":"#sitedata","children":[]},{"level":3,"title":"version","slug":"version","link":"#version","children":[]},{"level":3,"title":"env.isBuild","slug":"env-isbuild","link":"#env-isbuild","children":[]},{"level":3,"title":"env.isDev","slug":"env-isdev","link":"#env-isdev","children":[]},{"level":3,"title":"env.isDebug","slug":"env-isdebug","link":"#env-isdebug","children":[]},{"level":3,"title":"markdown","slug":"markdown","link":"#markdown","children":[]},{"level":3,"title":"pages","slug":"pages","link":"#pages","children":[]}]},{"level":2,"title":"App 方法","slug":"app-方法","link":"#app-方法","children":[{"level":3,"title":"dir","slug":"dir","link":"#dir","children":[]},{"level":3,"title":"writeTemp","slug":"writetemp","link":"#writetemp","children":[]},{"level":3,"title":"init","slug":"init","link":"#init","children":[]},{"level":3,"title":"prepare","slug":"prepare","link":"#prepare","children":[]},{"level":3,"title":"build","slug":"build","link":"#build","children":[]},{"level":3,"title":"dev","slug":"dev","link":"#dev","children":[]}]},{"level":2,"title":"Page","slug":"page","link":"#page","children":[{"level":3,"title":"createPage","slug":"createpage","link":"#createpage","children":[]}]},{"level":2,"title":"Page 属性","slug":"page-属性","link":"#page-属性","children":[{"level":3,"title":"key","slug":"key","link":"#key","children":[]},{"level":3,"title":"path","slug":"path","link":"#path","children":[]},{"level":3,"title":"title","slug":"title","link":"#title","children":[]},{"level":3,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":3,"title":"frontmatter","slug":"frontmatter","link":"#frontmatter","children":[]},{"level":3,"title":"headers","slug":"headers","link":"#headers","children":[]},{"level":3,"title":"data","slug":"data","link":"#data","children":[]},{"level":3,"title":"content","slug":"content","link":"#content","children":[]},{"level":3,"title":"contentRendered","slug":"contentrendered","link":"#contentrendered","children":[]},{"level":3,"title":"date","slug":"date","link":"#date","children":[]},{"level":3,"title":"deps","slug":"deps","link":"#deps","children":[]},{"level":3,"title":"links","slug":"links","link":"#links","children":[]},{"level":3,"title":"pathInferred","slug":"pathinferred","link":"#pathinferred","children":[]},{"level":3,"title":"pathLocale","slug":"pathlocale","link":"#pathlocale","children":[]},{"level":3,"title":"permalink","slug":"permalink","link":"#permalink","children":[]},{"level":3,"title":"routeMeta","slug":"routemeta","link":"#routemeta","children":[]},{"level":3,"title":"sfcBlocks","slug":"sfcblocks","link":"#sfcblocks","children":[]},{"level":3,"title":"slug","slug":"slug","link":"#slug","children":[]},{"level":3,"title":"filePath","slug":"filepath","link":"#filepath","children":[]},{"level":3,"title":"filePathRelative","slug":"filepathrelative","link":"#filepathrelative","children":[]}]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":7.06,"words":2118},"filePathRelative":"zh/reference/node-api.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/node-api.html-d6fde234.js b/assets/node-api.html-d6fde234.js new file mode 100644 index 00000000..bcd027fa --- /dev/null +++ b/assets/node-api.html-d6fde234.js @@ -0,0 +1,104 @@ +import{_ as c,W as r,X as d,Y as a,$ as n,a0 as e,Z as t,a1 as l,D as o}from"./framework-46b0e263.js";const u={},h=n("h1",{id:"node-api",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#node-api","aria-hidden":"true"},"#"),e(" Node API")],-1),k={href:"https://www.npmjs.com/package/@vuepress/core",target:"_blank",rel:"noopener noreferrer"},v={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},m=l(`
    npm i -D @vuepress/core@next
    +

    App

    `,2),f=l(`

    The BuildApp and DevApp share almost the same properties and methods, except build and dev method.

    createBuildApp

    • Signature:
    const createBuildApp: (config: AppConfig) => BuildApp;
    +
    • Parameters:
    ParameterTypeDescription
    configAppConfigConfig to create a VuePress app.
    • Details:

      Create a build mode app instance, which is used for building static files.

    • Example:

    const build = async () => {
    +  const app = createBuildApp({
    +    // ...options
    +  });
    +
    +  // initialize and prepare
    +  await app.init();
    +  await app.prepare();
    +
    +  // build
    +  await app.build();
    +
    +  // process onGenerated hook
    +  await app.pluginApi.hooks.onGenerated.process(app);
    +};
    +

    createDevApp

    • Signature:
    const createDevApp: (config: AppConfig) => DevApp;
    +
    • Parameters:
    ParameterTypeDescription
    configAppConfigConfig to create a VuePress app.
    • Details:

      Create a dev mode app instance, which is used for starting a dev server.

    • Example:

    const dev = async () => {
    +  const app = createDevApp({
    +    // ...options
    +  });
    +
    +  // initialize and prepare
    +  await app.init();
    +  await app.prepare();
    +
    +  // start dev server
    +  const closeDevServer = await app.dev();
    +
    +  // set up file watchers
    +  const watchers = [];
    +
    +  // restart dev server
    +  const restart = async () => {
    +    await Promise.all([
    +      // close all watchers
    +      ...watchers.map((item) => item.close()),
    +      // close current dev server
    +      closeDevServer(),
    +    ]);
    +    await dev();
    +  };
    +
    +  // process onWatched hook
    +  await app.pluginApi.hooks.onWatched.process(app, watchers, restart);
    +};
    +

    App Properties

    options

    • Type: AppOptions

    • Details:

      Options of VuePress app.

      The options come from the config argument in createBuildApp / createDevApp, while all optional fields will be filled with a default value.

    siteData

    `,21),g=n("li",null,[n("p",null,[e("Type: "),n("code",null,"SiteData")])],-1),b=n("p",null,"Details:",-1),_=l('

    version

    • Type: string

    • Details:

      Version of VuePress app, i.e. version of @vuepress/core package.

    env.isBuild

    • Type: boolean

    • Details:

      Environment flag used to identify whether the app is running in build mode, i.e. whether a BuildApp instance.

    env.isDev

    • Type: boolean

    • Details:

      Environment flag used to identify whether the app is running in dev mode, i.e. whether a DevApp instance.

    env.isDebug

    • Type: boolean

    • Details:

      Environment flag used to identify whether the debug mode is enabled.

    markdown

    ',9),y=n("li",null,[n("p",null,[e("Type: "),n("code",null,"MarkdownIt")])],-1),w=n("p",null,"Details:",-1),x={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},A=n("h3",{id:"pages",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#pages","aria-hidden":"true"},"#"),e(" pages")],-1),P=n("li",null,[n("p",null,[e("Type: "),n("code",null,"Page[]")])],-1),D=n("p",null,"Details:",-1),T=n("p",null,[e("The "),n("a",{href:"#page"},"Page"),e(" object array.")],-1),I=l(`

    App Methods

    dir

    • Utils:

      • dir.cache(): resolve to cache directory
      • dir.temp(): resolve to temp directory
      • dir.source(): resolve to source directory
      • dir.dest(): resolve to dest directory
      • dir.client(): resolve to @vuepress/client directory
      • dir.public(): resolve to public directory
    • Signature:

    type AppDirFunction = (...args: string[]) => string;
    +
    • Details:

      Utils to resolve the absolute file path in corresponding directory.

      If you don't provide any arguments, it will return the absolute path of the directory.

    • Example:

    // resolve the absolute file path of the \`\${sourceDir}/README.md\`
    +const homeSourceFile = app.dir.source("README.md");
    +

    writeTemp

    • Signature:
    writeTemp(file: string, content: string): Promise<string>
    +
    • Parameters:
    ParameterTypeDescription
    filestringFilepath of the temp file that going to be written. Relative to temp directory.
    contentstringContent of the temp file that going to be written.
    • Details:

      A method to write temp file.

      The written file could be imported via @temp alias in client files.

    • Example:

    export default {
    +  // write temp file in onPrepared hook
    +  async onPrepared() {
    +    await app.writeTemp("foo.js", "export const foo = 'bar'");
    +  },
    +};
    +
    // import temp file in client code
    +import { foo } from "@temp/foo";
    +

    init

    • Signature:
    init(): Promise<void>
    +
    `,17),C=n("li",null,[n("p",null,"Details:"),n("p",null,"Initialize VuePress app.")],-1),E=n("p",null,"Also see:",-1),M=l(`

    prepare

    • Signature:
    prepare(): Promise<void>
    +
    `,3),S=n("li",null,[n("p",null,"Details:"),n("p",null,"Prepare client temp files.")],-1),B=n("p",null,"Also see:",-1),R=l(`

    build

    • Signature:
    build(): Promise<void>
    +
    `,3),F=n("li",null,[n("p",null,"Details:"),n("p",null,"Generate static site files."),n("p",null,[e("This method is only available in "),n("code",null,"BuildApp"),e(".")])],-1),N=n("p",null,"Also see:",-1),q=n("li",null,[n("a",{href:"#createbuildapp"},"Node API > App > createBuildApp")],-1),V=l(`

    dev

    • Signature:
    dev(): Promise<() => Promise<void>>
    +
    `,3),H=n("li",null,[n("p",null,"Details:"),n("p",null,"Start dev server."),n("p",null,[e("This method is only available in "),n("code",null,"DevApp"),e(".")])],-1),z=n("p",null,"Also see:",-1),L=n("li",null,[n("a",{href:"#createdevapp"},"Node API > App > createDevApp")],-1),j=l(`

    Page

    createPage

    • Signature:
    const createPage: (app: App, options: PageOptions) => Promise<Page>;
    +
    • Parameters:
    ParameterTypeDescription
    appAppThe VuePress app instance.
    optionsPageOptionsOptions to create VuePress page.
    • Details:

      Create a VuePress page object.

    • Example:

    import { createPage } from "@vuepress/core";
    +
    +export default {
    +  // create an extra page in onInitialized hook
    +  async onInitialized(app) {
    +    app.pages.push(
    +      await createPage(app, {
    +        path: "/foo.html",
    +        frontmatter: {
    +          layout: "Layout",
    +        },
    +        content: \`\\
    +# Foo Page
    +
    +Hello, world.
    +\`,
    +      })
    +    );
    +  },
    +};
    +
    `,8),G=n("li",null,[n("a",{href:"#pages"},"Node API > App Properties > pages")],-1),O=n("h2",{id:"page-properties",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#page-properties","aria-hidden":"true"},"#"),e(" Page Properties")],-1),W=n("h3",{id:"key",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#key","aria-hidden":"true"},"#"),e(" key")],-1),U=n("li",null,[n("p",null,[e("Type: "),n("code",null,"string")])],-1),$=n("p",null,"Details:",-1),X=n("p",null,"Identifier of the page.",-1),Y={href:"https://router.vuejs.org/api/#name-2",target:"_blank",rel:"noopener noreferrer"},Z=n("p",null,"Also see:",-1),J=n("h3",{id:"path",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#path","aria-hidden":"true"},"#"),e(" path")],-1),K=n("li",null,[n("p",null,[e("Type: "),n("code",null,"string")])],-1),Q=n("li",null,[n("p",null,"Details:"),n("p",null,"Route path of the page.")],-1),nn=n("p",null,"Also see:",-1),en=n("li",null,[n("a",{href:"#pathinferred"},"Node API > Page Properties > pathInferred")],-1),an=n("h3",{id:"title",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#title","aria-hidden":"true"},"#"),e(" title")],-1),sn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"string")])],-1),tn=n("li",null,[n("p",null,"Details:"),n("p",null,"Title of the page.")],-1),ln=n("p",null,"Also see:",-1),on=n("h3",{id:"lang",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#lang","aria-hidden":"true"},"#"),e(" lang")],-1),pn=l("
  • Type: string

  • Details:

    Language of the page.

  • Example:

    • 'en-US'
    • 'zh-CN'
  • ",3),cn=n("p",null,"Also see:",-1),rn=n("h3",{id:"frontmatter",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),e(" frontmatter")],-1),dn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"PageFrontmatter")])],-1),un=n("li",null,[n("p",null,"Details:"),n("p",null,"Frontmatter of the page.")],-1),hn=n("p",null,"Also see:",-1),kn=l(`

    headers

    • Type: PageHeader[]
    interface PageHeader {
    +  level: number;
    +  title: string;
    +  slug: string;
    +  children: PageHeader[];
    +}
    +
    `,3),vn=n("li",null,[n("p",null,"Details:"),n("p",null,"Headers of the page.")],-1),mn=n("p",null,"Also see:",-1),fn=l(`

    data

    • Type: PageData
    interface PageData {
    +  key: string;
    +  path: string;
    +  title: string;
    +  lang: string;
    +  frontmatter: PageFrontmatter;
    +  headers: PageHeader[];
    +}
    +
    `,3),gn=n("li",null,[n("p",null,"Details:"),n("p",null,"Data of the page."),n("p",null,"Page data would be available in client side.")],-1),bn=n("p",null,"Also see:",-1),_n=l('

    content

    • Type: string

    • Details:

      Raw content of the page.

    contentRendered

    • Type: string

    • Details:

      Rendered content of the page.

    date

    ',5),yn=l("
  • Type: string

  • Details:

    Date of the page, in 'yyyy-MM-dd' format.

  • Example:

    • '0000-00-00'
    • '2021-08-16'
  • ",3),wn=n("p",null,"Also see:",-1),xn=n("h3",{id:"deps",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#deps","aria-hidden":"true"},"#"),e(" deps")],-1),An=n("li",null,[n("p",null,[e("Type: "),n("code",null,"string[]")])],-1),Pn=n("li",null,[n("p",null,"Details:"),n("p",null,"Dependencies of the page."),n("p",null,[e("For example, if users import code snippet in the page, the absolute file path of the imported file would be added to "),n("code",null,"deps"),e(".")])],-1),Dn=n("p",null,"Also see:",-1),Tn=l(`
    • Type: MarkdownLink[]
    interface MarkdownLink {
    +  raw: string;
    +  relative: string;
    +  absolute: string;
    +}
    +
    • Details:

      Links of the page.

    pathInferred

    `,5),In=l('
  • Type: string | null

  • Details:

    Route path of the page that inferred from file path.

    By default, the route path is inferred from the relative file path of the Markdown source file. However, users may explicitly set the route path, e.g. permalink, which would be used as the final route path of the page. So we keep the inferred path as a page property in case you may need it.

    It would be null if the page does not come from a Markdown source file.

  • Example:

    • '/'
    • '/foo.html'
  • ',3),Cn=n("p",null,"Also see:",-1),En=n("li",null,[n("a",{href:"#path"},"Node API > Page Properties > path")],-1),Mn=n("h3",{id:"pathlocale",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#pathlocale","aria-hidden":"true"},"#"),e(" pathLocale")],-1),Sn=l("
  • Type: string

  • Details:

    Locale prefix of the page route path.

    It is inferred from the relative file path of the Markdown source file and the key of locales option in user config.

  • Example:

    • '/'
    • '/en/'
    • '/zh/'
  • ",3),Bn=n("p",null,"Also see:",-1),Rn=n("h3",{id:"permalink",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#permalink","aria-hidden":"true"},"#"),e(" permalink")],-1),Fn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"string | null")])],-1),Nn=n("li",null,[n("p",null,"Details:"),n("p",null,"Permalink of the page.")],-1),qn=n("p",null,"Also see:",-1),Vn=n("h3",{id:"routemeta",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#routemeta","aria-hidden":"true"},"#"),e(" routeMeta")],-1),Hn=n("li",null,[n("p",null,[e("Type: "),n("code",null,"Record")])],-1),zn=n("li",null,[n("p",null,"Details:"),n("p",null,"Custom data to be attached to the route record of vue-router.")],-1),Ln=n("p",null,"Also see:",-1),jn={href:"https://router.vuejs.org/api/#meta",target:"_blank",rel:"noopener noreferrer"},Gn=l('

    What's the difference between route meta and page data?

    Both route meta and page data is available in client side. However, route meta is attached to the route record, so the route meta of all pages would be loaded at once when users enter your site. In the contrast, page data is saved in separated files, which would be loaded only when users enter the corresponding page.

    Therefore, it's not recommended to store large amounts of info into route meta, otherwise the initial loading speed will be affected a lot when your site has a large number of pages.

    sfcBlocks

    ',2),On=n("li",null,[n("p",null,[e("Type: "),n("code",null,"MarkdownSfcBlocks")])],-1),Wn=n("li",null,[n("p",null,"Details:"),n("p",null,"Extracted vue SFC blocks of the page.")],-1),Un=n("p",null,"Also see:",-1),$n=l('

    slug

    • Type: string

    • Details:

      Slug of the page.

      It is inferred from the filename of the Markdown source file.

    filePath

    • Type: string | null

    • Details:

      Absolute path of the Markdown source file of the page.

      It would be null if the page does not come from a Markdown source file.

    filePathRelative

    • Type: string | null

    • Details:

      Relative path of the Markdown source file of the page.

      It would be null if the page does not come from a Markdown source file.

    ',6);function Xn(Yn,Zn){const p=o("NpmBadge"),i=o("ExternalLinkIcon"),s=o("RouterLink");return r(),d("div",null,[h,a(p,{package:"@vuepress/core"}),n("p",null,[e("Node API is provided by "),n("a",k,[e("@vuepress/core"),a(i)]),e(" package. It is a dependency of the "),n("a",v,[e("vuepress"),a(i)]),e(" package, and you can also install it separately:")]),m,n("p",null,[e("The app instance is available in all hooks of "),a(s,{to:"/reference/plugin-api.html"},{default:t(()=>[e("Plugin API")]),_:1}),e(".")]),f,n("ul",null,[g,n("li",null,[b,n("p",null,[e("Site data that set by user, including all the "),a(s,{to:"/reference/config.html#site-config"},{default:t(()=>[e("site config")]),_:1}),e(", which will be used in client side.")])])]),_,n("ul",null,[y,n("li",null,[w,n("p",null,[e("The "),n("a",x,[e("markdown-it"),a(i)]),e(" instance used for parsing markdown content.")]),n("p",null,[e("It is only available in and after "),a(s,{to:"/reference/plugin-api.html#oninitialized"},{default:t(()=>[e("onInitialized")]),_:1}),e(" hook.")])])]),A,n("ul",null,[P,n("li",null,[D,T,n("p",null,[e("It is only available in and after "),a(s,{to:"/reference/plugin-api.html#oninitialized"},{default:t(()=>[e("onInitialized")]),_:1}),e(" hook.")])])]),I,n("ul",null,[C,n("li",null,[E,n("ul",null,[n("li",null,[a(s,{to:"/advanced/architecture.html#core-process-and-hooks"},{default:t(()=>[e("Advanced > Architecture > Core Process and Hooks")]),_:1})])])])]),M,n("ul",null,[S,n("li",null,[B,n("ul",null,[n("li",null,[a(s,{to:"/advanced/architecture.html#core-process-and-hooks"},{default:t(()=>[e("Advanced > Architecture > Core Process and Hooks")]),_:1})])])])]),R,n("ul",null,[F,n("li",null,[N,n("ul",null,[q,n("li",null,[a(s,{to:"/advanced/architecture.html#core-process-and-hooks"},{default:t(()=>[e("Advanced > Architecture > Core Process and Hooks")]),_:1})])])])]),V,n("ul",null,[H,n("li",null,[z,n("ul",null,[L,n("li",null,[a(s,{to:"/advanced/architecture.html#core-process-and-hooks"},{default:t(()=>[e("Advanced > Architecture > Core Process and Hooks")]),_:1})])])])]),j,n("ul",null,[n("li",null,[e("Also see: "),n("ul",null,[G,n("li",null,[a(s,{to:"/advanced/cookbook/adding-extra-pages.html"},{default:t(()=>[e("Cookbook > Adding Extra Pages")]),_:1})])])])]),O,W,n("ul",null,[U,n("li",null,[$,X,n("p",null,[e("The page key would be used as the "),n("a",Y,[e("name"),a(i)]),e(" of the page route.")])]),n("li",null,[Z,n("ul",null,[n("li",null,[a(s,{to:"/reference/components.html#content"},{default:t(()=>[e("Built-in Components > Content")]),_:1})])])])]),J,n("ul",null,[K,Q,n("li",null,[nn,n("ul",null,[n("li",null,[a(s,{to:"/guide/page.html#routing"},{default:t(()=>[e("Guide > Page > Routing")]),_:1})]),en])])]),an,n("ul",null,[sn,tn,n("li",null,[ln,n("ul",null,[n("li",null,[a(s,{to:"/reference/frontmatter.html#title"},{default:t(()=>[e("Frontmatter > title")]),_:1})])])])]),on,n("ul",null,[pn,n("li",null,[cn,n("ul",null,[n("li",null,[a(s,{to:"/reference/frontmatter.html#title"},{default:t(()=>[e("Frontmatter > lang")]),_:1})])])])]),rn,n("ul",null,[dn,un,n("li",null,[hn,n("ul",null,[n("li",null,[a(s,{to:"/reference/frontmatter.html"},{default:t(()=>[e("Frontmatter")]),_:1})])])])]),kn,n("ul",null,[vn,n("li",null,[mn,n("ul",null,[n("li",null,[a(s,{to:"/reference/config.html#markdown-headers"},{default:t(()=>[e("Config > markdown.headers")]),_:1})])])])]),fn,n("ul",null,[gn,n("li",null,[bn,n("ul",null,[n("li",null,[a(s,{to:"/reference/client-api.html#usepagedata"},{default:t(()=>[e("Client API > usePageData")]),_:1})]),n("li",null,[a(s,{to:"/reference/plugin-api.html#extendspage"},{default:t(()=>[e("Plugin API > extendsPage")]),_:1})])])])]),_n,n("ul",null,[yn,n("li",null,[wn,n("ul",null,[n("li",null,[a(s,{to:"/reference/frontmatter.html#date"},{default:t(()=>[e("Frontmatter > date")]),_:1})])])])]),xn,n("ul",null,[An,Pn,n("li",null,[Dn,n("ul",null,[n("li",null,[a(s,{to:"/reference/config.html#markdown-importcode"},{default:t(()=>[e("Config > markdown.importCode")]),_:1})])])])]),Tn,n("ul",null,[In,n("li",null,[Cn,n("ul",null,[n("li",null,[a(s,{to:"/guide/page.html#routing"},{default:t(()=>[e("Guide > Page > Routing")]),_:1})]),En])])]),Mn,n("ul",null,[Sn,n("li",null,[Bn,n("ul",null,[n("li",null,[a(s,{to:"/reference/config.html#locales"},{default:t(()=>[e("Config > locales")]),_:1})])])])]),Rn,n("ul",null,[Fn,Nn,n("li",null,[qn,n("ul",null,[n("li",null,[a(s,{to:"/reference/frontmatter.html#permalink"},{default:t(()=>[e("Frontmatter > permalink")]),_:1})]),n("li",null,[a(s,{to:"/reference/frontmatter.html#permalinkpattern"},{default:t(()=>[e("Frontmatter > permalinkPattern")]),_:1})])])])]),Vn,n("ul",null,[Hn,zn,n("li",null,[Ln,n("ul",null,[n("li",null,[a(s,{to:"/reference/frontmatter.html#routemeta"},{default:t(()=>[e("Frontmatter > routeMeta")]),_:1})]),n("li",null,[n("a",jn,[e("vue-router > API Reference > RouteRecordRaw > meta"),a(i)])])])])]),Gn,n("ul",null,[On,Wn,n("li",null,[Un,n("ul",null,[n("li",null,[a(s,{to:"/reference/config.html#markdown-sfc"},{default:t(()=>[e("Config > markdown.sfc")]),_:1})])])])]),$n])}const Kn=c(u,[["render",Xn],["__file","node-api.html.vue"]]);export{Kn as default}; diff --git a/assets/nprogress.html-1022e6a7.js b/assets/nprogress.html-1022e6a7.js new file mode 100644 index 00000000..1b7d1388 --- /dev/null +++ b/assets/nprogress.html-1022e6a7.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-46d4f19d","path":"/reference/plugin/nprogress.html","title":"nprogress","lang":"en-US","frontmatter":{"title":"nprogress","description":"Integrate nprogress (https://github.com/rstacruz/nprogress) into VuePress, which can provide a progress bar when navigating to another page. This plugin has been integrated into...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/reference/plugin/nprogress.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/reference/plugin/nprogress.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"nprogress"}],["meta",{"property":"og:description","content":"Integrate nprogress (https://github.com/rstacruz/nprogress) into VuePress, which can provide a progress bar when navigating to another page. This plugin has been integrated into..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"nprogress\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.39,"words":118},"filePathRelative":"reference/plugin/nprogress.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/nprogress.html-64571246.js b/assets/nprogress.html-64571246.js new file mode 100644 index 00000000..6aa814c0 --- /dev/null +++ b/assets/nprogress.html-64571246.js @@ -0,0 +1,7 @@ +import{_ as i,W as p,X as c,a2 as n,Y as a,$ as s,a0 as e,a1 as l,D as t}from"./framework-46b0e263.js";const d={},u=s("h1",{id:"nprogress-plugin",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#nprogress-plugin","aria-hidden":"true"},"#"),e(" nprogress Plugin")],-1),g={href:"https://github.com/rstacruz/nprogress",target:"_blank",rel:"noopener noreferrer"},h=l(`

    This plugin has been integrated into the default theme.

    Usage

    npm i -D @vuepress/plugin-nprogress@next
    +
    import { nprogressPlugin } from "@vuepress/plugin-nprogress";
    +
    +export default {
    +  plugins: [nprogressPlugin()],
    +};
    +

    Styles

    You can customize the style of the progress bar via CSS variables:

    File not found
    `,7);function m(v,k){const r=t("NpmBadge"),o=t("ExternalLinkIcon");return p(),c("div",null,[n(' `# nprogress` will be rendered as `

    `, and the id will conflict with the nprogress bar (stupid) '),n(" so we add a 'plugin' suffix in the h1 title, and use title frontmatter to set the page title "),u,a(r,{package:"@vuepress/plugin-nprogress"}),s("p",null,[e("Integrate "),s("a",g,[e("nprogress"),a(o)]),e(" into VuePress, which can provide a progress bar when navigating to another page.")]),h])}const f=i(d,[["render",m],["__file","nprogress.html.vue"]]);export{f as default}; diff --git a/assets/nprogress.html-aaaab1e3.js b/assets/nprogress.html-aaaab1e3.js new file mode 100644 index 00000000..a3d63c8a --- /dev/null +++ b/assets/nprogress.html-aaaab1e3.js @@ -0,0 +1,7 @@ +import{_ as p,W as c,X as i,a2 as e,Y as a,$ as n,a0 as s,a1 as l,D as t}from"./framework-46b0e263.js";const d={},u=n("h1",{id:"nprogress-插件",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#nprogress-插件","aria-hidden":"true"},"#"),s(" nprogress 插件")],-1),g={href:"https://github.com/rstacruz/nprogress",target:"_blank",rel:"noopener noreferrer"},h=l(`

    该插件已经集成到默认主题中。

    使用方法

    npm i -D @vuepress/plugin-nprogress@next
    +
    import { nprogressPlugin } from "@vuepress/plugin-nprogress";
    +
    +export default {
    +  plugins: [nprogressPlugin()],
    +};
    +

    样式

    你可以通过 CSS 变量来自定义进度条的样式:

    File not found
    `,7);function m(v,k){const r=t("NpmBadge"),o=t("ExternalLinkIcon");return c(),i("div",null,[e(' `# nprogress` 会被渲染成 `

    ` ,导致 id 和 nprogress 进度条冲突 (有点蠢) '),e(" 所以我们在 h1 标题后添加一个 '插件' 后缀,然后通过 title frontmatter 来设置页面标题 "),u,a(r,{package:"@vuepress/plugin-nprogress"}),n("p",null,[s("将 "),n("a",g,[s("nprogress"),a(o)]),s(" 集成到 VuePress 中,在切换到另一个页面时会展示进度条。")]),h])}const b=p(d,[["render",m],["__file","nprogress.html.vue"]]);export{b as default}; diff --git a/assets/nprogress.html-bcdc2bc9.js b/assets/nprogress.html-bcdc2bc9.js new file mode 100644 index 00000000..fbad8aa1 --- /dev/null +++ b/assets/nprogress.html-bcdc2bc9.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-9f56ece4","path":"/zh/reference/plugin/nprogress.html","title":"nprogress","lang":"zh-CN","frontmatter":{"title":"nprogress","description":"将 nprogress (https://github.com/rstacruz/nprogress) 集成到 VuePress 中,在切换到另一个页面时会展示进度条。 该插件已经集成到默认主题中。 使用方法 样式 你可以通过 CSS 变量来自定义进度条的样式: code css (@vuepress/plugin-nprogress/src/clie...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/reference/plugin/nprogress.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/reference/plugin/nprogress.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"nprogress"}],["meta",{"property":"og:description","content":"将 nprogress (https://github.com/rstacruz/nprogress) 集成到 VuePress 中,在切换到另一个页面时会展示进度条。 该插件已经集成到默认主题中。 使用方法 样式 你可以通过 CSS 变量来自定义进度条的样式: code css (@vuepress/plugin-nprogress/src/clie..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"nprogress\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":0.52,"words":155},"filePathRelative":"zh/reference/plugin/nprogress.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/page.html-207516b6.js b/assets/page.html-207516b6.js new file mode 100644 index 00000000..359a4544 --- /dev/null +++ b/assets/page.html-207516b6.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4eaf9f84","path":"/guide/page.html","title":"Page","lang":"en-US","frontmatter":{"icon":"fa6-solid:file","description":"VuePress is markdown-centered. Each markdown file inside your project is a standalone page. Routing By default, the route path of a page is determined by the relative path of yo...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuejs.press/zh/guide/page.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/guide/page.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"Page"}],["meta",{"property":"og:description","content":"VuePress is markdown-centered. Each markdown file inside your project is a standalone page. Routing By default, the route path of a page is determined by the relative path of yo..."}],["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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Page\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"Routing","slug":"routing","link":"#routing","children":[]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[]},{"level":2,"title":"Content","slug":"content","link":"#content","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.33,"words":398},"filePathRelative":"guide/page.md","localizedDate":"February 22, 2023","autoDesc":true}');export{e as data}; diff --git a/assets/page.html-69e8d1e1.js b/assets/page.html-69e8d1e1.js new file mode 100644 index 00000000..a9fc19bf --- /dev/null +++ b/assets/page.html-69e8d1e1.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7a8fca2f","path":"/zh/guide/page.html","title":"页面","lang":"zh-CN","frontmatter":{"icon":"fa6-solid:file","description":"VuePress 是以 Markdown 为中心的。你项目中的每一个 Markdown 文件都是一个单独的页面。 路由 默认情况下,页面的路由路径是根据你的 Markdown 文件的相对路径决定的。 假设这是你的 Markdown 文件所处的目录结构: 将 docs 目录作为你的 sourceDir (../reference/cli.md) ,例如你...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuejs.press/guide/page.html"}],["meta",{"property":"og:url","content":"https://vuejs.press/zh/guide/page.html"}],["meta",{"property":"og:site_name","content":"VuePress"}],["meta",{"property":"og:title","content":"页面"}],["meta",{"property":"og:description","content":"VuePress 是以 Markdown 为中心的。你项目中的每一个 Markdown 文件都是一个单独的页面。 路由 默认情况下,页面的路由路径是根据你的 Markdown 文件的相对路径决定的。 假设这是你的 Markdown 文件所处的目录结构: 将 docs 目录作为你的 sourceDir (../reference/cli.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-02-22T07:39:31.000Z"}],["meta",{"property":"article:modified_time","content":"2023-02-22T07:39:31.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"页面\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2023-02-22T07:39:31.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"路由","slug":"路由","link":"#路由","children":[]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[]},{"level":2,"title":"内容","slug":"内容","link":"#内容","children":[]}],"git":{"createdTime":1677051571000,"updatedTime":1677051571000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"readingTime":{"minutes":1.87,"words":560},"filePathRelative":"zh/guide/page.md","localizedDate":"2023年2月22日","autoDesc":true}');export{e as data}; diff --git a/assets/page.html-713a4212.js b/assets/page.html-713a4212.js new file mode 100644 index 00000000..8f302438 --- /dev/null +++ b/assets/page.html-713a4212.js @@ -0,0 +1,12 @@ +import{_ as r,W as l,X as c,$ as t,a0 as e,Y as n,Z as a,a1 as s,D as i}from"./framework-46b0e263.js";const u={},h=s(`

    Page

    VuePress is markdown-centered. Each markdown file inside your project is a standalone page.

    Routing

    By default, the route path of a page is determined by the relative path of your markdown file.

    Assuming this is the directory structure of your markdown files:

    └─ docs
    +   ├─ guide
    +   │  ├─ getting-started.md
    +   │  └─ README.md
    +   ├─ contributing.md
    +   └─ README.md
    +
    `,6),m=t("code",null,"docs",-1),p=t("code",null,"vuepress dev docs",-1),f=s("
    Relative PathRoute Path
    /README.md/
    /index.md/
    /contributing.md/contributing.html
    /guide/README.md/guide/
    /guide/getting-started.md/guide/getting-started.html
    ",1),_={class:"hint-container tip"},g=t("p",{class:"hint-container-title"},"Tips",-1),k=t("p",null,[e("By default, both "),t("code",null,"README.md"),e(" and "),t("code",null,"index.md"),e(" would be converted to "),t("code",null,"index.html"),e(" and generate a slash-ending route path. However, it might cause conflicts if you want to keep both of the two files.")],-1),v=t("code",null,"['**/*.md', '!**/README.md', '!.vuepress', '!node_modules']",-1),b=t("code",null,"README.md",-1),w=t("h2",{id:"frontmatter",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),e(" Frontmatter")],-1),y={href:"https://yaml.org/",target:"_blank",rel:"noopener noreferrer"},x=s(`
    ---
    +lang: en-US
    +title: Title of this page
    +description: Description of this page
    +---
    +
    `,1),E=t("code",null,"lang",-1),M=t("code",null,"title",-1),R=t("code",null,"description",-1),V=t("p",null,"Also, VuePress has built-in support for some frontmatter fields, and your theme may have its own special frontmatter, too.",-1),A={class:"hint-container tip"},D=t("p",{class:"hint-container-title"},"Tips",-1),T=t("h2",{id:"content",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#content","aria-hidden":"true"},"#"),e(" Content")],-1),P=t("p",null,[e("The main content of your page is written in Markdown. VuePress will firstly transform your Markdown to HTML code, then treat the HTML code as "),t("code",null,"