本文总阅读量

数字花园3zh2

自定义域名需要修改quartz.config.ts里面的baseUrl
页脚在:quartz\quartz.layout.ts里面

部署教程

如何使用 Quartz 4.0 和 GitHub Pages 免费发布 Obsidian 笔记 (insile.github.io),按他教程我没有看见index,最后结果点击主页就出现xml提示,我就按他的方法直接克隆他的库了(insile/我的笔记 (github.com)),结果一切正常,还不错。(其实也可以自己新建一个ibdex上去)

NodeJS v18.14+ (使用 node -v 检查您的版本)Node.js — 下载 Node.js® (nodejs.org)
NPM v9.3.1+(使用 npm -v 检查您的版本)(安装node后自带npm)
Git(使用 git --version 检查您的版本)CNPM Binaries Mirror (npmmirror.com)
Obsidian

步骤 1. 下载并安装 Quartz
git clone https://github.com/jackyzha0/quartz.git
# 下载 Quartz 存储库的副本,并将其存储在当前文件夹的 quartz 中
 
cd quartz
# 进入 quartz
 
npm i
# 安装 Quartz 依赖项
 
npx quartz create
# 创建一个新的 Quartz 项目
步骤 2. 设置 GitHub 存储库
git remote -v
# 列出所有被跟踪的仓库
# origin  https://github.com/jackyzha0/quartz.git (fetch)
# origin  https://github.com/jackyzha0/quartz.git (push)
# upstream        https://github.com/jackyzha0/quartz.git (fetch)
# upstream        https://github.com/jackyzha0/quartz.git (push)
 
git remote set-url origin <URL>
# 此命令删除 origin 远程仓库 并替换为自己的 URL
 
npx quartz sync --no-pull
# 将对本地仓库所做的更改推送到远程仓库上的
# 末尾带有绿色 Done! 

注意:自己url替换掉<URL>,而不是url。

步骤 3. 创建 Obsidian 库
npx quartz sync

每次更改后记得更新推送到远程仓库上。`

步骤 4. 在线托管您的保管库
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@v3
        with:
          fetch-depth: 0 # Fetch all history for git info
      - uses: actions/setup-node@v3
        with:
          node-version: 18.14
      - name: Install Dependencies
        run: npm ci
      - name: Build Quartz
        run: npx quartz build
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v2
        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@v2
npx quartz sync

每次更改后记得更新推送到远程仓库上`

步骤 5. 更多个性化设置



2017–2023 ZyTomorrow
本站总访问量