From 54b4a5567c8c12d4d00a4f782f4a597a2433be73 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 03 Dec 2023 00:55:38 +0000
Subject: [PATCH] fix: fmt
---
docs/hosting.md | 64 ++++++++++++++++++++++++++++++++
1 files changed, 64 insertions(+), 0 deletions(-)
diff --git a/docs/hosting.md b/docs/hosting.md
index 01d130f..cf7064c 100644
--- a/docs/hosting.md
+++ b/docs/hosting.md
@@ -166,3 +166,67 @@
3. Go to the [Vercel Dashboard](https://vercel.com/dashboard) and select your Quartz project.
4. Go to the Settings tab and then click Domains in the sidebar
5. Enter your subdomain into the field and press Add
+
+## Netlify
+
+Like Vercel, you can also deploy the site generated by Quartz 4 via Netlify.
+
+1. Log in to the [Netlify dashboard](https://app.netlify.com/) and click "Add new site".
+2. Select your Git provider and repository containing your Quartz project.
+3. Under "Build command", enter `npx quartz build`.
+4. Under "Publish directory", enter `public`.
+5. Press Deploy. Once it's live, you'll have a `*.netlify.app` URL to view the page.
+6. To add a custom domain, check "Domain management" in the left sidebar, just like with Vercel.
+
+## GitLab Pages
+
+You can configure GitLab CI to build and deploy a Quartz 4 project.
+
+In your local Quartz, create a new file `.gitlab-ci.yaml`.
+
+```yaml title=".gitlab-ci.yaml"
+stages:
+ - build
+ - deploy
+
+variables:
+ NODE_VERSION: "18.14"
+
+build:
+ stage: build
+ rules:
+ - if: '$CI_COMMIT_REF_NAME == "v4"'
+ before_script:
+ - apt-get update -q && apt-get install -y nodejs npm
+ - npm install -g n
+ - n $NODE_VERSION
+ - hash -r
+ - npm ci
+ script:
+ - npx prettier --write .
+ - npm run check
+ - npx quartz build
+ artifacts:
+ paths:
+ - public
+ cache:
+ paths:
+ - ~/.npm/
+ key: "${CI_COMMIT_REF_SLUG}-node-${CI_COMMIT_REF_NAME}"
+ tags:
+ - docker
+
+pages:
+ stage: deploy
+ rules:
+ - if: '$CI_COMMIT_REF_NAME == "v4"'
+ script:
+ - echo "Deploying to GitLab Pages..."
+ artifacts:
+ paths:
+ - public
+```
+
+When `.gitlab-ci.yaml` is commited, GitLab will build and deploy the website as a GitLab Page. You can find the url under `Deploy` -> `Pages` in the sidebar.
+
+By default, the page is private and only visible when logged in to a GitLab account with access to the repository but can be opened in the settings under `Deploy` -> `Pages`.
--
Gitblit v1.10.0