Merge branch 'main' into russian

pull/3709/head
Bugo 1 year ago committed by GitHub
commit f9ef1a4c2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,3 +1,15 @@
## [1.0.2](https://github.com/vuejs/vitepress/compare/v1.0.1...v1.0.2) (2024-04-01)
### Bug Fixes
- **theme:** text containing html not showing properly in mobile nav menu ([3c8b4c7](https://github.com/vuejs/vitepress/commit/3c8b4c706051592dd2cca0ae57e293254cbb51ce))
## [1.0.1](https://github.com/vuejs/vitepress/compare/v1.0.0...v1.0.1) (2024-03-22)
### Bug Fixes
- **build:** vendor vue-demi to avoid resolution issues with yarn berry ([#3680](https://github.com/vuejs/vitepress/issues/3680)) ([5d3cb96](https://github.com/vuejs/vitepress/commit/5d3cb96ac364413aa9eb494bc91744bd8f4a2c79))
# [1.0.0](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.45...v1.0.0) (2024-03-21)
### Bug Fixes

@ -11,6 +11,7 @@ export default defineConfig({
root: { label: 'English', ...en },
zh: { label: '简体中文', ...zh },
pt: { label: 'Português', ...pt },
ru: { label: 'Русский', ...ru }
ru: { label: 'Русский', ...ru },
ko: { label: '한국어', lang: 'ko-KR', link: 'https://vitepress.vuejs.kr/' }
}
})

@ -199,7 +199,7 @@ The dev server should be running at `http://localhost:5173`. Visit the URL in yo
- To better understand how markdown files are mapped to generated HTML, proceed to the [Routing Guide](./routing).
- To discover more about what you can do on the page, such as writing markdown content or using Vue Component, refer to the "Writing" section of the guide. A great place to start would be to learn about [Markdown Extensions](./markdown).
- To discover more about what you can do on the page, such as writing markdown content or using Vue Components, refer to the "Writing" section of the guide. A great place to start would be to learn about [Markdown Extensions](./markdown).
- To explore the features provided by the default documentation theme, check out the [Default Theme Config Reference](../reference/default-theme-config).

@ -34,11 +34,11 @@ VitePress 旨在使用 Markdown 生成内容时提供出色的开发体验。
## 性能 {#performance}
与许多传统的 SSG 不同,VitePress 生成的站点实际上是一个[单页应用程序](https://en.wikipedia.org/wiki/Single-page_application) (SPA)。
与许多传统的 SSG 不同,每次导航都会导致页面完全重新加载VitePress 生成的网站在初次访问时提供静态 HTML但它变成了[单页应用程序](https://en.wikipedia.org/wiki/Single-page_application)SPA进行站点内的后续导航。我们认为这种模式为性能提供了最佳平衡
- **快速的初始加载**
对任何页面的初次访问都将会是静态的、预呈现的 HTML以实现极快的加载速度和最佳的 SEO。然后页面加载一个 JavaScript bundle将页面变成 Vue SPA (这被称为“激活”)。激活是非常快的:在 [PageSpeed Insights](https://pagespeed.web.dev/report?url=https%3A%2F%2Fvitepress.dev%2F) 上,典型的 VitePress 站点即使在网络速度较慢的低端移动设备上也能获得近乎完美的性能分数。
对任何页面的初次访问都将会是静态的、预呈现的 HTML以实现极快的加载速度和最佳的 SEO。然后页面加载一个 JavaScript bundle将页面变成 Vue SPA (这被称为“激活”)。与 SPA 激活缓慢的常见假设不同,由于 Vue 3 良好的原始性能和编译优化,这个过程实际上非常快。在 [PageSpeed Insights](https://pagespeed.web.dev/report?url=https%3A%2F%2Fvitepress.dev%2F) 上,典型的 VitePress 站点即使在网络速度较慢的低端移动设备上也能获得近乎完美的性能分数。
- **加载完成后可以快速切换**

@ -377,7 +377,7 @@ export default {
- 类型:`string`
- 默认值: `.`
markdown 页面的目录,相对于项目根目录。另请参阅[根目录和源目录](../guide/routing#root-and-source-directory)。
相对于项目根目录的 markdown 文件所在的文件夹。另请参阅[根目录和源目录](../guide/routing#root-and-source-directory)。
```ts
export default {
@ -390,7 +390,7 @@ export default {
- 类型:`string`
- 默认值: `undefined`
用于匹配应作为源内容输出的 markdown 文件的 [全局模式](https://github.com/mrmlnc/fast-glob#pattern-syntax)。
用于匹配应排除作为源内容输出的 markdown 文件,语法详见 [glob pattern](https://github.com/mrmlnc/fast-glob#pattern-syntax)。
```ts
export default {
@ -471,6 +471,13 @@ export default {
}
```
### metaChunk <Badge type="warning" text="experimental" />
- 类型:`boolean`
- 默认值:`false`
当设置为 `true` 时,将页面元数据提取到单独的 JavaScript 块中,而不是内联在初始 HTML 中。这使每个页面的 HTML 负载更小,并使页面元数据可缓存,从而当站点中有很多页面时可以减少服务器带宽。
### mpa <Badge type="warning" text="experimental" />
- 类型:`boolean`

@ -0,0 +1,34 @@
/**
* vue-demi v0.14.7
* Copyright (c) 2020-present, Anthony Fu
* @license MIT
*/
import * as Vue from 'vue'
var isVue2 = false
var isVue3 = true
var Vue2 = undefined
function install() {}
export function set(target, key, val) {
if (Array.isArray(target)) {
target.length = Math.max(target.length, key)
target.splice(key, 1, val)
return val
}
target[key] = val
return val
}
export function del(target, key) {
if (Array.isArray(target)) {
target.splice(key, 1)
return
}
delete target[key]
}
export * from 'vue'
export { Vue, Vue2, isVue2, isVue3, install }

@ -1,9 +1,9 @@
{
"name": "vitepress",
"version": "1.0.0",
"version": "1.0.2",
"description": "Vite & Vue powered static site generator",
"type": "module",
"packageManager": "pnpm@8.15.4",
"packageManager": "pnpm@8.15.5",
"main": "dist/node/index.js",
"types": "types/index.d.ts",
"exports": {
@ -24,6 +24,9 @@
"./theme-without-fonts": {
"types": "./theme-without-fonts.d.ts",
"default": "./dist/client/theme-default/without-fonts.js"
},
"./vue-demi": {
"default": "./lib/vue-demi.mjs"
}
},
"bin": {
@ -36,7 +39,8 @@
"template",
"client.d.ts",
"theme.d.ts",
"theme-without-fonts.d.ts"
"theme-without-fonts.d.ts",
"lib"
],
"repository": {
"type": "git",
@ -94,8 +98,8 @@
"dependencies": {
"@docsearch/css": "^3.6.0",
"@docsearch/js": "^3.6.0",
"@shikijs/core": "^1.1.7",
"@shikijs/transformers": "^1.1.7",
"@shikijs/core": "^1.2.0",
"@shikijs/transformers": "^1.2.0",
"@types/markdown-it": "^13.0.7",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/devtools-api": "^7.0.16",
@ -104,13 +108,13 @@
"focus-trap": "^7.5.4",
"mark.js": "8.11.1",
"minisearch": "^6.3.0",
"shiki": "^1.1.7",
"shiki": "^1.2.0",
"vite": "^5.2.2",
"vue": "^3.4.21"
},
"peerDependencies": {
"markdown-it-mathjax3": "^4.3.2",
"postcss": "^8.4.35"
"markdown-it-mathjax3": "^4",
"postcss": "^8"
},
"peerDependenciesMeta": {
"markdown-it-mathjax3": {
@ -146,7 +150,7 @@
"@types/markdown-it-emoji": "^2.0.4",
"@types/micromatch": "^4.0.6",
"@types/minimist": "^1.2.5",
"@types/node": "^20.11.25",
"@types/node": "^20.11.30",
"@types/postcss-prefix-selector": "^1.16.3",
"@types/prompts": "^2.4.9",
"@vue/shared": "^3.4.21",
@ -154,17 +158,17 @@
"conventional-changelog-cli": "^4.1.0",
"cross-spawn": "^7.0.3",
"debug": "^4.3.4",
"esbuild": "^0.20.1",
"esbuild": "^0.20.2",
"escape-html": "^1.0.3",
"execa": "^8.0.1",
"fast-glob": "^3.3.2",
"fs-extra": "^11.2.0",
"get-port": "^7.0.0",
"get-port": "^7.1.0",
"gray-matter": "^4.0.3",
"lint-staged": "^15.2.2",
"lodash.template": "^4.5.0",
"lru-cache": "^10.2.0",
"markdown-it": "^14.0.0",
"markdown-it": "^14.1.0",
"markdown-it-anchor": "^8.6.7",
"markdown-it-attrs": "^4.1.6",
"markdown-it-container": "^4.0.0",
@ -186,17 +190,17 @@
"prompts": "^2.4.2",
"punycode": "^2.3.1",
"rimraf": "^5.0.5",
"rollup": "^4.12.1",
"rollup": "^4.13.0",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-esbuild": "^6.1.1",
"semver": "^7.6.0",
"simple-git-hooks": "^2.10.0",
"simple-git-hooks": "^2.11.0",
"sirv": "^2.0.4",
"sitemap": "^7.1.1",
"supports-color": "^9.4.0",
"typescript": "^5.4.2",
"vitest": "^1.3.1",
"vue-tsc": "^2.0.6",
"typescript": "^5.4.3",
"vitest": "^1.4.0",
"vue-tsc": "^2.0.7",
"wait-on": "^7.2.0"
},
"simple-git-hooks": {

File diff suppressed because it is too large Load Diff

@ -17,9 +17,8 @@ const closeScreen = inject('close-screen') as () => void
:target="item.target"
:rel="item.rel"
@click="closeScreen"
>
{{ item.text }}
</VPLink>
v-html="item.text"
/>
</template>
<style scoped>

@ -7,153 +7,143 @@ html body {
/* webfont-marker-end */
@font-face {
font-family: 'Inter var';
font-weight: 100 900;
font-display: swap;
font-family: Inter;
font-style: normal;
font-named-instance: 'Regular';
src: url('../fonts/inter-roman-cyrillic.woff2') format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
font-family: 'Inter var';
font-weight: 100 900;
font-display: swap;
font-style: normal;
font-named-instance: 'Regular';
src: url('../fonts/inter-roman-cyrillic-ext.woff2') format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: normal;
font-weight: 100 900;
font-display: swap;
font-style: normal;
font-named-instance: 'Regular';
src: url('../fonts/inter-roman-greek.woff2') format('woff2');
unicode-range: U+0370-03FF;
src: url('../fonts/inter-roman-cyrillic.woff2') format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: normal;
font-weight: 100 900;
font-display: swap;
font-style: normal;
font-named-instance: 'Regular';
src: url('../fonts/inter-roman-greek-ext.woff2') format('woff2');
unicode-range: U+1F00-1FFF;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: normal;
font-weight: 100 900;
font-display: swap;
font-style: normal;
font-named-instance: 'Regular';
src: url('../fonts/inter-roman-latin.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
U+FEFF, U+FFFD;
src: url('../fonts/inter-roman-greek.woff2') format('woff2');
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1,
U+03A3-03FF;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: normal;
font-weight: 100 900;
font-display: swap;
font-style: normal;
font-named-instance: 'Regular';
src: url('../fonts/inter-roman-latin-ext.woff2') format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
src: url('../fonts/inter-roman-vietnamese.woff2') format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329,
U+1EA0-1EF9, U+20AB;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: normal;
font-weight: 100 900;
font-display: swap;
font-style: normal;
font-named-instance: 'Regular';
src: url('../fonts/inter-roman-vietnamese.woff2') format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
U+01AF-01B0, U+1EA0-1EF9, U+20AB;
src: url('../fonts/inter-roman-latin-ext.woff2') format('woff2');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: normal;
font-weight: 100 900;
font-display: swap;
font-style: italic;
font-named-instance: 'Italic';
src: url('../fonts/inter-italic-cyrillic.woff2') format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
src: url('../fonts/inter-roman-latin.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: italic;
font-weight: 100 900;
font-display: swap;
font-style: italic;
font-named-instance: 'Italic';
src: url('../fonts/inter-italic-cyrillic-ext.woff2') format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: italic;
font-weight: 100 900;
font-display: swap;
font-style: italic;
font-named-instance: 'Italic';
src: url('../fonts/inter-italic-greek.woff2') format('woff2');
unicode-range: U+0370-03FF;
src: url('../fonts/inter-italic-cyrillic.woff2') format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: italic;
font-weight: 100 900;
font-display: swap;
font-style: italic;
font-named-instance: 'Italic';
src: url('../fonts/inter-italic-greek-ext.woff2') format('woff2');
unicode-range: U+1F00-1FFF;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: italic;
font-weight: 100 900;
font-display: swap;
font-style: italic;
font-named-instance: 'Italic';
src: url('../fonts/inter-italic-latin.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
U+FEFF, U+FFFD;
src: url('../fonts/inter-italic-greek.woff2') format('woff2');
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1,
U+03A3-03FF;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: italic;
font-weight: 100 900;
font-display: swap;
src: url('../fonts/inter-italic-vietnamese.woff2') format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329,
U+1EA0-1EF9, U+20AB;
}
@font-face {
font-family: Inter;
font-style: italic;
font-named-instance: 'Italic';
font-weight: 100 900;
font-display: swap;
src: url('../fonts/inter-italic-latin-ext.woff2') format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
font-family: 'Inter var';
font-family: Inter;
font-style: italic;
font-weight: 100 900;
font-display: swap;
font-style: italic;
font-named-instance: 'Italic';
src: url('../fonts/inter-italic-vietnamese.woff2') format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
U+01AF-01B0, U+1EA0-1EF9, U+20AB;
src: url('../fonts/inter-italic-latin.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Chinese quotes rendering fix. 中英文弯引号共享 Unicode 码位,确保引号使用中文字体渲染 */
@ -163,3 +153,5 @@ html body {
local('Source Han Sans SC');
unicode-range: U+2018, U+2019, U+201C, U+201D; /* 分别是 ‘’“” */
}
/* Generate the subsetted fonts using: `pyftsubset <file>.woff2 --unicodes="<range>" --output-file="inter-<style>-<subset>.woff2" --flavor=woff2` */

@ -261,12 +261,13 @@
* -------------------------------------------------------------------------- */
:root {
--vp-font-family-base: 'Chinese Quotes', 'Inter var', 'Inter', ui-sans-serif,
system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Helvetica, Arial, 'Noto Sans', sans-serif,
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--vp-font-family-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco,
Consolas, 'Liberation Mono', 'Courier New', monospace;
--vp-font-family-base: 'Chinese Quotes', Inter, ui-sans-serif, system-ui,
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
--vp-font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
'Liberation Mono', 'Courier New', monospace;
font-optical-sizing: auto;
}
/**

@ -41,6 +41,10 @@ export function resolveAliases(
{
find: /^vitepress\/theme$/,
replacement: join(DIST_CLIENT_PATH, '/theme-default/index.js')
},
{
find: /^vue-demi$/,
replacement: require.resolve('vitepress/vue-demi')
}
]

Loading…
Cancel
Save