Files
nexus/wiki/sources/building-your-quartz.md
2026-04-28 20:03:11 +08:00

53 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Building your Quartz"
type: source
tags:
- clippings
- quartz
- obsidian
date: 2026-04-17
---
## Source File
- [[raw/Home Office/Building your Quartz.md]]
## Summary用中文描述
- 核心主题Quartz 静态网站构建与部署完整指南
- 问题域:如何将 Obsidian 笔记发布为可公网访问的静态网站
- 方法/机制:
- 本地预览模式:`npx quartz build --serve` 启动热重载预览服务器
- 自托管部署:通过 Nginx / Apache / Caddy 等主流 Web 服务器托管生成的 `public/` 目录
- 关键技术:利用 `try_files` 指令处理无扩展名 URLQuartz 生成链接不含 `.html` 后缀)
- 结论/价值Quartz 是一个将 Markdown 文件转换为静态网站的工具,生成的 `public/` 目录可部署到任意静态托管平台Serve 模式仅用于本地预览,生产部署需配置正确的 Web 服务器
## Key Claims用中文描述
- Quartz 将 Markdown 文件和资源转换为 HTML、JS、CSS 静态文件(网站)
- 要发布网站到公网需要使用托管服务Quartz 生成的 `public/` 目录可部署到任何支持静态 HTML 的服务
- 本地 Serve 模式仅用于预览,生产环境应使用专用托管方案
- 由于 Quartz 生成不含 `.html` 扩展名的链接Web 服务器需配置 `try_files` 规则来处理 URL 重写
- 启用 RSS Feed 和 sitemap 功能需要正确配置 `baseUrl`
## Key Quotes
> "Quartz effectively turns your Markdown files and other resources into a bundle of HTML, JS, and CSS files (a website!)." — 核心功能描述
> "Serve mode is intended for local previews only. For production workloads, see the page on hosting." — Serve 模式用途说明
> "Since Quartz generates links that do not include the `.html` extension, you need to let your web server know how to deal with it." — 自托管关键配置说明
## Key Concepts
- [[Static Site Generator]]Quartz 的本质——将 Markdown 转换为静态 HTML/CSS/JS 网站的工具
- [[Obsidian Publishing]]Quartz 作为 Obsidian 笔记发布平台的角色
- [[try_files Directive]]Nginx/Caddy 中用于处理无扩展名 URL 的指令Quartz 自托管必须配置
## Key Entities
- Quartz开源 Obsidian 发布工具,由 jzhao.xyz 维护
- Nginx主流开源 Web 服务器,用于自托管 Quartz 生成的静态网站
- Apache另一种主流 Web 服务器,支持 .htaccess 配置 URL 重写
- Caddy现代开源 Web 服务器,默认支持 HTTPS内置静态文件服务
## Connections
- [[Obsidian]] ← uses ← [[Building your Quartz]]
- [[Static Site Generator]] ← implements ← [[Building your Quartz]]
- [[Obsidian Publishing]] ← extends ← [[Obsidian]]
## Contradictions
- 无已知冲突内容