mirror of
https://github.com/handsomezhuzhu/handsomezhuzhu.github.io.git
synced 2026-02-20 20:00:14 +00:00
70 lines
1.2 KiB
Markdown
70 lines
1.2 KiB
Markdown
<h1 align="center"> VitePress @sugarat/theme </h1>
|
|
|
|
<p align="center">
|
|
简约风的 <a href="https://theme.sugarat.top" target="_blank"target="_blank">VitePress 博客主题</a> 示例运行项目。
|
|
</p>
|
|
|
|
<p align="center">
|
|
<a href="https://atqq.github.io/vitepress-blog-sugar-template/" target="_blank">GitHub Pages Demo</a>
|
|
</p>
|
|
|
|
## Usage
|
|
|
|
先安装 `pnpm`
|
|
|
|
```sh
|
|
npm i -g pnpm
|
|
```
|
|
|
|
安装依赖
|
|
|
|
```sh
|
|
pnpm install
|
|
```
|
|
|
|
开发启动
|
|
|
|
```sh
|
|
pnpm dev
|
|
```
|
|
|
|
构建
|
|
|
|
```sh
|
|
pnpm build
|
|
```
|
|
|
|
预览产物
|
|
|
|
```sh
|
|
pnpm serve
|
|
```
|
|
|
|
## Github Pages 部署
|
|
|
|
① Github Pages 开启 Git Actions 部署支持
|
|
|
|

|
|
|
|
② 复制文件 `.github/workflows/deploy.yml` 到自己的项目相同目录下
|
|
|
|
示例项目已包含,可以直接进行下一步
|
|
|
|
③ 修改 `docs/.vitepress/config.mts` 里的构建配置
|
|
|
|
**如果项目名已经为 name.github.io 域名,则不需要修改,保持默认值 `/` 即可**
|
|
|
|
`base` 改为 `"/仓库名/"` 即可
|
|
|
|
```ts
|
|
// 省略无关代码
|
|
const base = '/vitepress-blog-sugar-template/'
|
|
export default defineConfig({
|
|
base,
|
|
})
|
|
```
|
|
|
|
④ 推送 `main` 分支即可
|
|
|
|
需要进一步修改部署和构建配置,详见`deploy.yml` 文件。
|