Appearance
使用vitepress搭建博客
官网有详细的教程,官网网址:https://vitepress.dev/
由于版本不同,但总体大同小异
安装步骤
1.创建并进入一个文件夹,命名随意;且进入创建的文件夹
sh
mkdir vitepress && cd vitepress
mkdir vitepress && cd vitepress
2.初始化package.json包
sh
yarn init
yarn init
3.本地安装vitepress
yarn add --dev vitepress
yarn add --dev vitepress
4.新建一个文件夹;且创建一个markdown文件(最好命名为:index.md)
sh
mkdir docs && echo '# Hello VitePress' > docs/index.md
mkdir docs && echo '# Hello VitePress' > docs/index.md
5.在package.json添加启动命令
sh
{
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:serve": "vitepress serve docs"
}
}
{
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:serve": "vitepress serve docs"
}
}
6.运行项目的命令
sh
yarn docs:dev
yarn docs:dev