A learning journey through Quartz - rebuilding a fast, batteries-included static-site generator from the ground up.
Open.Quartz is a copy-learning project based on jackyzha0/quartz β a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites.
This project is an educational endeavor to understand the internals of Quartz by rebuilding it step-by-step, documenting the learning process, and gaining deep insights into static-site generation, TypeScript architecture, and modern web development practices.
- Understand static-site generator architecture
- Master TypeScript advanced typing patterns (nominal types, type guards)
- Learn build pipeline design with esbuild
- Explore plugin architecture and extensibility
- Study internationalization (i18n) implementation
- Deep dive into CLI design patterns
Based on the original Quartz, this project aims to implement:
- π Obsidian Compatibility - Full support for Obsidian-flavored Markdown
- π Full-text Search - Built-in search functionality
- πΈοΈ Graph View - Visualize note connections
- π Wikilinks & Backlinks - Networked thought support
- π¨ Simple JSX Layouts - Customizable page components
- β‘ Hot Reload - Incremental rebuilds for content edits
- π Internationalization - Support for 30+ languages
- π³ Docker Support - Containerized deployment
Current Status: π§ Early Development Phase
| Component | Status | Description |
|---|---|---|
| Path Utilities | β Complete | Nominal types for path safety (FullSlug, SimpleSlug, FilePath, RelativeURL) |
| CLI Commands | β Partial | create, sync, restore, build commands |
| Build Pipeline | β Partial | esbuild integration with cache busting |
| Type System | β Complete | Plugin data type augmentation |
| i18n System | β Complete | 30+ locale definitions |
| Testing | β Partial | Unit tests for path utilities |
- Content transformation pipeline
- Plugin architecture implementation
- Component rendering system
- Configuration management
- Search functionality
- Graph visualization
- SPA navigation
- Popover previews
- Theme system
- Node.js v22 or higher
- npm v10.9.2 or higher
# Clone the repository
git clone https://github.com/Open-IA/Open.Quartz.git
cd Open.Quartz
# Install dependencies
npm install# Create a new Quartz site
npm run quartz create
# Build the site
npm run quartz build
# Sync with remote
npm run quartz sync
# Restore dependencies
npm run quartz restore
# Run tests
npm testDetailed learning notes are maintained in the devlogs directory:
- [2025-12-15] - Project entrypoint and setup
- [2025-12-16] - Command
createimplementation - [2025-12-26] - Command
updateimplementation - [2026-01-04] - Command
syncimplementation - [2026-02-06] - Command
buildimplementation
quartz/
βββ bootstrap-cli.mjs # CLI entry point
βββ build.ts # Build pipeline
βββ cfg.ts # Configuration management
βββ i18n/ # Internationalization
β βββ index.ts
β βββ locales/ # 30+ locale files
βββ plugins/ # Plugin system
β βββ types.ts
β βββ vfile.ts
β βββ transformers/
βββ util/ # Utilities
β βββ path.ts # Path utilities with nominal types
β βββ path.test.ts # Unit tests
β βββ clone.ts
β βββ ctx.ts
β βββ theme.ts
This project uses nominal typing to prevent common path-related bugs:
// Different path types are not interchangeable
type FullSlug = string & { __brand: "full" };
type SimpleSlug = string & { __brand: "simple" };
type FilePath = string & { __brand: "filepath" };
type RelativeURL = string & { __brand: "relative" };
// Type guards ensure type safety
isFullSlug("index"); // => true
isFullSlug("./abc/def"); // => false (relative path)This is a personal learning project, but feedback and suggestions are welcome!
- Feel free to open issues for questions or discussions
- Pull requests for improvements are appreciated
MIT License - See LICENSE for details.
- Original Quartz - jackyzha0/quartz
- Community - Thanks to the thousands of students, developers, and teachers using Quartz
"The best way to learn is to build." - Unknown