与 VuePress 的区别
VitePress 和 VuePress 有不同的设计目标. 这两个项目共享相似的配置命名约定. VitePress 的目标是为编写文档提供最基本的功能. 其他特性被推到主题中. 另一方面, VuePress 拥有更多的开箱即用的特性, 或者由它的插件生态系统支持的特性.
TIP
如果您使用的是 VuePress, 则无需迁移到 VitePress. 在可预见的未来, 这两个项目将继续共存.
WARNING
请注意, 这是早期 WIP! 目前的重点是首先使 Vite 稳定和功能齐全. 目前还不建议将其用于任何重要场景.
如果您决定将您的项目移到 VitePress, 以下是您需要考虑的与VuePress v1.7.1的不同之处.
General
- Missing
- YAML and TOML are not supported formats for site config. Only javascript is supported for
.vitepress/config.js
- Plugins support, features are implemented in themes
- permalink support
.vitepress/templates
- Components in
.vitepress/components
are not auto registered as global components
- YAML and TOML are not supported formats for site config. Only javascript is supported for
- Differences
- Public files that are directly copied to dist root moved from
.vitepress/public/
ispublic/
- styling
.vitepress/styles/index.styl
and.vitepress/styles/palette.styl
is.vitepress/style.styl
- App Level Enhancements API, app enhancements
.vitepress/enhanceApp.js
is.vitepress/theme/index.js
.
- Public files that are directly copied to dist root moved from
Markdown
- Missing
- Support for toml in frontmatter
- details block
- markdown slots guide/using-vue.html#using-components).
~
prefix to explicitly specify a url is a webpack module request
Site Config
- Missing
temp
dest
theme
from a dependencypermalink
port
shouldPrefetch
cache
extraWatchFiles
patterns
plugins
markdown.pageSuffix
markdown.slugify
markdown.plugins
markdown.extractHeaders
markdown.extendMarkdown
tomarkdown.config
configureWebpack
,chainWebpack
,postcss
,Stylus
,scss
,Sass
,less
configsevergreen
Default Theme Config
- Missing
smoothScroll
displayAllHeaders
activeHeaderLinks
sidebarDepth
andinitialOpenGroupIndex
for sidebar groups
- Differences
searchMaxSuggestions
issearch.maxSuggestions
algolia
issearch.algolia
searchPlaceholder
issearch.placeholder
Default Theme
- Missing
Computed Globals
- Missing
$lang
$localePath
Frontmatter Predefined Variables
- Missing
description
meta
metaTitle
lang
layout
permalink
canonicalUrl
Frontmatter Default Theme Variables
siteData
- Missing
pageData
- Missing
key
path
regularPath
Global Components
- Missing