- 下载安装Nodejs 以及 Git For Windows
- 国内可能 需要配置代理环境
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| 为 Git 设置代理 git config --global http.proxy "socks5://127.0.0.1:24" git config --global https.proxy "socks5://127.0.0.1:24"
取消 git config --global --unset http.proxy git config --global --unset https.proxy
为Nodejs设置代理 npm config set proxy socks5://127.0.0.1:24 npm config set https-proxy socks5://127.0.0.1:24
取消 npm config delete proxy npm config delete https-proxy
|
- 创建Github空项目
https://github.com/new 并获取项目地址
- 通过下载作者原始项目模板, 文档地址
1 2 3 4
| git clone https://github.com/jackyzha0/quartz.git cd quartz npm i npx quartz create
|
- 创建自动生成页面workflow
创建目录文件 quartz/.github/workflows/deploy.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| name: Deploy Quartz site to GitHub Pages on: push: branches: - v4 permissions: contents: read pages: write id-token: write concurrency: group: "pages" cancel-in-progress: false jobs: build: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all history for git info - uses: actions/setup-node@v4 - name: Install Dependencies run: npm ci - name: Build Quartz run: npx quartz build - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: public deploy: needs: build environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4
|
- 上传至你自己的项目
1
| git remote set-url origin 【你的项目地址】
|
- 设置页面地址
- 新建同步你的笔记
npx quartz sync --no-pull