File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,11 @@ VitePress 旨在使用 Markdown 生成内容时提供出色的开发体验。
34
34
35
35
## 性能 {#performance}
36
36
37
- 与许多传统的 SSG 不同,VitePress 生成的站点实际上是一个 [ 单页应用程序] ( https://en.wikipedia.org/wiki/Single-page_application ) ( SPA)。
37
+ 与许多传统的 SSG 不同,每次导航都会导致页面完全重新加载, VitePress 生成的网站在初次访问时提供静态 HTML,但它变成了 [ 单页应用程序] ( https://en.wikipedia.org/wiki/Single-page_application ) ( SPA)进行站点内的后续导航。我们认为,这种模式为性能提供了最佳平衡:
38
38
39
39
- ** 快速的初始加载**
40
40
41
- 对任何页面的初次访问都将会是静态的、预呈现的 HTML,以实现极快的加载速度和最佳的 SEO。然后页面加载一个 JavaScript bundle,将页面变成 Vue SPA (这被称为“激活”)。激活是非常快的: 在 [ PageSpeed Insights] ( https://pagespeed.web.dev/report?url=https%3A%2F%2Fvitepress.dev%2F ) 上,典型的 VitePress 站点即使在网络速度较慢的低端移动设备上也能获得近乎完美的性能分数。
41
+ 对任何页面的初次访问都将会是静态的、预呈现的 HTML,以实现极快的加载速度和最佳的 SEO。然后页面加载一个 JavaScript bundle,将页面变成 Vue SPA (这被称为“激活”)。与 SPA 激活缓慢的常见假设不同,由于 Vue 3 良好的原始性能和编译优化,这个过程实际上非常快。 在 [ PageSpeed Insights] ( https://pagespeed.web.dev/report?url=https%3A%2F%2Fvitepress.dev%2F ) 上,典型的 VitePress 站点即使在网络速度较慢的低端移动设备上也能获得近乎完美的性能分数。
42
42
43
43
- ** 加载完成后可以快速切换**
44
44
Original file line number Diff line number Diff line change @@ -377,7 +377,7 @@ export default {
377
377
- 类型:` string `
378
378
- 默认值: ` . `
379
379
380
- markdown 页面的目录,相对于项目根目录 。另请参阅[ 根目录和源目录] ( ../guide/routing#root-and-source-directory ) 。
380
+ 相对于项目根目录的 markdown 文件所在的文件夹 。另请参阅[ 根目录和源目录] ( ../guide/routing#root-and-source-directory ) 。
381
381
382
382
``` ts
383
383
export default {
@@ -390,7 +390,7 @@ export default {
390
390
- 类型:` string `
391
391
- 默认值: ` undefined `
392
392
393
- 用于匹配应作为源内容输出的 markdown 文件的 [ 全局模式 ] ( https://github.com/mrmlnc/fast-glob#pattern-syntax ) 。
393
+ 用于匹配应排除作为源内容输出的 markdown 文件,语法详见 [ glob pattern ] ( https://github.com/mrmlnc/fast-glob#pattern-syntax ) 。
394
394
395
395
``` ts
396
396
export default {
@@ -471,6 +471,13 @@ export default {
471
471
}
472
472
```
473
473
474
+ ### metaChunk <Badge type =" warning " text =" experimental " />
475
+
476
+ - 类型:` boolean `
477
+ - 默认值:` false `
478
+
479
+ 当设置为 ` true ` 时,将页面元数据提取到单独的 JavaScript 块中,而不是内联在初始 HTML 中。这使每个页面的 HTML 负载更小,并使页面元数据可缓存,从而当站点中有很多页面时可以减少服务器带宽。
480
+
474
481
### mpa <Badge type =" warning " text =" experimental " />
475
482
476
483
- 类型:` boolean `
You can’t perform that action at this time.
0 commit comments