diff --git a/.github/contributing.md b/.github/contributing.md
index 24a4a745..5738cbc2 100644
--- a/.github/contributing.md
+++ b/.github/contributing.md
@@ -23,7 +23,7 @@ Hi! We're really excited that you are interested in contributing to VitePress. B
## Development Setup
-You will need [pnpm](https://pnpm.io)
+You will need [Node.js](https://nodejs.org) v20 or higher and [pnpm](https://pnpm.io).
After cloning the repo, run:
diff --git a/.github/workflows/cr.yml b/.github/workflows/cr.yml
index b8b833ef..7dd5c4c7 100644
--- a/.github/workflows/cr.yml
+++ b/.github/workflows/cr.yml
@@ -9,6 +9,7 @@ on:
types: [opened, synchronize, labeled, ready_for_review]
paths-ignore:
- '.github/**'
+ - '!.github/workflows/cr.yml'
- '__tests__/**'
- 'art/**'
- 'docs/**'
@@ -17,6 +18,7 @@ on:
branches: [main]
paths-ignore:
- '.github/**'
+ - '!.github/workflows/cr.yml'
- '__tests__/**'
- 'art/**'
- 'docs/**'
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index f5826155..dd47c33f 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -1,12 +1,14 @@
name: Close stale issues and PRs
on:
+ schedule:
+ - cron: '0 12 1,15 * *'
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
steps:
- - uses: actions/stale@v9
+ - uses: actions/stale@v10
with:
days-before-stale: 30
days-before-close: -1
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index dc527e35..51d3fffe 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
- node_version: [18, 20, 22]
+ node_version: [20, 22, latest]
include:
- os: windows-latest
node_version: 22
diff --git a/.npmrc b/.npmrc
deleted file mode 100644
index ab953072..00000000
--- a/.npmrc
+++ /dev/null
@@ -1,2 +0,0 @@
-shell-emulator=true
-auto-install-peers=false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 387e81e0..e31cdc19 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,146 @@
+## [2.0.0-alpha.12](https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2025-08-20)
+
+### Bug Fixes
+
+- **hmr:** don't load config twice on server restart ([d1a8061](https://github.com/vuejs/vitepress/commit/d1a8061eb438c730ccc62ce2d7158dbe89cc5292))
+- **hmr:** no need for server restart on theme change ([d3a1567](https://github.com/vuejs/vitepress/commit/d3a15673bd0846c7837bcc4ff5a2e3239a02f1f9))
+- **hmr:** hmr not working for snippet imports in dynamic routes ([914467e](https://github.com/vuejs/vitepress/commit/914467e17fb759a9722951a3fd7568eb3bc4d4e6))
+- **theme:** fix local nav alignment and increase touch area ([43b36c0](https://github.com/vuejs/vitepress/commit/43b36c0c19c2b4696f8c38fdaf4318786ea7ae8e))
+- **theme:** nav background doesn't extend fully and gap after sidebar with non-overlay scrollbars ([7df3052](https://github.com/vuejs/vitepress/commit/7df30525121a28a46cc6c802f3155ccff8effaca)), closes [#4653](https://github.com/vuejs/vitepress/issues/4653)
+- **theme:** use clipboard-check instead of clipboard-copy for code copied icon ([1c8815d](https://github.com/vuejs/vitepress/commit/1c8815d53ed2d56b07938260df6566f1514f4bfc))
+
+### Features
+
+- add markdown-it-cjk-friendly ([9fc8462](https://github.com/vuejs/vitepress/commit/9fc8462726ccf1cdb78b6171c9f1f5964e79ca22)), closes [#3762](https://github.com/vuejs/vitepress/issues/3762) [#4752](https://github.com/vuejs/vitepress/issues/4752)
+- make postcssIsolateStyles idempotent ([0944777](https://github.com/vuejs/vitepress/commit/094477789328b80cff45cd973efa16b6a4db0a27))
+
+### BREAKING CHANGES
+
+- [markdown-it-cjk-friendly](https://www.npmjs.com/package/markdown-it-cjk-friendly) is enabled by default. This intentionally deviates from the official commonmark spec for the benefit of CJK users. **For most users, no change is required.** If you were using hacks to patch `scanDelims`, you can remove those. To disable the plugin, set `markdown: { cjkFriendly: false }` in your vitepress config.
+- `includeFiles` option in `postcssIsolateStyles` now defaults to `[/vp-doc\.css/, /base\.css/]`. You can remove explicit `includeFiles` if you were using it just to run it on `vp-doc.css`. To revert back to older behavior pass `includeFiles: [/base\.css/]`. The underlying implementation is changed and `transform` and `exclude` options are no longer supported. Use `postcss-prefix-selector` directly if you've advanced use cases.
+
+## [2.0.0-alpha.11](https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.10...v2.0.0-alpha.11) (2025-08-14)
+
+### Bug Fixes
+
+- hmr working only once for markdown files ([8d8a5ac](https://github.com/vuejs/vitepress/commit/8d8a5ac281f090cd097bece792d9dd3ef00e5545)), closes [#4909](https://github.com/vuejs/vitepress/issues/4909)
+- html entities encoded twice in toc plugin ([8abbe29](https://github.com/vuejs/vitepress/commit/8abbe298d545de17d34a9bc1eb72af4c5a4b41b8)), closes [#4908](https://github.com/vuejs/vitepress/issues/4908)
+
+## [2.0.0-alpha.10](https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.9...v2.0.0-alpha.10) (2025-08-11)
+
+### Bug Fixes
+
+- **client:** base not stripped from relativePath in 404 pages ([b840877](https://github.com/vuejs/vitepress/commit/b840877aa83a5a24ffc1222e8a5a3dbf3e5105e8)), closes [#4850](https://github.com/vuejs/vitepress/issues/4850)
+- hmr of style blocks in dynamic routes ([#4903](https://github.com/vuejs/vitepress/issues/4903)) ([3d0fafb](https://github.com/vuejs/vitepress/commit/3d0fafba545f4b5028cf43d86027dd44dab14421))
+- make paths in `watchedFiles` absolute as mentioned in the docs ([318c14f](https://github.com/vuejs/vitepress/commit/318c14fa7c9fb949d74b7d9fae416e917766cf05))
+- module graph causing unnecessary route regeneration on every update ([fc267ae](https://github.com/vuejs/vitepress/commit/fc267ae6b787e163d41666e090089821377ead43))
+- preserve externally added dynamic routes and pages ([fc267ae](https://github.com/vuejs/vitepress/commit/fc267ae6b787e163d41666e090089821377ead43))
+- **search:** input placeholder being cut off in smaller viewports ([162c6a6](https://github.com/vuejs/vitepress/commit/162c6a69bf56945daa20d126aa034c59ee0c8a2e))
+- **search:** style tweaks for when searches are empty ([8b23217](https://github.com/vuejs/vitepress/commit/8b232171cc321bd3dc86b4357622815269f0b6f4))
+- **types:** externalize markdown-it types ([5bf835b](https://github.com/vuejs/vitepress/commit/5bf835b5074e9567852d552bfb5115c6456026e8))
+- **types:** pass generics deeply to user config ([777e2ca](https://github.com/vuejs/vitepress/commit/777e2caaacd93ce41b046f6c9d5ba80cc43ba37c))
+
+### Features
+
+- add source param to the deadlink check fn ([#4870](https://github.com/vuejs/vitepress/issues/4870)) ([8c027c2](https://github.com/vuejs/vitepress/commit/8c027c2a7c443074fd0d4890f7736b444f9254aa))
+- **theme:** add `rel="me"` to social links by default ([#4873](https://github.com/vuejs/vitepress/issues/4873)) ([34886c6](https://github.com/vuejs/vitepress/commit/34886c667d1305a79d64c957f8c52931ea122f47))
+
+## [2.0.0-alpha.9](https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.8...v2.0.0-alpha.9) (2025-07-26)
+
+### Bug Fixes
+
+- **md:** pass container option to gitHubAlertsPlugin ([#4848](https://github.com/vuejs/vitepress/issues/4848)) ([52f0eaa](https://github.com/vuejs/vitepress/commit/52f0eaa0849344aa45efbf7258a6287597e55a9a))
+- **theme:** remove duplicate text in sponsors grid ([3c51b22](https://github.com/vuejs/vitepress/commit/3c51b22ac98a12f193081d23799cb9f3f2ecf682)), closes [#4854](https://github.com/vuejs/vitepress/issues/4854)
+
+### Features
+
+- **search:** upgrade search to DocSearch v4-beta ([#4843](https://github.com/vuejs/vitepress/issues/4843)) ([ac61abe](https://github.com/vuejs/vitepress/commit/ac61abe7d7be5ef8b6939f18192896538eba1b8c))
+
+### BREAKING CHANGES
+
+- **search:** Uses DocSearch v4 beta. No change is required if you're not customizing the styles of navbar search button or modal. DocSearch AI features are in private beta, you can apply for them at https://forms.gle/iyfb5pC2CiiwszUKA
+
+## [2.0.0-alpha.8](https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.7...v2.0.0-alpha.8) (2025-07-08)
+
+### Bug Fixes
+
+- adjust glob logic to always resolve glob relative to base ([5d41785](https://github.com/vuejs/vitepress/commit/5d41785ff7b016b08f587f1ef3318fc18d58f6ab)), closes [#4822](https://github.com/vuejs/vitepress/issues/4822)
+- **build:** ignore escaped `:` when splitting selector in `postcssIsolateStyles` ([#4830](https://github.com/vuejs/vitepress/issues/4830)) ([a629b03](https://github.com/vuejs/vitepress/commit/a629b03f0ee8a29d73a18481399d7de1c992faf2))
+- font preload not being generated in rolldown-vite ([ed387e8](https://github.com/vuejs/vitepress/commit/ed387e89d42a08c15a9f45c9c5e11c6750245490))
+- **theme:** remove extra slash when concatenating base with sidebar links ([c8fc80e](https://github.com/vuejs/vitepress/commit/c8fc80e438fffd98feaf7c72263bc3077792c4a2))
+
+## [2.0.0-alpha.7](https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.6...v2.0.0-alpha.7) (2025-06-24)
+
+### Bug Fixes
+
+- **local-search:** parse headings with non-anchor `a` tags as titles properly ([#4809](https://github.com/vuejs/vitepress/issues/4809)) ([5359903](https://github.com/vuejs/vitepress/commit/53599039a01af6d8e17a6a6e9cea5c222cc5948c))
+- resolve pages after setting global vitepress config ([56ba65e](https://github.com/vuejs/vitepress/commit/56ba65e1301454df88f9a3856fa1a70dc052d314)), closes [#4803](https://github.com/vuejs/vitepress/issues/4803)
+
+### Features
+
+- **router:** add `replace` option to `useRouter` for history management ([#4788](https://github.com/vuejs/vitepress/issues/4788)) ([23541b4](https://github.com/vuejs/vitepress/commit/23541b4f83726cdac09ffcaf9141bba871cda690)), closes [#4787](https://github.com/vuejs/vitepress/issues/4787)
+- consistent glob options across content, data, and path loaders ([#4808](https://github.com/vuejs/vitepress/issues/4808)) ([7619521](https://github.com/vuejs/vitepress/commit/76195212596cd54095240246b7e78075ac3cbc27)), closes [#4807](https://github.com/vuejs/vitepress/issues/4807)
+- bump to vite 7 ([2ecd607](https://github.com/vuejs/vitepress/commit/2ecd607af15222eeddf0b888a72d0f913f5a3cd2))
+
+### Performance Improvements
+
+- render pages in contentLoader asynchronously ([36148a0](https://github.com/vuejs/vitepress/commit/36148a0bcf3a73d1fe3f0c5f33337b679f700053))
+
+### BREAKING CHANGES
+
+- Only `cwd`, `ignore`, `dot` and `debug` are supported in `globOptions` of `createContentLoader`. If you want to pass other options, you still can but you might need to suppress type errors.
+- Uses vite 7. See [vite migration guide](https://vite.dev/guide/migration.html) for more info. For most of the users no change is required. VitePress should work same as earlier, except for maybe some type mismatches if you're using third-party plugins. You can suppress them using `@ts-expect-error` or `as any` and report the issues at respective repositories.
+
+## [2.0.0-alpha.6](https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2025-06-12)
+
+### Bug Fixes
+
+- allow AdditionalConfigLoader to return void ([906a44a](https://github.com/vuejs/vitepress/commit/906a44a3ad488a46804757326af95cfb8cac6b75))
+- **build:** avoiding creating separate chunks for vite public assets ([21f24b9](https://github.com/vuejs/vitepress/commit/21f24b9994ea4807ac7e0be38408e9aaa3abe8a9))
+- **build:** emit lean chunks after vite has done processing ([26cb685](https://github.com/vuejs/vitepress/commit/26cb685adf54f07fe3e9fd7bfd49a0ff79956923)), closes [#4737](https://github.com/vuejs/vitepress/issues/4737)
+- **client:** properly skip removed lines when copying code blocks ([c128baf](https://github.com/vuejs/vitepress/commit/c128baf0c41d5113c1b876f691e0185201b1f500))
+- disable appearance scripts in zero-js mode ([e7f9d05](https://github.com/vuejs/vitepress/commit/e7f9d05c3e2ef4f4c1db3b2c17e586f0fc26a6f6)), closes [#4766](https://github.com/vuejs/vitepress/issues/4766)
+- don't preload dynamic imports ([801648a](https://github.com/vuejs/vitepress/commit/801648a4c9d91e7f96302932ac9247d5bdd64ef7)), closes [#4770](https://github.com/vuejs/vitepress/issues/4770)
+- gather additional config files even if root .vitepress/config is not present ([26f178c](https://github.com/vuejs/vitepress/commit/26f178cfaa330a017bb69b1ec6bd482d63a100a9))
+- set `preserveEntrySignatures` for rolldown-vite ([#4784](https://github.com/vuejs/vitepress/issues/4784)) ([4351bc0](https://github.com/vuejs/vitepress/commit/4351bc0b831277401e08b350d7d7c0ab9ea0c9ed))
+- skip fields not supported by rolldown for rolldown-vite ([#4747](https://github.com/vuejs/vitepress/issues/4747)) ([4e3fce4](https://github.com/vuejs/vitepress/commit/4e3fce40c9bab261f3c5e31833475c3e2c6ba0cf))
+- **theme/regression:** code blocks not aligned properly in rtl layouts ([a643347](https://github.com/vuejs/vitepress/commit/a64334753079a5b874a482508d9ee255d2a0ea38))
+- **theme:** hide native search input cancel button ([#4723](https://github.com/vuejs/vitepress/issues/4723)) ([2c4944f](https://github.com/vuejs/vitepress/commit/2c4944f06ccf46fcf58fb18a1819fd167c9533cc))
+- **theme:** prevent error in handleSearchHotKey method ([#4782](https://github.com/vuejs/vitepress/issues/4782)) ([21fcecc](https://github.com/vuejs/vitepress/commit/21fcecce0581d0c461bc15e03429f61ff444a655))
+- use v-pre for mathjax instead of isCustomElement ([c9b8928](https://github.com/vuejs/vitepress/commit/c9b89282f3573998cfc4103bbddbd73d2529cb66))
+
+### Features
+
+- use `oxc-minify` instead of `transformWithEsbuild` when rolldown-vite is used ([#4748](https://github.com/vuejs/vitepress/issues/4748)) ([7c1dc48](https://github.com/vuejs/vitepress/commit/7c1dc48b2fd08e128f7bbe26690fb6534dfb4b95))
+
+## [2.0.0-alpha.5](https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2025-04-21)
+
+### Bug Fixes
+
+- don't remove shiki styles from `pre` and remove unnecessary transformers (#4652) ([db58af5](https://github.com/vuejs/vitepress/commit/db58af5c66e563e7663084057a9853d8f2da984c)), closes [#4652](https://github.com/vuejs/vitepress/issues/4652)
+- normalize url fragments in internal links to correctly resolve to anchors ([#4628](https://github.com/vuejs/vitepress/issues/4628)) ([e25d080](https://github.com/vuejs/vitepress/commit/e25d0805505db2f1116e99d38a488d5cb39ed426)), closes [#4605](https://github.com/vuejs/vitepress/issues/4605)
+- **theme-default:** ensure proper sizing of SVG hero images ([#4639](https://github.com/vuejs/vitepress/issues/4639)) ([7d94481](https://github.com/vuejs/vitepress/commit/7d9448192079e59493aa5c1e86cdf6d6deae8e36))
+
+### Features
+
+- add `isHome` frontmatter option (#4673) ([544cd81](https://github.com/vuejs/vitepress/commit/544cd8125985b9e3af7fee68ea9592d159799e01)), closes [#4673](https://github.com/vuejs/vitepress/issues/4673)
+- add `custom-block-title-default` class when default title is used for containers ([#4643](https://github.com/vuejs/vitepress/issues/4643)) ([63079bf](https://github.com/vuejs/vitepress/commit/63079bff03b15861d174199f7361a2aff84380e0))
+- add `dir=ltr` by default on code block pre elements instead of relying on css ([19faa16](https://github.com/vuejs/vitepress/commit/19faa16169b44f52bedf1401b4a97b2a8ffdeacb))
+- **default-theme:** make VPButton slottable ([#4689](https://github.com/vuejs/vitepress/issues/4689)) ([0b70397](https://github.com/vuejs/vitepress/commit/0b7039719782e85119ad22be5c89ef3d233ffaae))
+- support distributed config files ([#4660](https://github.com/vuejs/vitepress/issues/4660)) ([c5e2e4d](https://github.com/vuejs/vitepress/commit/c5e2e4db818c06f3c1b458753f22fb6ec1609628))
+- **theme:** make "Take me home" button's link customizable ([#4658](https://github.com/vuejs/vitepress/issues/4658)) ([0267dca](https://github.com/vuejs/vitepress/commit/0267dcafa20beea24ef359d24bb1fa99e1ffda49))
+
+### Performance Improvements
+
+- call `module.enableCompileCache()` ([70de34c](https://github.com/vuejs/vitepress/commit/70de34c0387d9668ada3ea9a795f9ebee3535f5b))
+- hoist expensive operations in useLayout ([e5ab067](https://github.com/vuejs/vitepress/commit/e5ab0676a9a8dc607e213eb691439b2e4ee472b7))
+
+### BREAKING CHANGES
+
+- `useLocalNav` and `useSidebar` are removed in favor of `useLayout`. To migrate, just do find and replace. Sidebar controls are no longer exported, but we didn't find any usage on GitHub. If there is demand, we can export respective composables later. `DefaultTheme.DocSidebar` and `DefaultTheme.DocLocalNav` types are also removed.
+- `vp-adaptive-theme` class is no longer added to code blocks when there is single theme. Theme authors supporting single code theme can use `.shiki:not(.shiki-themes)` as selector. Alternatively, it might be better to use the bg/fg variables set on the `.shiki` block to keep things generic.
+- `vp-code` class is no longer added to code blocks. Use `.shiki` or `pre.shiki` or `[class*='language-'] pre` instead. People not customizing their themes are not affected.
+
## [2.0.0-alpha.4](https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2025-03-09)
### Bug Fixes
@@ -2198,7 +2341,6 @@ This version uses Vue 3.2.0.
### BREAKING CHANGES
- Some config options have changed.
-
- `vueOptions` renamed to `vue`
- `alias` option has been removed. Use `vite.resovle.alias` instead.
@@ -2216,7 +2358,6 @@ This version uses Vue 3.2.0.
### BREAKING CHANGES
- The following methods are removed.
-
- `useSiteData`
- `useSiteDataByRoute`
- `usePageData`
diff --git a/README.md b/README.md
index 134226a4..c6533b30 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# VitePress 📝💨
-[](https://github.com/vuejs/vitepress/actions)
-[](https://www.npmjs.com/package/vitepress)
+[](https://github.com/vuejs/vitepress/actions/workflows/test.yml)
+[](https://www.npmjs.com/package/vitepress/v/next)
[](https://nightly.akryum.dev/vuejs/vitepress)
[](https://chat.vuejs.org)
diff --git a/__tests__/e2e/.vitepress/theme/components/ApiPreference.vue b/__tests__/e2e/.vitepress/theme/components/ApiPreference.vue
index 12207764..c286640b 100644
--- a/__tests__/e2e/.vitepress/theme/components/ApiPreference.vue
+++ b/__tests__/e2e/.vitepress/theme/components/ApiPreference.vue
@@ -30,7 +30,7 @@ function removeSpaces(str: string) {
diff --git a/__tests__/e2e/data-loading/data.test.ts b/__tests__/e2e/data-loading/data.test.ts
index fafc403a..21cfa061 100644
--- a/__tests__/e2e/data-loading/data.test.ts
+++ b/__tests__/e2e/data-loading/data.test.ts
@@ -52,9 +52,7 @@ describe('static data file support in vite 3', () => {
await page.waitForFunction(
() =>
document.querySelector('pre#basic')?.textContent ===
- JSON.stringify([{ a: false }, { b: true }], null, 2),
- undefined,
- { timeout: 3000 }
+ JSON.stringify([{ a: false }, { b: true }], null, 2)
)
} finally {
await fs.writeFile(a, JSON.stringify({ a: true }, null, 2) + '\n')
@@ -67,9 +65,7 @@ describe('static data file support in vite 3', () => {
await page.waitForFunction(
() =>
document.querySelector('pre#basic')?.textContent ===
- JSON.stringify([{ a: true }], null, 2),
- undefined,
- { timeout: 3000 }
+ JSON.stringify([{ a: true }], null, 2)
)
err = false
} finally {
@@ -83,9 +79,7 @@ describe('static data file support in vite 3', () => {
await page.waitForFunction(
() =>
document.querySelector('pre#basic')?.textContent ===
- JSON.stringify([{ a: true }, { b: false }], null, 2),
- undefined,
- { timeout: 3000 }
+ JSON.stringify([{ a: true }, { b: false }], null, 2)
)
} finally {
await fs.writeFile(b, JSON.stringify({ b: true }, null, 2) + '\n')
diff --git a/__tests__/e2e/dynamic-routes/[id].paths.ts b/__tests__/e2e/dynamic-routes/[id].paths.ts
index 12a8bc32..a1cb6fef 100644
--- a/__tests__/e2e/dynamic-routes/[id].paths.ts
+++ b/__tests__/e2e/dynamic-routes/[id].paths.ts
@@ -6,7 +6,7 @@ export default defineRoutes({
// console.log('watchedFiles', watchedFiles)
return paths
},
- watch: ['**/data-loading/**/*.json'],
+ watch: ['../data-loading/**/*.json'],
async transformPageData(pageData) {
// console.log('transformPageData', pageData.filePath)
pageData.title += ' - transformed'
diff --git a/__tests__/unit/node/postcss/__snapshots__/isolateStyles.test.ts.snap b/__tests__/unit/node/postcss/__snapshots__/isolateStyles.test.ts.snap
new file mode 100644
index 00000000..c781b64c
--- /dev/null
+++ b/__tests__/unit/node/postcss/__snapshots__/isolateStyles.test.ts.snap
@@ -0,0 +1,77 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`node/postcss/isolateStyles > transforms selectors and skips keyframes 1`] = `
+"
+/* simple classes */
+.example:not(:where(.vp-raw, .vp-raw *)) { color: red; }
+.class-a:not(:where(.vp-raw, .vp-raw *)) { color: coral; }
+.class-b:not(:where(.vp-raw, .vp-raw *)) { color: deepskyblue; }
+
+/* escaped colon in class */
+.baz\\:not\\(.bar\\):not(:where(.vp-raw, .vp-raw *)) { display: block; }
+.disabled\\:opacity-50:not(:where(.vp-raw, .vp-raw *)):disabled { opacity: .5; }
+
+/* pseudos (class + element) */
+.button:not(:where(.vp-raw, .vp-raw *)):hover { color: pink; }
+.button:not(:where(.vp-raw, .vp-raw *)):focus:hover { color: hotpink; }
+.item:not(:where(.vp-raw, .vp-raw *))::before { content: '•'; }
+:not(:where(.vp-raw, .vp-raw *))::first-letter { color: pink; }
+:not(:where(.vp-raw, .vp-raw *))::before { content: ''; }
+
+/* universal + :not */
+*:not(:where(.vp-raw, .vp-raw *)) { background-color: red; }
+*:not(:where(.vp-raw, .vp-raw *)):not(.b) { text-transform: uppercase; }
+
+/* combinators */
+.foo:hover .bar:not(:where(.vp-raw, .vp-raw *)) { background: blue; }
+ul > li.active:not(:where(.vp-raw, .vp-raw *)) { color: green; }
+a + b ~ c:not(:where(.vp-raw, .vp-raw *)) { color: orange; }
+
+/* ids + attribute selectors */
+#wow:not(:where(.vp-raw, .vp-raw *)) { color: yellow; }
+[data-world] .d:not(:where(.vp-raw, .vp-raw *)) { padding: 10px 20px; }
+
+/* :root and chained tags */
+:not(:where(.vp-raw, .vp-raw *)):root { --bs-blue: #0d6efd; }
+:root .a:not(:where(.vp-raw, .vp-raw *)) { --bs-green: #bada55; }
+html:not(:where(.vp-raw, .vp-raw *)) { margin: 0; }
+body:not(:where(.vp-raw, .vp-raw *)) { padding: 0; }
+html body div:not(:where(.vp-raw, .vp-raw *)) { color: blue; }
+
+/* grouping with commas */
+.a:not(:where(.vp-raw, .vp-raw *)), .b:not(:where(.vp-raw, .vp-raw *)) { color: red; }
+
+/* multiple repeated groups to ensure stability */
+.a:not(:where(.vp-raw, .vp-raw *)), .b:not(:where(.vp-raw, .vp-raw *)) { color: coral; }
+.a:not(:where(.vp-raw, .vp-raw *)) { animation: glow 1s linear infinite alternate; }
+
+/* nested blocks */
+.foo:not(:where(.vp-raw, .vp-raw *)) {
+ svg:not(:where(.vp-raw, .vp-raw *)) { display: none; }
+ .bar:not(:where(.vp-raw, .vp-raw *)) { display: inline; }
+}
+
+/* standalone pseudos */
+:not(:where(.vp-raw, .vp-raw *)):first-child { color: pink; }
+:not(:where(.vp-raw, .vp-raw *)):hover { color: blue; }
+:not(:where(.vp-raw, .vp-raw *)):active { color: red; }
+
+/* keyframes (should be ignored) */
+@keyframes fade {
+ from { opacity: 0; }
+ to { opacity: 1; }
+}
+@-webkit-keyframes glow {
+ from { color: coral; }
+ to { color: red; }
+}
+@-moz-keyframes glow {
+ from { color: coral; }
+ to { color: red; }
+}
+@-o-keyframes glow {
+ from { color: coral; }
+ to { color: red; }
+}
+"
+`;
diff --git a/__tests__/unit/node/postcss/isolateStyles.test.ts b/__tests__/unit/node/postcss/isolateStyles.test.ts
new file mode 100644
index 00000000..609a4463
--- /dev/null
+++ b/__tests__/unit/node/postcss/isolateStyles.test.ts
@@ -0,0 +1,93 @@
+import { postcssIsolateStyles } from 'node/postcss/isolateStyles'
+import postcss from 'postcss'
+
+const INPUT_CSS = `
+/* simple classes */
+.example { color: red; }
+.class-a { color: coral; }
+.class-b { color: deepskyblue; }
+
+/* escaped colon in class */
+.baz\\:not\\(.bar\\) { display: block; }
+.disabled\\:opacity-50:disabled { opacity: .5; }
+
+/* pseudos (class + element) */
+.button:hover { color: pink; }
+.button:focus:hover { color: hotpink; }
+.item::before { content: '•'; }
+::first-letter { color: pink; }
+::before { content: ''; }
+
+/* universal + :not */
+* { background-color: red; }
+*:not(.b) { text-transform: uppercase; }
+
+/* combinators */
+.foo:hover .bar { background: blue; }
+ul > li.active { color: green; }
+a + b ~ c { color: orange; }
+
+/* ids + attribute selectors */
+#wow { color: yellow; }
+[data-world] .d { padding: 10px 20px; }
+
+/* :root and chained tags */
+:root { --bs-blue: #0d6efd; }
+:root .a { --bs-green: #bada55; }
+html { margin: 0; }
+body { padding: 0; }
+html body div { color: blue; }
+
+/* grouping with commas */
+.a, .b { color: red; }
+
+/* multiple repeated groups to ensure stability */
+.a, .b { color: coral; }
+.a { animation: glow 1s linear infinite alternate; }
+
+/* nested blocks */
+.foo {
+ svg { display: none; }
+ .bar { display: inline; }
+}
+
+/* standalone pseudos */
+:first-child { color: pink; }
+:hover { color: blue; }
+:active { color: red; }
+
+/* keyframes (should be ignored) */
+@keyframes fade {
+ from { opacity: 0; }
+ to { opacity: 1; }
+}
+@-webkit-keyframes glow {
+ from { color: coral; }
+ to { color: red; }
+}
+@-moz-keyframes glow {
+ from { color: coral; }
+ to { color: red; }
+}
+@-o-keyframes glow {
+ from { color: coral; }
+ to { color: red; }
+}
+`
+
+describe('node/postcss/isolateStyles', () => {
+ test('transforms selectors and skips keyframes', () => {
+ const out = run(INPUT_CSS)
+ expect(out.css).toMatchSnapshot()
+ })
+
+ test('idempotent (running twice produces identical CSS)', () => {
+ const first = run(INPUT_CSS).css
+ const second = run(first).css
+ expect(second).toBe(first)
+ })
+})
+
+function run(css: string, from = 'src/styles/vp-doc.css') {
+ return postcss([postcssIsolateStyles()]).process(css, { from })
+}
diff --git a/bin/vitepress.js b/bin/vitepress.js
index 7c50ec90..9cf31ae0 100755
--- a/bin/vitepress.js
+++ b/bin/vitepress.js
@@ -1,2 +1,16 @@
#!/usr/bin/env node
+// @ts-check
+
+import module from 'node:module'
+
+// https://github.com/vitejs/vite/blob/6c8a5a27e645a182f5b03a4ed6aa726eab85993f/packages/vite/bin/vite.js#L48-L63
+try {
+ module.enableCompileCache?.()
+ setTimeout(() => {
+ try {
+ module.flushCompileCache?.()
+ } catch {}
+ }, 10 * 1000).unref()
+} catch {}
+
import('../dist/node/cli.js')
diff --git a/docs/.vitepress/config/shared.ts b/docs/.vitepress/config.ts
similarity index 56%
rename from docs/.vitepress/config/shared.ts
rename to docs/.vitepress/config.ts
index 1f4961d2..7be361c8 100644
--- a/docs/.vitepress/config/shared.ts
+++ b/docs/.vitepress/config.ts
@@ -1,17 +1,18 @@
-import { defineConfig } from 'vitepress'
+import {
+ defineConfig,
+ resolveSiteDataByRoute,
+ type HeadConfig
+} from 'vitepress'
import {
groupIconMdPlugin,
groupIconVitePlugin,
localIconLoader
} from 'vitepress-plugin-group-icons'
-import { search as esSearch } from './es'
-import { search as faSearch } from './fa'
-import { search as koSearch } from './ko'
-import { search as ptSearch } from './pt'
-import { search as ruSearch } from './ru'
-import { search as zhSearch } from './zh'
+import llmstxt from 'vitepress-plugin-llms'
+
+const prod = !!process.env.NETLIFY
-export const shared = defineConfig({
+export default defineConfig({
title: 'VitePress',
rewrites: {
@@ -51,6 +52,8 @@ export const shared = defineConfig({
return 'Скопировать код'
case 'zh':
return '复制代码'
+ case 'ja':
+ return 'コードをコピー'
default:
return 'Copy code'
}
@@ -71,18 +74,35 @@ export const shared = defineConfig({
}
},
- /* prettier-ignore */
head: [
- ['link', { rel: 'icon', type: 'image/svg+xml', href: '/vitepress-logo-mini.svg' }],
- ['link', { rel: 'icon', type: 'image/png', href: '/vitepress-logo-mini.png' }],
+ [
+ 'link',
+ { rel: 'icon', type: 'image/svg+xml', href: '/vitepress-logo-mini.svg' }
+ ],
+ [
+ 'link',
+ { rel: 'icon', type: 'image/png', href: '/vitepress-logo-mini.png' }
+ ],
['meta', { name: 'theme-color', content: '#5f67ee' }],
['meta', { property: 'og:type', content: 'website' }],
- ['meta', { property: 'og:locale', content: 'en' }],
- ['meta', { property: 'og:title', content: 'VitePress | Vite & Vue Powered Static Site Generator' }],
['meta', { property: 'og:site_name', content: 'VitePress' }],
- ['meta', { property: 'og:image', content: 'https://vitepress.dev/vitepress-og.jpg' }],
+ [
+ 'meta',
+ {
+ property: 'og:image',
+ content: 'https://vitepress.dev/vitepress-og.jpg'
+ }
+ ],
['meta', { property: 'og:url', content: 'https://vitepress.dev/' }],
- ['script', { src: 'https://cdn.usefathom.com/script.js', 'data-site': 'AZBRSFGG', 'data-spa': 'auto', defer: '' }]
+ [
+ 'script',
+ {
+ src: 'https://cdn.usefathom.com/script.js',
+ 'data-site': 'AZBRSFGG',
+ 'data-spa': 'auto',
+ defer: ''
+ }
+ ]
],
themeConfig: {
@@ -98,30 +118,57 @@ export const shared = defineConfig({
appId: '8J64VVRP8K',
apiKey: '52f578a92b88ad6abde815aae2b0ad7c',
indexName: 'vitepress',
- locales: {
- ...zhSearch,
- ...ptSearch,
- ...ruSearch,
- ...esSearch,
- ...koSearch,
- ...faSearch
- }
+ askAi: 'YaVSonfX5bS8'
}
},
carbonAds: { code: 'CEBDT27Y', placement: 'vuejsorg' }
},
+
+ locales: {
+ root: { label: 'English', lang: 'en-US', dir: 'ltr' },
+ zh: { label: '简体中文', lang: 'zh-Hans', dir: 'ltr' },
+ pt: { label: 'Português', lang: 'pt-BR', dir: 'ltr' },
+ ru: { label: 'Русский', lang: 'ru-RU', dir: 'ltr' },
+ es: { label: 'Español', lang: 'es', dir: 'ltr' },
+ ko: { label: '한국어', lang: 'ko-KR', dir: 'ltr' },
+ fa: { label: 'فارسی', lang: 'fa-IR', dir: 'rtl' },
+ ja: { label: '日本語', lang: 'ja', dir: 'ltr' }
+ },
+
vite: {
plugins: [
groupIconVitePlugin({
customIcon: {
vitepress: localIconLoader(
import.meta.url,
- '../../public/vitepress-logo-mini.svg'
+ '../public/vitepress-logo-mini.svg'
),
firebase: 'logos:firebase'
}
- })
- ]
- }
+ }),
+ prod &&
+ llmstxt({
+ workDir: 'en',
+ ignoreFiles: ['index.md']
+ })
+ ],
+ experimental: {
+ enableNativePlugin: true
+ }
+ },
+
+ transformPageData: prod
+ ? (pageData, ctx) => {
+ const site = resolveSiteDataByRoute(
+ ctx.siteConfig.site,
+ pageData.relativePath
+ )
+ const title = `${pageData.title || site.title} | ${pageData.description || site.description}`
+ ;((pageData.frontmatter.head ??= []) as HeadConfig[]).push(
+ ['meta', { property: 'og:locale', content: site.lang }],
+ ['meta', { property: 'og:title', content: title }]
+ )
+ }
+ : undefined
})
diff --git a/docs/.vitepress/config/index.ts b/docs/.vitepress/config/index.ts
deleted file mode 100644
index 08a81fb9..00000000
--- a/docs/.vitepress/config/index.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { defineConfig } from 'vitepress'
-import { shared } from './shared'
-import { en } from './en'
-import { zh } from './zh'
-import { pt } from './pt'
-import { ru } from './ru'
-import { es } from './es'
-import { ko } from './ko'
-import { fa } from './fa'
-
-export default defineConfig({
- ...shared,
- locales: {
- root: { label: 'English', ...en },
- zh: { label: '简体中文', ...zh },
- pt: { label: 'Português', ...pt },
- ru: { label: 'Русский', ...ru },
- es: { label: 'Español', ...es },
- ko: { label: '한국어', ...ko },
- fa: { label: 'فارسی', ...fa }
- }
-})
diff --git a/docs/.vitepress/theme/styles.css b/docs/.vitepress/theme/styles.css
index ce1c75d2..2635e80d 100644
--- a/docs/.vitepress/theme/styles.css
+++ b/docs/.vitepress/theme/styles.css
@@ -1,5 +1,3 @@
-@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap');
-
:root:where(:lang(fa)) {
--vp-font-family-base:
'Vazirmatn', 'Inter', ui-sans-serif, system-ui, sans-serif,
diff --git a/docs/.vitepress/config/en.ts b/docs/config.ts
similarity index 94%
rename from docs/.vitepress/config/en.ts
rename to docs/config.ts
index 1f619347..8620d955 100644
--- a/docs/.vitepress/config/en.ts
+++ b/docs/config.ts
@@ -1,11 +1,10 @@
import { createRequire } from 'module'
-import { defineConfig, type DefaultTheme } from 'vitepress'
+import { defineAdditionalConfig, type DefaultTheme } from 'vitepress'
const require = createRequire(import.meta.url)
const pkg = require('vitepress/package.json')
-export const en = defineConfig({
- lang: 'en-US',
+export default defineAdditionalConfig({
description: 'Vite & Vue powered static site generator.',
themeConfig: {
@@ -43,6 +42,10 @@ function nav(): DefaultTheme.NavItem[] {
{
text: pkg.version,
items: [
+ {
+ text: '1.6.4',
+ link: 'https://vuejs.github.io/vitepress/v1/'
+ },
{
text: 'Changelog',
link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md'
diff --git a/docs/en/guide/deploy.md b/docs/en/guide/deploy.md
index a4093df2..29d2e1b4 100644
--- a/docs/en/guide/deploy.md
+++ b/docs/en/guide/deploy.md
@@ -111,7 +111,7 @@ Set up a new project and change these settings using your dashboard:
- **Build Command:** `npm run docs:build`
- **Output Directory:** `docs/.vitepress/dist`
-- **Node Version:** `18` (or above)
+- **Node Version:** `20` (or above)
::: warning
Don't enable options like _Auto Minify_ for HTML code. It will remove comments from output which have meaning to Vue. You may see hydration mismatch errors if they get removed.
@@ -163,7 +163,7 @@ Don't enable options like _Auto Minify_ for HTML code. It will remove comments f
- name: Setup Node
uses: actions/setup-node@v4
with:
- node-version: 20
+ node-version: 22
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
@@ -294,6 +294,10 @@ You can deploy your VitePress website on [Kinsta](https://kinsta.com/static-site
You can deploy your VitePress project to [Stormkit](https://www.stormkit.io) by following these [instructions](https://stormkit.io/blog/how-to-deploy-vitepress).
+### CloudRay
+
+You can deploy your VitePress project with [CloudRay](https://cloudray.io/) by following these [instructions](https://cloudray.io/articles/how-to-deploy-vitepress-site).
+
### Nginx
Here is a example of an Nginx server block configuration. This setup includes gzip compression for common text-based assets, rules for serving your VitePress site's static files with proper caching headers as well as handling `cleanUrls: true`.
diff --git a/docs/en/guide/extending-default-theme.md b/docs/en/guide/extending-default-theme.md
index 799d1773..4d18d8c5 100644
--- a/docs/en/guide/extending-default-theme.md
+++ b/docs/en/guide/extending-default-theme.md
@@ -70,7 +70,7 @@ If your font is a local file referenced via `@font-face`, it will be processed a
export default {
transformHead({ assets }) {
// adjust the regex accordingly to match your font
- const myFontFile = assets.find(file => /font-name\.\w+\.woff2/)
+ const myFontFile = assets.find(file => /font-name\.[\w-]+\.woff2/.test(file))
if (myFontFile) {
return [
[
@@ -252,6 +252,7 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
{
duration: 300,
easing: 'ease-in',
+ fill: 'forwards',
pseudoElement: `::view-transition-${isDark.value ? 'old' : 'new'}(root)`
}
)
@@ -319,7 +320,7 @@ export default defineConfig({
{
find: /^.*\/VPNavBar\.vue$/,
replacement: fileURLToPath(
- new URL('./components/CustomNavBar.vue', import.meta.url)
+ new URL('./theme/components/CustomNavBar.vue', import.meta.url)
)
}
]
diff --git a/docs/en/guide/getting-started.md b/docs/en/guide/getting-started.md
index 01b64a1b..79cb3180 100644
--- a/docs/en/guide/getting-started.md
+++ b/docs/en/guide/getting-started.md
@@ -18,39 +18,19 @@ VitePress can be used on its own, or be installed into an existing project. In b
::: code-group
```sh [npm]
-$ npm add -D vitepress
+$ npm add -D vitepress@next
```
```sh [pnpm]
-$ pnpm add -D vitepress
+$ pnpm add -D vitepress@next
```
```sh [yarn]
-$ yarn add -D vitepress
-```
-
-```sh [yarn (pnp)]
-$ yarn add -D vitepress vue
+$ yarn add -D vitepress@next vue
```
```sh [bun]
-$ bun add -D vitepress
-```
-
-:::
-
-::: details Getting missing peer deps warnings?
-If using PNPM, you will notice a missing peer warning for `@docsearch/js`. This does not prevent VitePress from working. If you wish to suppress this warning, add the following to your `package.json`:
-
-```json
-"pnpm": {
- "peerDependencyRules": {
- "ignoreMissing": [
- "@algolia/client-search",
- "search-insights"
- ]
- }
-}
+$ bun add -D vitepress@next
```
:::
diff --git a/docs/en/guide/markdown.md b/docs/en/guide/markdown.md
index bbd2b2a3..e1be3e6b 100644
--- a/docs/en/guide/markdown.md
+++ b/docs/en/guide/markdown.md
@@ -277,11 +277,11 @@ Wraps in a `
`
}
```
- It uses [`postcss-prefix-selector`](https://github.com/RadValentin/postcss-prefix-selector) under the hood. You can pass its options like this:
+ You can pass its options like this:
```js
postcssIsolateStyles({
- includeFiles: [/vp-doc\.css/] // defaults to /base\.css/
+ includeFiles: [/custom\.css/] // defaults to [/vp-doc\.css/, /base\.css/]
})
```
@@ -365,7 +365,7 @@ export default {
A [list of valid languages](https://shiki.style/languages) is available on Shiki's repository.
-You may also customize syntax highlight theme in app config. Please see [`markdown` options](../reference/site-config#markdown) for more details.
+You may also customize syntax highlight theme, configure language aliases, and set custom language labels in app config. Please see [`markdown` options](../reference/site-config#markdown) for more details.
## Line Highlighting in Code Blocks
@@ -781,7 +781,7 @@ You can also [import snippets](#import-code-snippets) in code groups:
You can include a markdown file in another markdown file, even nested.
::: tip
-You can also prefix the markdown path with `@`, it will act as the source root. By default, it's the VitePress project root, unless `srcDir` is configured.
+You can also prefix the markdown path with `@`, and it will act as the source root. By default, the source root is the VitePress project root, unless `srcDir` is configured.
:::
For example, you can include a relative markdown file using this:
diff --git a/docs/en/guide/routing.md b/docs/en/guide/routing.md
index 1f3569a7..bacdbf6b 100644
--- a/docs/en/guide/routing.md
+++ b/docs/en/guide/routing.md
@@ -336,6 +336,46 @@ export default {
}
```
+### Watching Template and Data Files
+
+When generating page content from templates or external data sources, you can use the watch option to automatically rebuild pages when those files change during development:
+
+```js
+// posts/[slug].paths.js
+import fs from 'node:fs'
+import { renderTemplate } from './templates/renderer.js'
+
+export default {
+ // Watch for changes to template files and data sources
+ watch: [
+ './templates/**/*.njk', // Template files
+ '../data/**/*.json' // Data files
+ ],
+
+ paths(watchedFiles) {
+ // watchedFiles will be an array of absolute paths of the matched files
+ // Read data files to generate routes
+ const dataFiles = watchedFiles.filter(file => file.endsWith('.json'))
+
+ return dataFiles.map(file => {
+ const data = JSON.parse(fs.readFileSync(file, 'utf-8'))
+
+ return {
+ params: { slug: data.slug },
+ content: renderTemplate(data) // Use template to generate content
+ }
+ })
+ }
+}
+```
+
+The `watch` option works the same way as in [data loaders](./data-loading#data-from-local-files):
+
+- Accepts [glob patterns](https://github.com/mrmlnc/fast-glob#pattern-syntax) to match files
+- Patterns are relative to the `.paths.js` file itself
+- Changes to watched files trigger page regeneration and HMR during development
+- In production builds, all pages are generated once regardless of watch configuration
+
### Accessing Params in Page
You can use the params to pass additional data to each page. The Markdown route file can access the current page params in Vue expressions via the `$params` global property:
diff --git a/docs/en/guide/what-is-vitepress.md b/docs/en/guide/what-is-vitepress.md
index a498d17e..3407c76d 100644
--- a/docs/en/guide/what-is-vitepress.md
+++ b/docs/en/guide/what-is-vitepress.md
@@ -12,7 +12,7 @@ Just want to try it out? Skip to the [Quickstart](./getting-started).
- **Documentation**
- VitePress ships with a default theme designed for technical documentation. It powers this page you are reading right now, along with the documentation for [Vite](https://vitejs.dev/), [Rollup](https://rollupjs.org/), [Pinia](https://pinia.vuejs.org/), [VueUse](https://vueuse.org/), [Vitest](https://vitest.dev/), [D3](https://d3js.org/), [UnoCSS](https://unocss.dev/), [Iconify](https://iconify.design/) and [many more](https://www.vuetelescope.com/explore?framework.slug=vitepress).
+ VitePress ships with a default theme designed for technical documentation. It powers this page you are reading right now, along with the documentation for [Vite](https://vitejs.dev/), [Rollup](https://rollupjs.org/), [Pinia](https://pinia.vuejs.org/), [VueUse](https://vueuse.org/), [Vitest](https://vitest.dev/), [D3](https://d3js.org/), [UnoCSS](https://unocss.dev/), [Iconify](https://iconify.design/) and [many more](https://github.com/search?q=/"vitepress":+/+language:json&type=code).
The [official Vue.js documentation](https://vuejs.org/) is also based on VitePress, but uses a custom theme shared between multiple translations.
@@ -50,8 +50,8 @@ Unlike many traditional SSGs where each navigation results in a full page reload
## What About VuePress?
-VitePress is the spiritual successor of VuePress. The original VuePress was based on Vue 2 and webpack. With Vue 3 and Vite under the hood, VitePress provides significantly better DX, better production performance, a more polished default theme, and a more flexible customization API.
+VitePress is the spiritual successor of VuePress 1. The original VuePress 1 was based on Vue 2 and webpack. With Vue 3 and Vite under the hood, VitePress provides significantly better DX, better production performance, a more polished default theme, and a more flexible customization API.
-The API difference between VitePress and VuePress mostly lies in theming and customization. If you are using VuePress 1 with the default theme, it should be relatively straightforward to migrate to VitePress.
+The API difference between VitePress and VuePress 1 mostly lies in theming and customization. If you are using VuePress 1 with the default theme, it should be relatively straightforward to migrate to VitePress.
-There has also been effort invested into VuePress 2, which also supports Vue 3 and Vite with more compatibility with VuePress 1. However, maintaining two SSGs in parallel isn't sustainable, so the Vue team has decided to focus on VitePress as the main recommended SSG in the long run.
+Maintaining two SSGs in parallel isn't sustainable, so the Vue team has decided to focus on VitePress as the main recommended SSG in the long run. Now VuePress 1 has been deprecated, and VuePress 2 has been handed over to the VuePress community team for further development and maintenance.
diff --git a/docs/en/index.md b/docs/en/index.md
index c91ce953..6c49a313 100644
--- a/docs/en/index.md
+++ b/docs/en/index.md
@@ -1,9 +1,6 @@
---
layout: home
-title: VitePress
-titleTemplate: Vite & Vue Powered Static Site Generator
-
hero:
name: VitePress
text: Vite & Vue Powered Static Site Generator
@@ -11,10 +8,10 @@ hero:
actions:
- theme: brand
text: What is VitePress?
- link: /guide/what-is-vitepress
+ link: ./guide/what-is-vitepress
- theme: alt
text: Quickstart
- link: /guide/getting-started
+ link: ./guide/getting-started
- theme: alt
text: GitHub
link: https://github.com/vuejs/vitepress
diff --git a/docs/en/reference/cli.md b/docs/en/reference/cli.md
index 85517620..9f2cadfa 100644
--- a/docs/en/reference/cli.md
+++ b/docs/en/reference/cli.md
@@ -43,7 +43,6 @@ vitepress build [root]
| `--base ` | Public base path (default: `/`) (`string`) |
| `--target ` | Transpile target (default: `"modules"`) (`string`) |
| `--outDir ` | Output directory relative to **cwd** (default: `/.vitepress/dist`) (`string`) |
-| `--minify [minifier]` | Enable/disable minification, or specify minifier to use (default: `"esbuild"`) (`boolean \| "terser" \| "esbuild"`) |
| `--assetsInlineLimit ` | Static asset base64 inline threshold in bytes (default: `4096`) (`number`) |
## `vitepress preview`
diff --git a/docs/en/reference/default-theme-config.md b/docs/en/reference/default-theme-config.md
index c8afc554..4868cda3 100644
--- a/docs/en/reference/default-theme-config.md
+++ b/docs/en/reference/default-theme-config.md
@@ -89,7 +89,7 @@ type NavItem = NavItemWithLink | NavItemWithChildren
interface NavItemWithLink {
text: string
- link: string
+ link: string | ((payload: PageData) => string)
activeMatch?: string
target?: string
rel?: string
@@ -457,3 +457,38 @@ Can be used to customize the label of the skip to content link. This link is sho
- Default: `false`
Whether to show an external link icon next to external links in markdown.
+
+## `useLayout`
+
+Returns layout-related data. The returned object has the following type:
+
+```ts
+interface {
+ isHome: ComputedRef
+
+ sidebar: Readonly>
+ sidebarGroups: ComputedRef
+ hasSidebar: ComputedRef
+ isSidebarEnabled: ComputedRef
+
+ hasAside: ComputedRef
+ leftAside: ComputedRef
+
+ headers: Readonly>
+ hasLocalNav: ComputedRef
+}
+```
+
+**Example:**
+
+```vue
+
+
+
+
Only show when sidebar exists
+
+```
diff --git a/docs/en/reference/default-theme-last-updated.md b/docs/en/reference/default-theme-last-updated.md
index 00fed72a..55603269 100644
--- a/docs/en/reference/default-theme-last-updated.md
+++ b/docs/en/reference/default-theme-last-updated.md
@@ -2,8 +2,27 @@
The update time of the last content will be displayed in the lower right corner of the page. To enable it, add `lastUpdated` options to your config.
-::: tip
-You need to commit the markdown file to see the updated time.
+::: info
+VitePress displays the "last updated" time using the timestamp of the most recent Git commit for each file. To enable this, the Markdown file must be committed to Git.
+
+Internally, VitePress runs `git log -1 --pretty="%ai"` on each file to retrieve its timestamp. If all pages show the same update time, it's likely due to shallow cloning (common in CI environments), which limits Git history.
+
+To fix this in **GitHub Actions**, use the following in your workflow:
+
+```yaml{4}
+- name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+```
+
+Other CI/CD platforms have similar settings.
+
+If such options aren't available, you can prepend the `docs:build` command in your `package.json` with a manual fetch:
+
+```json
+"docs:build": "git fetch --unshallow && vitepress build docs"
+```
:::
## Site-Level Config
diff --git a/docs/en/reference/default-theme-nav.md b/docs/en/reference/default-theme-nav.md
index b55a63cb..f7be114d 100644
--- a/docs/en/reference/default-theme-nav.md
+++ b/docs/en/reference/default-theme-nav.md
@@ -55,6 +55,8 @@ export default {
The `text` is the actual text displayed in nav, and the `link` is the link that will be navigated to when the text is clicked. For the link, set path to the actual file without `.md` prefix, and always start with `/`.
+The `link` can also be a function that accepts [`PageData`](./runtime-api#usedata) as the argument and returns the path.
+
Nav links can also be dropdown menus. To do this, set `items` key on link option.
```js
diff --git a/docs/en/reference/default-theme-search.md b/docs/en/reference/default-theme-search.md
index d647e32e..6bc2f446 100644
--- a/docs/en/reference/default-theme-search.md
+++ b/docs/en/reference/default-theme-search.md
@@ -6,7 +6,7 @@ outline: deep
## Local Search
-VitePress supports fuzzy full-text search using a in-browser index thanks to [minisearch](https://github.com/lucaong/minisearch/). To enable this feature, simply set the `themeConfig.search.provider` option to `'local'` in your `.vitepress/config.ts` file:
+VitePress supports fuzzy full-text search using an in-browser index thanks to [minisearch](https://github.com/lucaong/minisearch/). To enable this feature, simply set the `themeConfig.search.provider` option to `'local'` in your `.vitepress/config.ts` file:
```ts
import { defineConfig } from 'vitepress'
@@ -233,10 +233,16 @@ export default defineConfig({
},
modal: {
searchBox: {
- resetButtonTitle: '清除查询条件',
- resetButtonAriaLabel: '清除查询条件',
- cancelButtonText: '取消',
- cancelButtonAriaLabel: '取消'
+ clearButtonTitle: '清除查询条件',
+ clearButtonAriaLabel: '清除查询条件',
+ closeButtonText: '关闭',
+ closeButtonAriaLabel: '关闭',
+ placeholderText: '搜索文档',
+ placeholderTextAskAi: '向 AI 提问:',
+ placeholderTextAskAiStreaming: '回答中...',
+ searchInputLabel: '搜索',
+ backToKeywordSearchButtonText: '返回关键字搜索',
+ backToKeywordSearchButtonAriaLabel: '返回关键字搜索'
},
startScreen: {
recentSearchesTitle: '搜索历史',
@@ -244,23 +250,48 @@ export default defineConfig({
saveRecentSearchButtonTitle: '保存至搜索历史',
removeRecentSearchButtonTitle: '从搜索历史中移除',
favoriteSearchesTitle: '收藏',
- removeFavoriteSearchButtonTitle: '从收藏中移除'
+ removeFavoriteSearchButtonTitle: '从收藏中移除',
+ recentConversationsTitle: '最近的对话',
+ removeRecentConversationButtonTitle: '从历史记录中删除对话'
},
errorScreen: {
titleText: '无法获取结果',
helpText: '你可能需要检查你的网络连接'
},
- footer: {
- selectText: '选择',
- navigateText: '切换',
- closeText: '关闭',
- searchByText: '搜索提供者'
- },
noResultsScreen: {
noResultsText: '无法找到相关结果',
suggestedQueryText: '你可以尝试查询',
reportMissingResultsText: '你认为该查询应该有结果?',
reportMissingResultsLinkText: '点击反馈'
+ },
+ resultsScreen: {
+ askAiPlaceholder: '向 AI 提问: '
+ },
+ askAiScreen: {
+ disclaimerText: '答案由 AI 生成,可能不准确,请自行验证。',
+ relatedSourcesText: '相关来源',
+ thinkingText: '思考中...',
+ copyButtonText: '复制',
+ copyButtonCopiedText: '已复制!',
+ copyButtonTitle: '复制',
+ likeButtonTitle: '赞',
+ dislikeButtonTitle: '踩',
+ thanksForFeedbackText: '感谢你的反馈!',
+ preToolCallText: '搜索中...',
+ duringToolCallText: '搜索 ',
+ afterToolCallText: '已搜索'
+ },
+ footer: {
+ selectText: '选择',
+ submitQuestionText: '提交问题',
+ selectKeyAriaLabel: 'Enter 键',
+ navigateText: '切换',
+ navigateUpKeyAriaLabel: '向上箭头',
+ navigateDownKeyAriaLabel: '向下箭头',
+ closeText: '关闭',
+ backToSearchText: '返回搜索',
+ closeKeyAriaLabel: 'Esc 键',
+ poweredByText: '搜索提供者'
}
}
}
@@ -274,6 +305,43 @@ export default defineConfig({
[These options](https://github.com/vuejs/vitepress/blob/main/types/docsearch.d.ts) can be overridden. Refer official Algolia docs to learn more about them.
+### Algolia Ask AI Support {#ask-ai}
+
+If you would like to include **Ask AI**, pass the `askAi` option (or any of the partial fields) inside `options`:
+
+```ts
+import { defineConfig } from 'vitepress'
+
+export default defineConfig({
+ themeConfig: {
+ search: {
+ provider: 'algolia',
+ options: {
+ appId: '...',
+ apiKey: '...',
+ indexName: '...',
+ // askAi: "YOUR-ASSISTANT-ID"
+ // OR
+ askAi: {
+ // at minimum you must provide the assistantId you received from Algolia
+ assistantId: 'XXXYYY',
+ // optional overrides – if omitted, the top-level appId/apiKey/indexName values are reused
+ // apiKey: '...',
+ // appId: '...',
+ // indexName: '...'
+ }
+ }
+ }
+ }
+})
+```
+
+::: warning Note
+If want to default to keyword search and do not want to use Ask AI, just omit the `askAi` property
+:::
+
+The translations for the Ask AI UI live under `options.translations.modal.askAiScreen` and `options.translations.resultsScreen` — see the [type definitions](https://github.com/vuejs/vitepress/blob/main/types/docsearch.d.ts) for all keys.
+
### Crawler Config
Here is an example config based on what this site uses:
diff --git a/docs/en/reference/default-theme-sidebar.md b/docs/en/reference/default-theme-sidebar.md
index 9a64a074..67893cf6 100644
--- a/docs/en/reference/default-theme-sidebar.md
+++ b/docs/en/reference/default-theme-sidebar.md
@@ -180,36 +180,3 @@ export default {
}
}
```
-
-## `useSidebar`
-
-Returns sidebar-related data. The returned object has the following type:
-
-```ts
-export interface DocSidebar {
- isOpen: Ref
- sidebar: ComputedRef
- sidebarGroups: ComputedRef
- hasSidebar: ComputedRef
- hasAside: ComputedRef
- leftAside: ComputedRef
- isSidebarEnabled: ComputedRef
- open: () => void
- close: () => void
- toggle: () => void
-}
-```
-
-**Example:**
-
-```vue
-
-
-
-
`는 블록 엘리먼트를 내부에 배치할 수 없기 때문에 하이드레이션 불일치가 발생합니다.
+커스텀 컴포넌트의 이름에 하이픈이 포함되어 있거나 파스칼케이스(PascalCase)인지 확인하세요. 그렇지 않으면 인라인 요소로 처리되어 `
` 태그 안에 래핑됩니다. `
`는 블록 엘리먼트를 내부에 배치할 수 없기 때문에 하이드레이션 불일치가 발생합니다.
:::
### 헤더에 컴포넌트 사용하기 {#using-components-in-headers}
diff --git a/docs/ko/guide/what-is-vitepress.md b/docs/ko/guide/what-is-vitepress.md
index 9ad43c45..a2ed0dee 100644
--- a/docs/ko/guide/what-is-vitepress.md
+++ b/docs/ko/guide/what-is-vitepress.md
@@ -12,7 +12,7 @@ VitePress는 빠르고 컨텐츠 중심의 웹사이트를 구축하기 위해
- **문서화**
- VitePress는 기술 문서를 위해 설계된 기본 테마가 함께 제공됩니다. 지금 읽고 있는 이 페이지와 [Vite](https://vitejs.dev/), [Rollup](https://rollupjs.org/), [Pinia](https://pinia.vuejs.org/), [VueUse](https://vueuse.org/), [Vitest](https://vitest.dev/), [D3](https://d3js.org/), [UnoCSS](https://unocss.dev/), [Iconify](https://iconify.design/) 및 [다양한 프로젝트](https://www.vuetelescope.com/explore?framework.slug=vitepress) 문서는 모두 이 테마를 기반으로 합니다.
+ VitePress는 기술 문서를 위해 설계된 기본 테마가 함께 제공됩니다. 지금 읽고 있는 이 페이지와 [Vite](https://vitejs.dev/), [Rollup](https://rollupjs.org/), [Pinia](https://pinia.vuejs.org/), [VueUse](https://vueuse.org/), [Vitest](https://vitest.dev/), [D3](https://d3js.org/), [UnoCSS](https://unocss.dev/), [Iconify](https://iconify.design/) 및 [다양한 프로젝트](https://github.com/search?q=/"vitepress":+/+language:json&type=code) 문서는 모두 이 테마를 기반으로 합니다.
[Vue.js 공식 문서](https://vuejs.org/)도 VitePress 기반으로 되어 있으며, 여러 번역본에 걸쳐 공유되는 커스텀 테마를 사용합니다.
diff --git a/docs/ko/index.md b/docs/ko/index.md
index 3ddaa07d..aa8be95b 100644
--- a/docs/ko/index.md
+++ b/docs/ko/index.md
@@ -1,9 +1,6 @@
---
layout: home
-title: VitePress
-titleTemplate: Vite & Vue 기반 정적 사이트 생성기
-
hero:
name: VitePress
text: Vite & Vue 기반 정적 사이트 생성기
@@ -11,10 +8,10 @@ hero:
actions:
- theme: brand
text: VitePress란 무엇인가?
- link: /ko/guide/what-is-vitepress
+ link: ./guide/what-is-vitepress
- theme: alt
text: 빠른 시작
- link: /ko/guide/getting-started
+ link: ./guide/getting-started
- theme: alt
text: GitHub
link: https://github.com/vuejs/vitepress
diff --git a/docs/ko/reference/cli.md b/docs/ko/reference/cli.md
index 4a76bd01..b81cb165 100644
--- a/docs/ko/reference/cli.md
+++ b/docs/ko/reference/cli.md
@@ -43,7 +43,6 @@ vitepress build [root]
| `--base ` | Public 기본 경로 (기본값: `/`) (`string`) |
| `--target ` | 트랜스파일 대상 (기본값: `"modules"`) (`string`) |
| `--outDir ` | **cwd** 기준 출력 디렉터리 (기본값: `/.vitepress/dist`) (`string`) |
-| `--minify [minifier]` | minify 활성화/비활성화 또는 사용할 minify 도구 지정 (기본값: `"esbuild"`) (`boolean \| "terser" \| "esbuild"`) |
| `--assetsInlineLimit `| 바이트 단위의 정적 에셋 base64 인라인 임계값 (기본값: `4096`) (`number`) |
## `vitepress preview`
diff --git a/docs/ko/reference/default-theme-config.md b/docs/ko/reference/default-theme-config.md
index b0df3361..66b2f4e0 100644
--- a/docs/ko/reference/default-theme-config.md
+++ b/docs/ko/reference/default-theme-config.md
@@ -89,7 +89,7 @@ type NavItem = NavItemWithLink | NavItemWithChildren
interface NavItemWithLink {
text: string
- link: string
+ link: string | ((payload: PageData) => string)
activeMatch?: string
target?: string
rel?: string
diff --git a/docs/ko/reference/default-theme-nav.md b/docs/ko/reference/default-theme-nav.md
index cdfdc7ef..433c2e07 100644
--- a/docs/ko/reference/default-theme-nav.md
+++ b/docs/ko/reference/default-theme-nav.md
@@ -55,6 +55,8 @@ export default {
`text`는 네비게이션 바에 표시되는 실제 텍스트이며, `link`는 텍스트를 클릭했을 때 이동할 링크입니다. 링크의 경로는 `.md` 접미사 없이 실제 파일 경로로 설정하며, 항상 `/`로 시작해야 합니다.
+`link`는 또한 [`PageData`](./runtime-api#usedata)를 인자로 받아 경로를 반환하는 함수가 될 수도 있습니다.
+
네비게이션 바 링크는 드롭다운 메뉴가 될 수 있습니다. 이를 위해 `link` 옵션에 `items` 키를 설정합니다.
```js
diff --git a/docs/ko/reference/default-theme-search.md b/docs/ko/reference/default-theme-search.md
index 69b633aa..03eda030 100644
--- a/docs/ko/reference/default-theme-search.md
+++ b/docs/ko/reference/default-theme-search.md
@@ -377,3 +377,20 @@ new Crawler({
}
})
```
+
+### Algolia Ask AI 지원 {#ask-ai}
+
+**Ask AI** 기능을 사용하려면 `askAi` 옵션을 추가하세요:
+
+```ts
+options: {
+ appId: '...',
+ apiKey: '...',
+ indexName: '...',
+ askAi: { assistantId: 'XXXYYY' }
+}
+```
+
+::: warning 참고
+Ask AI를 사용하지 않으려면 `askAi` 옵션을 생략하면 됩니다.
+:::
diff --git a/docs/ko/reference/default-theme-sidebar.md b/docs/ko/reference/default-theme-sidebar.md
index 21e19ccc..8e4709cd 100644
--- a/docs/ko/reference/default-theme-sidebar.md
+++ b/docs/ko/reference/default-theme-sidebar.md
@@ -180,36 +180,3 @@ export default {
}
}
```
-
-## `useSidebar`
-
-사이드바 관련 데이터를 반환합니다. 반환된 객체는 다음과 같은 타입을 가집니다:
-
-```ts
-export interface DocSidebar {
- isOpen: Ref
- sidebar: ComputedRef
- sidebarGroups: ComputedRef
- hasSidebar: ComputedRef
- hasAside: ComputedRef
- leftAside: ComputedRef
- isSidebarEnabled: ComputedRef
- open: () => void
- close: () => void
- toggle: () => void
-}
-```
-
-**예제:**
-
-```vue
-
-
-
-
사이드바가 있을 때만 보여줍니다
-
-```
diff --git a/docs/ko/reference/default-theme-team-page.md b/docs/ko/reference/default-theme-team-page.md
index 2123f349..b4fddb0f 100644
--- a/docs/ko/reference/default-theme-team-page.md
+++ b/docs/ko/reference/default-theme-team-page.md
@@ -53,12 +53,12 @@ const members = [
Say hello to our awesome team.
-
+
```
위 코드는 카드 형태의 엘리먼트로 팀 구성원을 표시합니다. 아래와 비슷한 형태로 표시됩니다.
-
+
`` 컴포넌트는 `small`과 `medium` 두 가지 크기로 제공됩니다. 개인의 선호도에 따라 선택할 수 있지만, 일반적으로 `small` 사이즈가 문서 페이지에 더 적합합니다. 또한, 각 구성원에 "설명"이나 "후원" 버튼과 같은 프로퍼티를 추가할 수도 있습니다. 자세한 내용은 [``](#vpteammembers)에서 확인할 수 있습니다.
@@ -107,9 +107,7 @@ const members = [
team, some of whom have chosen to be featured below.
-
+
```
diff --git a/docs/ko/reference/site-config.md b/docs/ko/reference/site-config.md
index 949b8452..ad5a717d 100644
--- a/docs/ko/reference/site-config.md
+++ b/docs/ko/reference/site-config.md
@@ -458,7 +458,7 @@ export default {
### ignoreDeadLinks
-- 타입: `boolean | 'localhostLinks' | (string | RegExp | ((link: string) => boolean))[]`
+- 타입: `boolean | 'localhostLinks' | (string | RegExp | ((link: string, source: string) => boolean))[]`
- 기본값: `false`
`true`로 설정하면, 빌드 시 죽은 링크로 인해 실패하지 않습니다.
diff --git a/docs/lunaria.config.json b/docs/lunaria.config.json
index 60abdd98..2de958b9 100644
--- a/docs/lunaria.config.json
+++ b/docs/lunaria.config.json
@@ -6,8 +6,8 @@
},
"files": [
{
- "location": ".vitepress/config/{en,zh,pt,ru,es,ko,fa}.ts",
- "pattern": ".vitepress/config/@lang.ts",
+ "location": "**/config.ts",
+ "pattern": "@lang/@path",
"type": "universal"
},
{
@@ -44,6 +44,10 @@
{
"label": "فارسی",
"lang": "fa"
+ },
+ {
+ "label": "日本語",
+ "lang": "ja"
}
],
"outDir": ".vitepress/dist/_translations",
diff --git a/docs/package.json b/docs/package.json
index d3c19d0c..f0aa0873 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -13,8 +13,9 @@
"@lunariajs/core": "^0.1.1",
"markdown-it-mathjax3": "^4.3.2",
"open-cli": "^8.0.0",
- "postcss-rtlcss": "^5.6.0",
+ "postcss-rtlcss": "^5.7.1",
"vitepress": "workspace:*",
- "vitepress-plugin-group-icons": "^1.3.6"
+ "vitepress-plugin-group-icons": "^1.6.3",
+ "vitepress-plugin-llms": "^1.7.3"
}
}
diff --git a/docs/.vitepress/config/pt.ts b/docs/pt/config.ts
similarity index 67%
rename from docs/.vitepress/config/pt.ts
rename to docs/pt/config.ts
index 12cb52fa..ae71473d 100644
--- a/docs/.vitepress/config/pt.ts
+++ b/docs/pt/config.ts
@@ -1,16 +1,17 @@
import { createRequire } from 'module'
-import { defineConfig, type DefaultTheme } from 'vitepress'
+import { defineAdditionalConfig, type DefaultTheme } from 'vitepress'
const require = createRequire(import.meta.url)
const pkg = require('vitepress/package.json')
-export const pt = defineConfig({
- lang: 'pt-BR',
+export default defineAdditionalConfig({
description: 'Gerador de Site Estático desenvolvido com Vite e Vue.',
themeConfig: {
nav: nav(),
+ search: { options: searchOptions() },
+
sidebar: {
'/pt/guide/': { base: '/pt/guide/', items: sidebarGuide() },
'/pt/reference/': { base: '/pt/reference/', items: sidebarReference() }
@@ -36,11 +37,15 @@ export const pt = defineConfig({
},
lastUpdated: {
- text: 'Atualizado em',
- formatOptions: {
- dateStyle: 'short',
- timeStyle: 'medium'
- }
+ text: 'Atualizado em'
+ },
+
+ notFound: {
+ title: 'PÁGINA NÃO ENCONTRADA',
+ quote:
+ 'Mas se você não mudar de direção e continuar procurando, pode acabar onde está indo.',
+ linkLabel: 'ir para a página inicial',
+ linkText: 'Me leve para casa'
},
langMenuLabel: 'Alterar Idioma',
@@ -68,6 +73,10 @@ function nav(): DefaultTheme.NavItem[] {
{
text: pkg.version,
items: [
+ {
+ text: '1.6.4',
+ link: 'https://vuejs.github.io/vitepress/v1/pt/'
+ },
{
text: 'Registro de Mudanças',
link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md'
@@ -167,8 +176,8 @@ function sidebarReference(): DefaultTheme.SidebarItem[] {
]
}
-export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = {
- pt: {
+function searchOptions(): Partial {
+ return {
placeholder: 'Pesquisar documentos',
translations: {
button: {
@@ -177,35 +186,69 @@ export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = {
},
modal: {
searchBox: {
- resetButtonTitle: 'Limpar pesquisa',
- resetButtonAriaLabel: 'Limpar pesquisa',
- cancelButtonText: 'Cancelar',
- cancelButtonAriaLabel: 'Cancelar'
+ clearButtonTitle: 'Limpar pesquisa',
+ clearButtonAriaLabel: 'Limpar pesquisa',
+ closeButtonText: 'Fechar',
+ closeButtonAriaLabel: 'Fechar',
+ placeholderText: 'Pesquisar documentos',
+ placeholderTextAskAi: 'Pergunte à IA: ',
+ placeholderTextAskAiStreaming: 'Respondendo...',
+ searchInputLabel: 'Pesquisar',
+ backToKeywordSearchButtonText: 'Voltar à pesquisa por palavras-chave',
+ backToKeywordSearchButtonAriaLabel:
+ 'Voltar à pesquisa por palavras-chave'
},
startScreen: {
- recentSearchesTitle: 'Histórico de Pesquisa',
+ recentSearchesTitle: 'Histórico de pesquisa',
noRecentSearchesText: 'Nenhuma pesquisa recente',
saveRecentSearchButtonTitle: 'Salvar no histórico de pesquisas',
removeRecentSearchButtonTitle: 'Remover do histórico de pesquisas',
favoriteSearchesTitle: 'Favoritos',
- removeFavoriteSearchButtonTitle: 'Remover dos favoritos'
+ removeFavoriteSearchButtonTitle: 'Remover dos favoritos',
+ recentConversationsTitle: 'Conversas recentes',
+ removeRecentConversationButtonTitle:
+ 'Remover esta conversa do histórico'
},
errorScreen: {
titleText: 'Não foi possível obter resultados',
- helpText: 'Verifique a sua conexão de rede'
+ helpText: 'Verifique sua conexão de rede'
+ },
+ noResultsScreen: {
+ noResultsText: 'Nenhum resultado encontrado',
+ suggestedQueryText: 'Você pode tentar uma nova consulta',
+ reportMissingResultsText: 'Acha que deveria haver resultados?',
+ reportMissingResultsLinkText: 'Clique para enviar feedback'
+ },
+ resultsScreen: {
+ askAiPlaceholder: 'Pergunte à IA: '
+ },
+ askAiScreen: {
+ disclaimerText:
+ 'As respostas são geradas por IA e podem conter erros. Verifique as respostas.',
+ relatedSourcesText: 'Fontes relacionadas',
+ thinkingText: 'Pensando...',
+ copyButtonText: 'Copiar',
+ copyButtonCopiedText: 'Copiado!',
+ copyButtonTitle: 'Copiar',
+ likeButtonTitle: 'Curtir',
+ dislikeButtonTitle: 'Não curtir',
+ thanksForFeedbackText: 'Obrigado pelo feedback!',
+ preToolCallText: 'Pesquisando...',
+ duringToolCallText: 'Pesquisando ',
+ afterToolCallText: 'Pesquisa concluída',
+ aggregatedToolCallText: 'Pesquisa concluída'
},
footer: {
selectText: 'Selecionar',
+ submitQuestionText: 'Enviar pergunta',
+ selectKeyAriaLabel: 'Tecla Enter',
navigateText: 'Navegar',
+ navigateUpKeyAriaLabel: 'Seta para cima',
+ navigateDownKeyAriaLabel: 'Seta para baixo',
closeText: 'Fechar',
- searchByText: 'Pesquisa por'
- },
- noResultsScreen: {
- noResultsText: 'Não foi possível encontrar resultados',
- suggestedQueryText: 'Você pode tentar uma nova consulta',
- reportMissingResultsText:
- 'Deveriam haver resultados para essa consulta?',
- reportMissingResultsLinkText: 'Clique para enviar feedback'
+ backToSearchText: 'Voltar à pesquisa',
+ closeKeyAriaLabel: 'Tecla Escape',
+ poweredByText: 'Pesquisa por'
}
}
}
diff --git a/docs/pt/guide/deploy.md b/docs/pt/guide/deploy.md
index 9a03631b..b112bf7d 100644
--- a/docs/pt/guide/deploy.md
+++ b/docs/pt/guide/deploy.md
@@ -163,7 +163,7 @@ Não ative opções como _Auto Minify_ para código HTML. Isso removerá coment
- name: Setup Node
uses: actions/setup-node@v4
with:
- node-version: 20
+ node-version: 22
cache: npm # ou pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
diff --git a/docs/pt/guide/extending-default-theme.md b/docs/pt/guide/extending-default-theme.md
index 08aea50a..f3175f83 100644
--- a/docs/pt/guide/extending-default-theme.md
+++ b/docs/pt/guide/extending-default-theme.md
@@ -70,7 +70,7 @@ Se a sua fonte é um arquivo local referenciado via `@font-face`, ela será proc
export default {
transformHead({ assets }) {
// ajuste o regex para corresponder à sua fonte
- const myFontFile = assets.find(file => /font-name\.\w+\.woff2/)
+ const myFontFile = assets.find(file => /font-name\.[\w-]+\.woff2/.test(file))
if (myFontFile) {
return [
[
@@ -251,6 +251,7 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
{
duration: 300,
easing: 'ease-in',
+ fill: 'forwards',
pseudoElement: `::view-transition-${isDark.value ? 'old' : 'new'}(root)`
}
)
diff --git a/docs/pt/guide/getting-started.md b/docs/pt/guide/getting-started.md
index e6668cb2..c0dba3a9 100644
--- a/docs/pt/guide/getting-started.md
+++ b/docs/pt/guide/getting-started.md
@@ -18,39 +18,19 @@ VitePress pode ser usado sozinho, ou ser instalado em um projeto já existente.
::: code-group
```sh [npm]
-$ npm add -D vitepress
+$ npm add -D vitepress@next
```
```sh [pnpm]
-$ pnpm add -D vitepress
+$ pnpm add -D vitepress@next
```
```sh [yarn]
-$ yarn add -D vitepress
-```
-
-```sh [yarn (pnp)]
-$ yarn add -D vitepress vue
+$ yarn add -D vitepress@next vue
```
```sh [bun]
-$ bun add -D vitepress
-```
-
-:::
-
-::: details Está recebendo avisos sobre dependências correspondentes ausentes?
-Se usar PNPM, você perceberá um aviso de ausência de `@docsearch/js`. Isso não evita que o VitePress funcione. Se você deseja suprimir este aviso, adicione o seguinte no seu `package.json`:
-
-```json
-"pnpm": {
- "peerDependencyRules": {
- "ignoreMissing": [
- "@algolia/client-search",
- "search-insights"
- ]
- }
-}
+$ bun add -D vitepress@next
```
:::
diff --git a/docs/pt/guide/markdown.md b/docs/pt/guide/markdown.md
index b5245259..c4186270 100644
--- a/docs/pt/guide/markdown.md
+++ b/docs/pt/guide/markdown.md
@@ -255,11 +255,11 @@ A classe `vp-raw` também pode ser usada diretamente em elementos. O isolamento
}
```
- Ele utiliza [`postcss-prefix-selector`](https://github.com/postcss/postcss-load-config) internamente. Você pode passar opções assim:
+ Você pode passar opções assim:
```js
postcssIsolateStyles({
- includeFiles: [/vp-doc\.css/] // o padrão é /base\.css/
+ includeFiles: [/custom\.css/] // o padrão é [/vp-doc\.css/, /base\.css/]
})
```
diff --git a/docs/pt/guide/using-vue.md b/docs/pt/guide/using-vue.md
index 226d90d2..a034108d 100644
--- a/docs/pt/guide/using-vue.md
+++ b/docs/pt/guide/using-vue.md
@@ -128,7 +128,7 @@ Se um componente for usado na maioria das páginas, eles podem ser registrados g
Certifique-se de que o nome de um componente personalizado contenha um hífen ou esteja em PascalCase. Caso contrário, ele será tratado como um elemento alinhado e envolvido dentro de uma tag `
`, o que levará a uma incompatibilidade de hidratação pois `
` não permite que elementos de bloco sejam colocados dentro dele.
:::
-### Usando Componentes Em Cabeçalhos {#using-components-in-headers}
+### Usando Componentes Em Cabeçalhos {#using-components-in-headers}
Você pode usar componentes Vue nos cabeçalhos, mas observe a diferença entre as seguintes sintaxes:
diff --git a/docs/pt/guide/what-is-vitepress.md b/docs/pt/guide/what-is-vitepress.md
index 734cd417..c447fd02 100644
--- a/docs/pt/guide/what-is-vitepress.md
+++ b/docs/pt/guide/what-is-vitepress.md
@@ -12,7 +12,7 @@ Quer apenas experimentar? Pule para o [Início Rápido](./getting-started).
- **Documentação**
- VitePress vem com um tema padrão projetado para documentação técnica. Ele alimenta esta página que você está lendo agora, juntamente com a documentação [Vite](https://vitejs.dev/), [Rollup](https://rollupjs.org/), [Pinia](https://pinia.vuejs.org/), [VueUse](https://vueuse.org/), [Vitest](https://vitest.dev/), [D3](https://d3js.org/), [UnoCSS](https://unocss.dev/), [Iconify](https://iconify.design/) e [muitos outros](https://www.vuetelescope.com/explore?framework.slug=vitepress).
+ VitePress vem com um tema padrão projetado para documentação técnica. Ele alimenta esta página que você está lendo agora, juntamente com a documentação [Vite](https://vitejs.dev/), [Rollup](https://rollupjs.org/), [Pinia](https://pinia.vuejs.org/), [VueUse](https://vueuse.org/), [Vitest](https://vitest.dev/), [D3](https://d3js.org/), [UnoCSS](https://unocss.dev/), [Iconify](https://iconify.design/) e [muitos outros](https://github.com/search?q=/"vitepress":+/+language:json&type=code).
A [documentação oficial Vue.js](https://vuejs.org/) também é baseada em VitePress, mas usa um tema personalizado compartilhado entre várias traduções.
diff --git a/docs/pt/index.md b/docs/pt/index.md
index 71fff26b..236d7c00 100644
--- a/docs/pt/index.md
+++ b/docs/pt/index.md
@@ -1,9 +1,6 @@
---
layout: home
-title: VitePress
-titleTemplate: Gerador de Site Estático desenvolvido com Vite & Vue
-
hero:
name: VitePress
text: Gerador de Site Estático Vite & Vue
@@ -11,10 +8,10 @@ hero:
actions:
- theme: brand
text: O que é VitePress?
- link: /pt/guide/what-is-vitepress
+ link: ./guide/what-is-vitepress
- theme: alt
text: Iniciar
- link: /pt/guide/getting-started
+ link: ./guide/getting-started
- theme: alt
text: GitHub
link: https://github.com/vuejs/vitepress
diff --git a/docs/pt/reference/cli.md b/docs/pt/reference/cli.md
index 6d7f0006..c6ff9bb4 100644
--- a/docs/pt/reference/cli.md
+++ b/docs/pt/reference/cli.md
@@ -43,7 +43,6 @@ vitepress build [root]
| `--base ` | Caminho base público (padrão: `/`) (`string`) |
| `--target ` | Transpila o alvo (padrão: `"modules"`) (`string`) |
| `--outDir ` | Diretório de saída relativo ao **cwd** (padrão: `/.vitepress/dist`) (`string`) |
-| `--minify [minifier]` | Habilita/desabilita minificação, ou especifica um minificador para usar (padrão: `"esbuild"`) (`boolean \| "terser" \| "esbuild"`) |
| `--assetsInlineLimit ` | Limite em bytes para alinhar ativos em base64 (padrão: `4096`) (`number`) |
## `vitepress preview`
diff --git a/docs/pt/reference/default-theme-config.md b/docs/pt/reference/default-theme-config.md
index 54e53e4a..a1ac180f 100644
--- a/docs/pt/reference/default-theme-config.md
+++ b/docs/pt/reference/default-theme-config.md
@@ -89,7 +89,7 @@ type NavItem = NavItemWithLink | NavItemWithChildren
interface NavItemWithLink {
text: string
- link: string
+ link: string | ((payload: PageData) => string)
activeMatch?: string
target?: string
rel?: string
diff --git a/docs/pt/reference/default-theme-nav.md b/docs/pt/reference/default-theme-nav.md
index 5f0d2399..fefc9661 100644
--- a/docs/pt/reference/default-theme-nav.md
+++ b/docs/pt/reference/default-theme-nav.md
@@ -55,6 +55,8 @@ export default {
`text` é o próprio texto mostrado na navegação, e o `link` é o link para o qual será navegado quando o texto for clicado. Para o link, defina o caminho para o próprio arquivo sem o prefixo `.md` e sempre comece com `/`.
+O `link` também pode ser uma função que aceita [`PageData`](./runtime-api#usedata) como argumento e retorna o caminho.
+
Links de navegação também podem ser menus _dropdown_. Para fazer isso, defina a chave `items` na opção do link.
```js
diff --git a/docs/pt/reference/default-theme-search.md b/docs/pt/reference/default-theme-search.md
index c16406cb..4db22900 100644
--- a/docs/pt/reference/default-theme-search.md
+++ b/docs/pt/reference/default-theme-search.md
@@ -370,3 +370,20 @@ new Crawler({
}
})
```
+
+### Suporte ao Algolia Ask AI {#ask-ai}
+
+Se quiser incluir o **Ask AI**, adicione `askAi` em `options`:
+
+```ts
+options: {
+ appId: '...',
+ apiKey: '...',
+ indexName: '...',
+ askAi: { assistantId: 'XXXYYY' }
+}
+```
+
+::: warning Nota
+Caso queira apenas a pesquisa por palavra-chave, omita `askAi`.
+:::
diff --git a/docs/pt/reference/default-theme-sidebar.md b/docs/pt/reference/default-theme-sidebar.md
index 62c3b3b1..0d8baf8d 100644
--- a/docs/pt/reference/default-theme-sidebar.md
+++ b/docs/pt/reference/default-theme-sidebar.md
@@ -180,36 +180,3 @@ export default {
}
}
```
-
-## `useSidebar`
-
-Retorna dados relacionados à barra lateral. O objeto retornado tem o seguinte tipo:
-
-```ts
-export interface DocSidebar {
- isOpen: Ref
- sidebar: ComputedRef
- sidebarGroups: ComputedRef
- hasSidebar: ComputedRef
- hasAside: ComputedRef
- leftAside: ComputedRef
- isSidebarEnabled: ComputedRef
- open: () => void
- close: () => void
- toggle: () => void
-}
-```
-
-**Exemplo:**
-
-```vue
-
-
-
-
Visível apenas quando a barra lateral existe
-
-```
diff --git a/docs/pt/reference/default-theme-team-page.md b/docs/pt/reference/default-theme-team-page.md
index 1daa47a5..32a9db0d 100644
--- a/docs/pt/reference/default-theme-team-page.md
+++ b/docs/pt/reference/default-theme-team-page.md
@@ -53,12 +53,12 @@ const members = [
Diga olá à nossa equipe incrível.
-
+
```
O código acima exibirá um membro da equipe em um elemento tipo cartão. Ele deve exibir algo semelhante ao abaixo.
-
+
O componente `` vem em 2 tamanhos diferentes, pequeno `small` e médio `medium`. Enquanto é uma questão de preferência, geralmente o tamanho `small` deve encaixar melhor quando usado na página de documento. Além disso, você pode adicionar mais propriedades a cada membro, como adicionar o botão "descrição" ou "patrocinador". Saiba mais sobre em [``](#vpteammembers).
@@ -107,9 +107,7 @@ const members = [
alguns dos membros escolheram ser apresentados abaixo.
-
+
```
diff --git a/docs/pt/reference/site-config.md b/docs/pt/reference/site-config.md
index 84b8493a..6f344017 100644
--- a/docs/pt/reference/site-config.md
+++ b/docs/pt/reference/site-config.md
@@ -24,7 +24,7 @@ export default {
}
```
-:::details Configuração Dinâmica (Assíncrona)
+::: details Configuração Dinâmica (Assíncrona)
Se você precisar gerar dinamicamente a configuração, também pode exportar por padrão uma função. Por exemplo:
@@ -458,7 +458,7 @@ export default {
### ignoreDeadLinks
-- Tipo: `boolean | 'localhostLinks' | (string | RegExp | ((link: string) => boolean))[]`
+- Tipo: `boolean | 'localhostLinks' | (string | RegExp | ((link: string, source: string) => boolean))[]`
- Padrão: `false`
Quando definido como `true`, VitePress não falhará na compilação devido a links quebrados.
@@ -613,7 +613,7 @@ export default {
`transformHead` é um gancho de compilação para transformar o cabeçalho antes de gerar cada página. Isso permite adicionar entradas no cabeçalho que não podem ser adicionadas estaticamente à configuração VitePress. Você só precisa retornar entradas extras, que serão mescladas automaticamente com as existentes.
-:::warning
+::: warning
Não faça mutações em qualquer item dentro de `context`.
:::
@@ -681,7 +681,7 @@ export default {
- Tipo: `(code: string, id: string, context: TransformContext) => Awaitable`
`transformHtml` é um gancho de compilação para transformar o conteúdo de cada página antes de salvá-lo no disco.
-:::warning
+::: warning
Não faça mutações em qualquer item dentro de `context`. Além disso, modificar o conteúdo HTML pode causar problemas de hidratação em tempo de execução.
:::
@@ -698,7 +698,7 @@ export default {
`transformPageData` é um gancho para transformar os dados de cada página. Você pode fazer mutações diretamente em `pageData` ou retornar valores alterados que serão mesclados nos dados da página.
-:::warning
+::: warning
Não faça mutações em qualquer item dentro de `context` e tenha cuidado pois isso pode impactar no desempenho do servidor de desenvolvimento, especialmente se você tiver algumas solicitações de rede ou computações pesadas (como gerar imagens) no gancho. Você pode verificar `process.env.NODE_ENV === 'production'` para lógica condicional.
:::
diff --git a/docs/.vitepress/config/ru.ts b/docs/ru/config.ts
similarity index 65%
rename from docs/.vitepress/config/ru.ts
rename to docs/ru/config.ts
index b75b1b77..e196d193 100644
--- a/docs/.vitepress/config/ru.ts
+++ b/docs/ru/config.ts
@@ -1,16 +1,17 @@
import { createRequire } from 'module'
-import { defineConfig, type DefaultTheme } from 'vitepress'
+import { defineAdditionalConfig, type DefaultTheme } from 'vitepress'
const require = createRequire(import.meta.url)
const pkg = require('vitepress/package.json')
-export const ru = defineConfig({
- lang: 'ru-RU',
+export default defineAdditionalConfig({
description: 'Генератор статических сайтов на основе Vite и Vue.',
themeConfig: {
nav: nav(),
+ search: { options: searchOptions() },
+
sidebar: {
'/ru/guide/': { base: '/ru/guide/', items: sidebarGuide() },
'/ru/reference/': { base: '/ru/reference/', items: sidebarReference() }
@@ -37,6 +38,14 @@ export const ru = defineConfig({
text: 'Обновлено'
},
+ notFound: {
+ title: 'СТРАНИЦА НЕ НАЙДЕНА',
+ quote:
+ 'Но если ты не изменишь направление и продолжишь искать, ты можешь оказаться там, куда направляешься.',
+ linkLabel: 'перейти на главную',
+ linkText: 'Отведи меня домой'
+ },
+
darkModeSwitchLabel: 'Оформление',
lightModeSwitchTitle: 'Переключить на светлую тему',
darkModeSwitchTitle: 'Переключить на тёмную тему',
@@ -62,6 +71,10 @@ function nav(): DefaultTheme.NavItem[] {
{
text: pkg.version,
items: [
+ {
+ text: '1.6.4',
+ link: 'https://vuejs.github.io/vitepress/v1/ru/'
+ },
{
text: 'Изменения',
link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md'
@@ -163,8 +176,8 @@ function sidebarReference(): DefaultTheme.SidebarItem[] {
]
}
-export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = {
- ru: {
+function searchOptions(): Partial {
+ return {
placeholder: 'Поиск в документации',
translations: {
button: {
@@ -173,10 +186,18 @@ export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = {
},
modal: {
searchBox: {
- resetButtonTitle: 'Сбросить поиск',
- resetButtonAriaLabel: 'Сбросить поиск',
- cancelButtonText: 'Отменить поиск',
- cancelButtonAriaLabel: 'Отменить поиск'
+ clearButtonTitle: 'Очистить поиск',
+ clearButtonAriaLabel: 'Очистить поиск',
+ closeButtonText: 'Закрыть',
+ closeButtonAriaLabel: 'Закрыть',
+ placeholderText: 'Поиск в документации',
+ placeholderTextAskAi: 'Задайте вопрос ИИ: ',
+ placeholderTextAskAiStreaming: 'Формируется ответ...',
+ searchInputLabel: 'Поиск',
+ backToKeywordSearchButtonText:
+ 'Вернуться к поиску по ключевым словам',
+ backToKeywordSearchButtonAriaLabel:
+ 'Вернуться к поиску по ключевым словам'
},
startScreen: {
recentSearchesTitle: 'История поиска',
@@ -184,24 +205,50 @@ export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = {
saveRecentSearchButtonTitle: 'Сохранить в истории поиска',
removeRecentSearchButtonTitle: 'Удалить из истории поиска',
favoriteSearchesTitle: 'Избранное',
- removeFavoriteSearchButtonTitle: 'Удалить из избранного'
+ removeFavoriteSearchButtonTitle: 'Удалить из избранного',
+ recentConversationsTitle: 'Недавние диалоги',
+ removeRecentConversationButtonTitle: 'Удалить этот диалог из истории'
},
errorScreen: {
titleText: 'Невозможно получить результаты',
- helpText: 'Вам может потребоваться проверить подключение к Интернету'
+ helpText: 'Проверьте подключение к Интернету'
+ },
+ noResultsScreen: {
+ noResultsText: 'Ничего не найдено',
+ suggestedQueryText: 'Попробуйте изменить запрос',
+ reportMissingResultsText: 'Считаете, что результаты должны быть?',
+ reportMissingResultsLinkText: 'Сообщите об этом'
+ },
+ resultsScreen: {
+ askAiPlaceholder: 'Задайте вопрос ИИ: '
+ },
+ askAiScreen: {
+ disclaimerText:
+ 'Ответы генерируются ИИ и могут содержать ошибки. Проверяйте информацию.',
+ relatedSourcesText: 'Связанные источники',
+ thinkingText: 'Думаю...',
+ copyButtonText: 'Копировать',
+ copyButtonCopiedText: 'Скопировано!',
+ copyButtonTitle: 'Копировать',
+ likeButtonTitle: 'Нравится',
+ dislikeButtonTitle: 'Не нравится',
+ thanksForFeedbackText: 'Спасибо за отзыв!',
+ preToolCallText: 'Поиск...',
+ duringToolCallText: 'Поиск ',
+ afterToolCallText: 'Поиск завершён',
+ aggregatedToolCallText: 'Поиск завершён'
},
footer: {
selectText: 'выбрать',
+ submitQuestionText: 'Отправить вопрос',
+ selectKeyAriaLabel: 'Клавиша Enter',
navigateText: 'перейти',
+ navigateUpKeyAriaLabel: 'Стрелка вверх',
+ navigateDownKeyAriaLabel: 'Стрелка вниз',
closeText: 'закрыть',
- searchByText: 'поставщик поиска'
- },
- noResultsScreen: {
- noResultsText: 'Нет результатов для',
- suggestedQueryText: 'Вы можете попытаться узнать',
- reportMissingResultsText:
- 'Считаете, что поиск даёт ложные результаты?',
- reportMissingResultsLinkText: 'Нажмите на кнопку «Обратная связь»'
+ backToSearchText: 'Вернуться к поиску',
+ closeKeyAriaLabel: 'Клавиша Esc',
+ poweredByText: 'поиск от'
}
}
}
diff --git a/docs/ru/guide/deploy.md b/docs/ru/guide/deploy.md
index 0de4fbe0..ff12be6c 100644
--- a/docs/ru/guide/deploy.md
+++ b/docs/ru/guide/deploy.md
@@ -111,7 +111,7 @@ Cache-Control: max-age=31536000,immutable
- **Build Command:** `npm run docs:build`
- **Output Directory:** `docs/.vitepress/dist`
-- **Node Version:** `18` (или выше)
+- **Node Version:** `20` (или выше)
::: warning ПРЕДУПРЕЖДЕНИЕ
Не включайте такие опции, как _Auto Minify_ для HTML-кода. Он удалит из вывода комментарии, которые имеют значение для Vue. При их удалении могут возникать ошибки несоответствия гидратации.
@@ -163,7 +163,7 @@ Cache-Control: max-age=31536000,immutable
- name: Setup Node
uses: actions/setup-node@v4
with:
- node-version: 20
+ node-version: 22
cache: npm # или pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
diff --git a/docs/ru/guide/extending-default-theme.md b/docs/ru/guide/extending-default-theme.md
index a8f0acc7..b1497ced 100644
--- a/docs/ru/guide/extending-default-theme.md
+++ b/docs/ru/guide/extending-default-theme.md
@@ -70,7 +70,7 @@ export default DefaultTheme
export default {
transformHead({ assets }) {
// настраиваем regex соответствующим образом, чтобы он соответствовал вашему шрифту
- const myFontFile = assets.find((file) => /font-name\.\w+\.woff2/)
+ const myFontFile = assets.find(file => /font-name\.[\w-]+\.woff2/.test(file))
if (myFontFile) {
return [
[
@@ -253,6 +253,7 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
{
duration: 300,
easing: 'ease-in',
+ fill: 'forwards',
pseudoElement: `::view-transition-${isDark.value ? 'old' : 'new'}(root)`
}
)
diff --git a/docs/ru/guide/getting-started.md b/docs/ru/guide/getting-started.md
index 21e8dcb0..4ca5ff8c 100644
--- a/docs/ru/guide/getting-started.md
+++ b/docs/ru/guide/getting-started.md
@@ -18,39 +18,19 @@ VitePress можно использовать самостоятельно ил
::: code-group
```sh [npm]
-$ npm add -D vitepress
+$ npm add -D vitepress@next
```
```sh [pnpm]
-$ pnpm add -D vitepress
+$ pnpm add -D vitepress@next
```
```sh [yarn]
-$ yarn add -D vitepress
-```
-
-```sh [yarn (pnp)]
-$ yarn add -D vitepress vue
+$ yarn add -D vitepress@next vue
```
```sh [bun]
-$ bun add -D vitepress
-```
-
-:::
-
-::: details Получаете предупреждения об отсутствующих зависимостях?
-Если вы используете PNPM, вы заметите предупреждение об отсутствующем пакете `@docsearch/js`. Это не мешает работе VitePress. Если вы хотите подавить это предупреждение, добавьте следующее в ваш `package.json`:
-
-```json
-"pnpm": {
- "peerDependencyRules": {
- "ignoreMissing": [
- "@algolia/client-search",
- "search-insights"
- ]
- }
-}
+$ bun add -D vitepress@next
```
:::
diff --git a/docs/ru/guide/markdown.md b/docs/ru/guide/markdown.md
index b67e1355..2bd1a5c1 100644
--- a/docs/ru/guide/markdown.md
+++ b/docs/ru/guide/markdown.md
@@ -281,11 +281,11 @@ console.log('Привет, VitePress!')
}
```
- Он использует [`postcss-prefix-selector`](https://github.com/postcss/postcss-load-config) под капотом. Вы можете передать ему параметры следующим образом:
+ Вы можете передать ему параметры следующим образом:
```js
postcssIsolateStyles({
- includeFiles: [/vp-doc\.css/] // по умолчанию /base\.css/
+ includeFiles: [/custom\.css/] // по умолчанию [/vp-doc\.css/, /base\.css/]
})
```
@@ -783,7 +783,7 @@ export default config
Вы можете включить файл Markdown в другой файл Markdown, даже вложенный.
::: tip СОВЕТ
-Вы также можете добавить в префикс пути к Markdown символ `@`, он будет выступать в качестве корня источника. По умолчанию это корень проекта VitePress, если не настроена опция `srcDir`.
+Вы также можете добавить префикс `@` к пути Markdown, и он будет считаться корневой папкой исходников. По умолчанию корневая папка исходников совпадает с корнем проекта VitePress, если не настроен параметр `srcDir`.
:::
Например, вы можете включить относительный файл Markdown следующим образом:
diff --git a/docs/ru/guide/what-is-vitepress.md b/docs/ru/guide/what-is-vitepress.md
index 1bcc3e18..715ecc89 100644
--- a/docs/ru/guide/what-is-vitepress.md
+++ b/docs/ru/guide/what-is-vitepress.md
@@ -1,6 +1,6 @@
# Что такое VitePress? {#what-is-vitepress}
-VitePress — это [Генератор статических сайтов](https://en.wikipedia.org/wiki/Static_site_generator) (ГСС), предназначенный для быстрого создания сайтов, ориентированных на контент. В двух словах, VitePress берёт ваш исходный контент, написанный в [Markdown](https://ru.wikipedia.org/wiki/Markdown), применяет к нему тему и генерирует статические HTML-страницы, которые можно легко развернуть в любом месте.
+VitePress — это [Генератор статических сайтов](https://en.wikipedia.org/wiki/Static_site_generator) (ГСС), предназначенный для быстрого создания сайтов, ориентированных на контент. В двух словах, VitePress берёт ваш исходный контент, написанный на [Markdown](https://ru.wikipedia.org/wiki/Markdown), применяет к нему тему и генерирует статические HTML-страницы, которые можно легко развернуть в любом месте.
@@ -12,7 +12,7 @@ VitePress — это [Генератор статических сайтов](ht
- **Документация**
- VitePress поставляется с темой по умолчанию, предназначенной для технической документации. Она содержит эту страницу, которую вы сейчас читаете, а также документацию по [Vite](https://vitejs.dev/), [Rollup](https://rollupjs.org/), [Pinia](https://pinia.vuejs.org/), [VueUse](https://vueuse.org/), [Vitest](https://vitest.dev/), [D3](https://d3js.org/), [UnoCSS](https://unocss.dev/), [Iconify](https://iconify.design/) и [многое другое](https://www.vuetelescope.com/explore?framework.slug=vitepress).
+ VitePress поставляется с темой по умолчанию, предназначенной для технической документации. Она содержит эту страницу, которую вы сейчас читаете, а также документацию по [Vite](https://vitejs.dev/), [Rollup](https://rollupjs.org/), [Pinia](https://pinia.vuejs.org/), [VueUse](https://vueuse.org/), [Vitest](https://vitest.dev/), [D3](https://d3js.org/), [UnoCSS](https://unocss.dev/), [Iconify](https://iconify.design/) и [многое другое](https://github.com/search?q=/"vitepress":+/+language:json&type=code).
[Официальная документация Vue.js](https://vuejs.org/) также основана на VitePress, но использует пользовательскую тему, разделяемую между несколькими переводами.
@@ -50,8 +50,8 @@ VitePress стремится обеспечить отличные возмож
## Что насчёт VuePress? {#what-about-vuepress}
-VitePress — это духовный наследник VuePress. Оригинальный VuePress был основан на Vue 2 и webpack. Благодаря Vue 3 и Vite под капотом, VitePress обеспечивает значительно лучший опыт разработки, лучшую производительность, более отточенную тему по умолчанию и более гибкий API для настройки.
+VitePress — это духовный преемник VuePress 1. Оригинальный VuePress 1 был основан на Vue 2 и webpack. С Vue 3 и Vite под капотом VitePress обеспечивает значительно лучший опыт разработки (DX), лучшую производительность в продакшене, более отточенную стандартную тему и более гибкий API для кастомизации.
-Разница в API между VitePress и VuePress заключается в основном в тематическом оформлении и настройке. Если вы используете VuePress 1 с темой по умолчанию, то переход на VitePress будет относительно простым.
+Различия в API между VitePress и VuePress 1 в основном касаются тем и кастомизации. Если вы используете VuePress 1 со стандартной темой, миграция на VitePress должна быть относительно простой.
-Также были приложены усилия для создания VuePress 2, который также поддерживает Vue 3 и Vite с большей совместимостью с VuePress 1. Однако поддерживать два генератора параллельно не представляется возможным, поэтому команда Vue решила сосредоточиться на VitePress как основном рекомендуемом генераторе статических сайтов в долгосрочной перспективе.
+Поддержка двух генераторов статических сайтов (SSG) параллельно не является устойчивой, поэтому команда Vue решила сосредоточиться на VitePress как на основном рекомендуемом SSG в долгосрочной перспективе. Теперь VuePress 1 признан устаревшим, а VuePress 2 передан команде сообщества VuePress для дальнейшей разработки и поддержки.
diff --git a/docs/ru/index.md b/docs/ru/index.md
index 77f2072a..faa45e78 100644
--- a/docs/ru/index.md
+++ b/docs/ru/index.md
@@ -1,9 +1,6 @@
---
layout: home
-title: VitePress
-titleTemplate: Генератор статических сайтов на основе Vite и Vue
-
hero:
name: VitePress
text: Генератор статических сайтов на основе Vite и Vue
@@ -11,10 +8,10 @@ hero:
actions:
- theme: brand
text: Что такое VitePress?
- link: /ru/guide/what-is-vitepress
+ link: ./guide/what-is-vitepress
- theme: alt
text: Первые шаги
- link: /ru/guide/getting-started
+ link: ./guide/getting-started
- theme: alt
text: GitHub
link: https://github.com/vuejs/vitepress
diff --git a/docs/ru/reference/cli.md b/docs/ru/reference/cli.md
index 93954da2..5884a7e8 100644
--- a/docs/ru/reference/cli.md
+++ b/docs/ru/reference/cli.md
@@ -43,7 +43,6 @@ vitepress build [root]
| `--base ` | Публичный базовый путь (по умолчанию: `/`) (`string`) |
| `--target ` | Транспилировать цель (по умолчанию: `"modules"`) (`string`) |
| `--outDir ` | Выходной каталог относительно **cwd** (по умолчанию: `/.vitepress/dist`) (`string`) |
-| `--minify [minifier]` | Включить/выключить минификацию или задать используемый минификатор (по умолчанию: `"esbuild"`) (`boolean \| "terser" \| "esbuild"`) |
| `--assetsInlineLimit ` | Статический встроенный порог ресурса base64 в байтах (по умолчанию: `4096`) (`number`) |
## `vitepress preview` {#vitepress-preview}
diff --git a/docs/ru/reference/default-theme-config.md b/docs/ru/reference/default-theme-config.md
index 348791c0..27b70443 100644
--- a/docs/ru/reference/default-theme-config.md
+++ b/docs/ru/reference/default-theme-config.md
@@ -19,13 +19,13 @@ export default {
**Параметры, описанные на этой странице, применимы только к теме по умолчанию.** Разные темы предполагают разные конфигурации темы. При использовании пользовательской темы объект конфигурации темы будет передан теме, чтобы она могла определить условное поведение на его основе.
-## i18nRouting {#i18nrouting}
+## i18nRouting
- Тип: `boolean`
При смене локали на `ru` URL изменится с `/foo` (или `/en/foo/`) на `/ru/foo`. Вы можете отключить это поведение, установив для параметра `themeConfig.i18nRouting` значение `false`.
-## logo {#logo}
+## logo
- Тип: `ThemeableImage`
@@ -46,7 +46,7 @@ type ThemeableImage =
| { light: string; dark: string; alt?: string }
```
-## siteTitle {#sitetitle}
+## siteTitle
- Тип: `string | false`
@@ -60,7 +60,7 @@ export default {
}
```
-## nav {#nav}
+## nav
- Тип: `NavItem`
@@ -89,7 +89,7 @@ type NavItem = NavItemWithLink | NavItemWithChildren
interface NavItemWithLink {
text: string
- link: string
+ link: string | ((payload: PageData) => string)
activeMatch?: string
target?: string
rel?: string
@@ -108,7 +108,7 @@ interface NavItemWithChildren {
}
```
-## sidebar {#sidebar}
+## sidebar
- Тип: `Sidebar`
@@ -135,7 +135,7 @@ export default {
export type Sidebar = SidebarItem[] | SidebarMulti
export interface SidebarMulti {
- [path: string]: SidebarItem[]
+ [path: string]: SidebarItem[] | { items: SidebarItem[]; base: string }
}
export type SidebarItem = {
@@ -162,10 +162,23 @@ export type SidebarItem = {
* Если `false`, группа сворачивается, но по умолчанию разворачивается
*/
collapsed?: boolean
+
+ /**
+ * Базовый путь для дочерних элементов
+ */
+ base?: string
+
+ /**
+ * Настройте текст, который отображается в футере предыдущей/следующей страницы
+ */
+ docFooterText?: string
+
+ rel?: string
+ target?: string
}
```
-## aside {#aside}
+## aside
- Тип: `boolean | 'left'`
- По умолчанию: `true`
@@ -177,7 +190,7 @@ export type SidebarItem = {
Если вы хотите отключить его для всех режимов просмотра, используйте `aside: false`.
-## outline {#outline}
+## outline
- Тип: `Outline | Outline['level'] | false`
- Уровень можно переопределить для каждой страницы с помощью [метаданных](./frontmatter-config#outline)
@@ -205,7 +218,7 @@ interface Outline {
}
```
-## socialLinks {#sociallinks}
+## socialLinks
- Тип: `SocialLink[]`
@@ -215,6 +228,7 @@ interface Outline {
export default {
themeConfig: {
socialLinks: [
+ // Можно добавить любую иконку из simple-icons (https://simpleicons.org/):
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' },
{ icon: 'twitter', link: '...' },
// Можно добавить пользовательские иконки, передав SVG в виде строки:
@@ -239,7 +253,7 @@ interface SocialLink {
}
```
-## footer {#footer}
+## footer
- Тип: `Footer`
- Можно переопределить для каждой страницы с помощью [метаданных](./frontmatter-config#footer)
@@ -264,7 +278,7 @@ export interface Footer {
}
```
-## editLink {#editlink}
+## editLink
- Тип: `EditLink`
- Можно переопределить для каждой страницы с помощью [метаданных](./frontmatter-config#editlink)
@@ -289,7 +303,7 @@ export interface EditLink {
}
```
-## lastUpdated {#lastupdated}
+## lastUpdated
- Тип: `LastUpdatedOptions`
@@ -324,7 +338,7 @@ export interface LastUpdatedOptions {
}
```
-## algolia {#algolia}
+## algolia
- Тип: `AlgoliaSearch`
@@ -364,7 +378,7 @@ export interface CarbonAdsOptions {
Подробнее в главе [Тема по умолчанию: Carbon Ads](./default-theme-carbon-ads)
-## docFooter {#docfooter}
+## docFooter
- Тип: `DocFooter`
@@ -388,47 +402,47 @@ export interface DocFooter {
}
```
-## darkModeSwitchLabel {#darkmodeswitchlabel}
+## darkModeSwitchLabel
- Тип: `string`
- По умолчанию: `Appearance`
Можно использовать для настройки надписи переключателя тёмного режима. Этот ярлык отображается только в мобильном представлении.
-## lightModeSwitchTitle {#lightmodeswitchtitle}
+## lightModeSwitchTitle
- Тип: `string`
- По умолчанию: `Switch to light theme`
Может использоваться для настройки заголовка переключателя светлого режима, который появляется при наведении курсора.
-## darkModeSwitchTitle {#darkmodeswitchtitle}
+## darkModeSwitchTitle
- Тип: `string`
- По умолчанию: `Switch to dark theme`
Можно использовать для настройки заголовка переключателя тёмного режима, который появляется при наведении курсора.
-## sidebarMenuLabel {#sidebarmenulabel}
+## sidebarMenuLabel
- Тип: `string`
- По умолчанию: `Menu`
Может использоваться для настройки метки бокового меню. Эта метка отображается только в мобильном представлении.
-## returnToTopLabel {#returntotoplabel}
+## returnToTopLabel
- Тип: `string`
- По умолчанию: `Return to top`
Может использоваться для настройки метки кнопки возврата наверх. Эта метка отображается только в мобильном представлении.
-## langMenuLabel {#langmenulabel}
+## langMenuLabel
- Тип: `string`
- По умолчанию: `Change language`
-Можно использовать для настройки aria-метки кнопки переключения языка в панели навигации. Это используется только в том случае, если вы используете [i18n](../guide/i18n).
+Можно использовать для настройки aria-метки кнопки переключения языка в панели навигации. Применяется только в том случае, если вы используете [i18n](../guide/i18n).
## skipToContentLabel
@@ -437,9 +451,44 @@ export interface DocFooter {
Можно использовать для настройки метки ссылки перехода к содержимому. Эта ссылка отображается, когда пользователь перемещается по сайту с помощью клавиатуры.
-## externalLinkIcon {#externallinkicon}
+## externalLinkIcon
- Тип: `boolean`
- По умолчанию: `false`
Отображать ли значок внешней ссылки рядом с внешними ссылками в Markdown.
+
+## `useLayout`
+
+Возвращает данные, относящиеся к макету. Возвращаемый объект имеет следующий тип:
+
+```ts
+interface {
+ isHome: ComputedRef
+
+ sidebar: Readonly>
+ sidebarGroups: ComputedRef
+ hasSidebar: ComputedRef
+ isSidebarEnabled: ComputedRef
+
+ hasAside: ComputedRef
+ leftAside: ComputedRef
+
+ headers: Readonly>
+ hasLocalNav: ComputedRef
+}
+```
+
+**Пример:**
+
+```vue
+
+
+
+
Отображается только если есть боковая панель
+
+```
diff --git a/docs/ru/reference/default-theme-last-updated.md b/docs/ru/reference/default-theme-last-updated.md
index 7d926dc5..4a0509f4 100644
--- a/docs/ru/reference/default-theme-last-updated.md
+++ b/docs/ru/reference/default-theme-last-updated.md
@@ -2,8 +2,27 @@
Время последнего обновления содержимого будет отображаться в правом нижнем углу страницы. Чтобы включить его, добавьте опцию `lastUpdated` в свой конфиг.
-::: tip Совет
-Чтобы увидеть обновленное время, необходимо зафиксировать файл Markdown.
+::: info ПРИМЕЧАНИЕ
+VitePress отображает время «последнего обновления» на основе временной метки последнего Git-коммита для каждого файла. Для работы этой функции Markdown-файл должен быть закоммичен в Git.
+
+Внутри VitePress выполняет команду `git log -1 --pretty="%ai"` для каждого файла, чтобы получить его временную метку. Если все страницы показывают одинаковое время обновления, вероятно, это связано с поверхностным клонированием (часто встречается в CI-средах), которое ограничивает историю Git.
+
+Чтобы исправить это в **GitHub Actions**, добавьте следующее в ваш workflow-файл:
+
+```yaml{4}
+- name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+```
+
+Другие CI/CD-платформы имеют аналогичные настройки.
+
+Если такие опции недоступны, вы можете добавить принудительный fetch перед командой `docs:build` в вашем `package.json`:
+
+```json
+"docs:build": "git fetch --unshallow && vitepress build docs"
+```
:::
## Настройка в файле конфигурации {#site-level-config}
diff --git a/docs/ru/reference/default-theme-nav.md b/docs/ru/reference/default-theme-nav.md
index 41257de8..edfb9a9e 100644
--- a/docs/ru/reference/default-theme-nav.md
+++ b/docs/ru/reference/default-theme-nav.md
@@ -55,6 +55,8 @@ export default {
`text` — это текст, отображаемый в навигации, а `link` — это ссылка, на которую будет осуществлён переход при нажатии на текст. Для ссылки задайте путь к фактическому файлу без префикса `.md` и всегда начинайте с `/`.
+`link` также может быть функцией, которая принимает [`PageData`](./runtime-api#usedata) в качестве аргумента и возвращает путь.
+
Навигационные ссылки также могут быть выпадающими меню. Для этого установите ключ `items` вместо ключа `link`:
```js
diff --git a/docs/ru/reference/default-theme-search.md b/docs/ru/reference/default-theme-search.md
index bab3fa9e..9cdc9438 100644
--- a/docs/ru/reference/default-theme-search.md
+++ b/docs/ru/reference/default-theme-search.md
@@ -233,10 +233,16 @@ export default defineConfig({
},
modal: {
searchBox: {
- resetButtonTitle: 'Сбросить поиск',
- resetButtonAriaLabel: 'Сбросить поиск',
- cancelButtonText: 'Отменить поиск',
- cancelButtonAriaLabel: 'Отменить поиск'
+ clearButtonTitle: 'Очистить поиск',
+ clearButtonAriaLabel: 'Очистить поиск',
+ closeButtonText: 'Закрыть',
+ closeButtonAriaLabel: 'Закрыть',
+ placeholderText: 'Поиск в документации',
+ placeholderTextAskAi: 'Задайте вопрос ИИ:',
+ placeholderTextAskAiStreaming: 'Формируется ответ...',
+ searchInputLabel: 'Поиск',
+ backToKeywordSearchButtonText: 'Вернуться к поиску по ключевым словам',
+ backToKeywordSearchButtonAriaLabel: 'Вернуться к поиску по ключевым словам'
},
startScreen: {
recentSearchesTitle: 'История поиска',
@@ -244,26 +250,48 @@ export default defineConfig({
saveRecentSearchButtonTitle: 'Сохранить в истории поиска',
removeRecentSearchButtonTitle: 'Удалить из истории поиска',
favoriteSearchesTitle: 'Избранное',
- removeFavoriteSearchButtonTitle: 'Удалить из избранного'
+ removeFavoriteSearchButtonTitle: 'Удалить из избранного',
+ recentConversationsTitle: 'Последние диалоги',
+ removeRecentConversationButtonTitle: 'Удалить диалог из истории'
},
errorScreen: {
titleText: 'Невозможно получить результаты',
- helpText:
- 'Вам может потребоваться проверить подключение к Интернету'
+ helpText: 'Проверьте подключение к Интернету'
+ },
+ noResultsScreen: {
+ noResultsText: 'Ничего не найдено',
+ suggestedQueryText: 'Попробуйте изменить запрос',
+ reportMissingResultsText: 'Считаете, что результаты должны быть?',
+ reportMissingResultsLinkText: 'Сообщите об этом'
+ },
+ resultsScreen: {
+ askAiPlaceholder: 'Задайте вопрос ИИ: '
+ },
+ askAiScreen: {
+ disclaimerText: 'Ответ сгенерирован ИИ и может быть неточным. Пожалуйста, проверьте информацию самостоятельно.',
+ relatedSourcesText: 'Связанные источники',
+ thinkingText: 'Думаю...',
+ copyButtonText: 'Копировать',
+ copyButtonCopiedText: 'Скопировано!',
+ copyButtonTitle: 'Копировать',
+ likeButtonTitle: 'Нравится',
+ dislikeButtonTitle: 'Не нравится',
+ thanksForFeedbackText: 'Спасибо за ваш отзыв!',
+ preToolCallText: 'Идёт поиск...',
+ duringToolCallText: 'Поиск ',
+ afterToolCallText: 'Поиск выполнен'
},
footer: {
selectText: 'выбрать',
+ submitQuestionText: 'Отправить вопрос',
+ selectKeyAriaLabel: 'Клавиша Enter',
navigateText: 'перейти',
+ navigateUpKeyAriaLabel: 'Стрелка вверх',
+ navigateDownKeyAriaLabel: 'Стрелка вниз',
closeText: 'закрыть',
- searchByText: 'поставщик поиска'
- },
- noResultsScreen: {
- noResultsText: 'Нет результатов для',
- suggestedQueryText: 'Вы можете попытаться узнать',
- reportMissingResultsText:
- 'Считаете, что поиск даёт ложные результаты?',
- reportMissingResultsLinkText:
- 'Нажмите на кнопку «Обратная связь»'
+ backToSearchText: 'Вернуться к поиску',
+ closeKeyAriaLabel: 'Клавиша Esc',
+ poweredByText: 'поиск от'
}
}
}
@@ -277,6 +305,43 @@ export default defineConfig({
[Эти параметры](https://github.com/vuejs/vitepress/blob/main/types/docsearch.d.ts) можно переопределить. Чтобы узнать о них больше, обратитесь к официальной документации Algolia.
+### Поддержка Ask AI в Algolia {#ask-ai}
+
+Если вы хотите добавить функцию **Ask AI**, передайте параметр `askAi` (или любые из его отдельных полей) внутри объекта `options`:
+
+```ts
+import { defineConfig } from 'vitepress'
+
+export default defineConfig({
+ themeConfig: {
+ search: {
+ provider: 'algolia',
+ options: {
+ appId: '...',
+ apiKey: '...',
+ indexName: '...',
+ // askAi: "ID-ВАШЕГО-АССИСТЕНТА"
+ // ИЛИ
+ askAi: {
+ // минимум вы должны указать assistantId, полученный от Algolia
+ assistantId: 'XXXYYY',
+ // опциональные переопределения – если не указаны, используются значения appId/apiKey/indexName верхнего уровня
+ // apiKey: '...',
+ // appId: '...',
+ // indexName: '...'
+ }
+ }
+ }
+ }
+})
+```
+
+::: warning Примечание
+Если вы хотите использовать обычный поиск по ключевым словам без Ask AI, просто не указывайте свойство `askAi`
+:::
+
+Переводы для интерфейса Ask AI находятся в `options.translations.modal.askAiScreen` и `options.translations.resultsScreen` — полный список ключей смотрите в [типах](https://github.com/vuejs/vitepress/blob/main/types/docsearch.d.ts).
+
### Конфигурация поискового робота {#crawler-config}
Вот пример конфигурации, основанной на той, что используется на этом сайте:
@@ -383,4 +448,4 @@ new Crawler({
}
}
})
-```
+```
\ No newline at end of file
diff --git a/docs/ru/reference/default-theme-sidebar.md b/docs/ru/reference/default-theme-sidebar.md
index 92fd89c1..bdc6e338 100644
--- a/docs/ru/reference/default-theme-sidebar.md
+++ b/docs/ru/reference/default-theme-sidebar.md
@@ -178,36 +178,3 @@ export default {
}
}
```
-
-## `useSidebar` {#usesidebar}
-
-Возвращает данные, связанные с сайдбаром. Возвращаемый объект имеет следующий тип:
-
-```ts
-export interface DocSidebar {
- isOpen: Ref
- sidebar: ComputedRef
- sidebarGroups: ComputedRef
- hasSidebar: ComputedRef
- hasAside: ComputedRef
- leftAside: ComputedRef
- isSidebarEnabled: ComputedRef
- open: () => void
- close: () => void
- toggle: () => void
-}
-```
-
-**Пример:**
-
-```vue
-
-
-
-