ar.falsy.cat/content/notes/hosting.md
2021-07-18 22:18:26 -04:00

2.4 KiB

title
Deploying to GitHub Pages

GitHub Pages

Quartz is designed to be effortless to deploy. If you forked and cloned Quartz directly from the repository, everything should already be good to go! You can head to <YOUR-GITHUB-USERNAME.github.io/quartz to see it live.

By default, Github Actions will run on forks of repos. You should not need to do any more config to see it up to date.

Pushing Changes

Quartz is essentially a git repository so updating it is the same workflow as you would follow as normal.

# Navigate to Quartz folder
cd <path-to-quartz>

# Commit all changes
git add .
git commit -m "message describing changes"

# Push to GitHub to update site
git push origin hugo

Custom subdomain

Have a fancy custom domain or want to subdomain your Quartz? That's easy too.

Change baseURL in /config.toml. Reference.

baseURL = "https://<YOUR-DOMAIN>/"

Change cname in /.github/workflows/deploy.yaml. Reference.

- name: Deploy  
  uses: peaceiris/actions-gh-pages@v3  
  with:  
	github_token: ${{ secrets.GITHUB_TOKEN }}  
	publish_dir: ./public  
	publish_branch: master
	cname: <YOUR-DOMAIN>

Registrar

For this last bit to take effect, you also need to create a CNAME record with the DNS provider you register your domain with (i.e. NameCheap, Google Domains).

GitHub has some documentation on this, but the tldr; is to

  1. Go to your forked repository (github.com/<YOUR-GITHUB-USERNAME>/quartz) settings page and go to the Pages tab. Under "Custom domain", type your custom domain, then click Save.

  2. Go to your DNS Provider and create a CNAME record that points from your domain to <YOUR-GITHUB-USERNAME.github.io. (yes, with the trailing period).

    Example Configuration for QuartzExample Configuration for Quartz

  3. Wait 30 minutes to an hour for the network changes to kick in.

  4. Done!

Now that your Quartz is live, let's figure out how to make Quartz really yours!

🎨 Customizing Quarts

Having problems? Checkout our FAQ and Troubleshooting guide.