diff --git "a/\346\236\227\344\275\263\346\263\275/20240511-VitePress\351\203\250\347\275\262.md" "b/\346\236\227\344\275\263\346\263\275/20240511-VitePress\351\203\250\347\275\262.md" new file mode 100644 index 0000000000000000000000000000000000000000..86cd8a8c2fd30375f4f4f7234237076cb838d3f5 --- /dev/null +++ "b/\346\236\227\344\275\263\346\263\275/20240511-VitePress\351\203\250\347\275\262.md" @@ -0,0 +1,65 @@ +# VitePress部署笔记 + +Blog网址:https://www.zhida5u.top + +web端预览图: + +![image-20240512195149228](http://oss.zhida5u.top/zd5u/202405121951320.png) + +h5端预览图: + +![0ae427ce8c1b51a332068ffec615814](http://oss.zhida5u.top/zd5u/202405121952570.png) + +- 先行安装Node.js 18以上版本 + +- 使用VSCode打开自己建的VitePress文件夹 + +- 在VSCode终端控制台输入 + + ```bash + npm add -D vitepress + + yarn add -D vitepress + ``` + +- 再导入Vite配置文件后使用 + + ```bash + npx vitepress init + yarn vitepress init + ``` + + ```bash + //安装向导 + ┌ Welcome to VitePress! + │ + ◇ Where should VitePress initialize the config? + │ ./docs + │ + ◇ Site title: + │ My Awesome Project + │ + ◇ Site description: + │ A VitePress Site + │ + ◆ Theme: + │ ● Default Theme (Out of the box, good-looking docs) + │ ○ Default Theme + Customization + │ ○ Custom Theme + └ + ``` + +- 在/docs文件夹下导入自己所需要的md文档内容 + +- 本地预览 + + ```base + npm run docs:dev + +- 打包 + + ```base + npm run docs:build + ``` + +- 部署到服务器上,FTP需要设置UTF8和服务器需要设置en-UTF8才能正常使用中文路径 \ No newline at end of file