Daily Use

npx quartz build --serve
npx quartz sync

Initialization

  1. Install node.js & npm, then check the version
node -v
npm -v
git --version
  1. Clone the repo & install dependencies
git clone https://github.com/jackyzha0/quartz.git
cd quartz
npm i
npx quartz create
  1. Start the server
npx quartz build --serve   # open http://localhost:8080
npx quartz build           # only build static site

Deploy to Github Pages

  1. Create a new repo named yourname
  2. Add a remote
git remote -v
git remote set-url origin <your repo REMOTE-URL>
git remote add upstream https://github.com/jackyzha0/quartz.git
  1. Push to github
npx quartz sync --no-pull   # first time
npx quartz sync             # update
  1. Setup Github Pages and connect to your domain

    If you have a custom domain, you can set it up in quartz.config.tsbaseUrl. For me, I did so.

  2. Update Quartz version

git remote add upstream https://github.com/jackyzha0/quartz.git # first time
git fetch upstream && git merge upstream/v4  # then you go