title | editLink | sidebarDepth | lang | actions | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
我的博客标题 |
true |
5 |
zh-CN |
|
[[toc]]
# 命令行创建 vuepress模板
npm init vuepress vuepress-starter
# 手动创建
mkdir vuepress-starter
cd vuepress-starter
git init
npm init
# yarn
# 安装 vuepress
yarn add -D vuepress@next
# 安装打包工具和主题
yarn add -D @vuepress/bundler-vite@next @vuepress/theme-default@next
# npm
# 安装 vuepress
npm install -D vuepress@next
# 安装打包工具和主题
npm install -D @vuepress/bundler-vite@next @vuepress/theme-default@next
# cnpm 安装版本next
# 安装 vuepress
cnpm install -D vuepress@next
# 安装打包工具和主题
cnpm install -D @vuepress/bundler-vite@next @vuepress/theme-default@next
#
cnpm install -D sass-embedded
cnpm install -D sass
导航栏配置
export default {
theme: defaultTheme({
navbar: [
// NavbarLink
{
text: 'Foo',
link: '/foo/',
},
// NavbarGroup
{
text: 'Group',
prefix: '/group/',
children: ['foo.md', 'bar.md'],
},
// 字符串 - 页面文件路径
'/bar/README.md',
],
}),
}
# npm配置代理无效
npm config set proxy http://127.0.0.1:33210
npm config set https-proxy https://127.0.0.1:33210
# 使用淘宝的 npm 镜像
npm config set registry https://registry.npm.taobao.org
# 设置为官方源
npm config set registry https://registry.npmjs.org/
# 安装cnpm
npm install -g cnpm --registry=https://registry.npmmirror.com