1. 下载安装Nodejs 以及 Git For Windows
  2. 国内可能 需要配置代理环境
为 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
  1. 创建Github空项目 https://github.com/new 并获取项目地址
  2. 通过下载作者原始项目模板, 文档地址
git clone https://github.com/jackyzha0/quartz.git
cd quartz
npm i
npx quartz create
  1. 创建自动生成页面workflow

创建目录文件 quartz/.github/workflows/deploy.yml

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 【你的项目地址】
  1. 设置页面地址
  2. 新建同步你的笔记npx quartz sync --no-pull