From 70d17afed42cff9d54e9c9bfdc9034789f67202e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=BD=B3=E6=B3=BD?= <1097559914@qq.com> Date: Sun, 12 May 2024 20:05:28 +0800 Subject: [PATCH] 20240512 --- ...0511-VitePress\351\203\250\347\275\262.md" | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 "\346\236\227\344\275\263\346\263\275/20240511-VitePress\351\203\250\347\275\262.md" 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 0000000..86cd8a8 --- /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 -- Gitee