Skip to content

Open-IA/Open.Quartz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌱 Open.Quartz

A learning journey through Quartz - rebuilding a fast, batteries-included static-site generator from the ground up.

TypeScript Node License

About β€’ Features β€’ Progress β€’ Usage β€’ Learning


πŸ“– About

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.

🎯 Learning Goals

  • 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

✨ Features

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

🚧 Progress

Current Status: 🚧 Early Development Phase

βœ… Implemented

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

πŸ”„ In Progress

  • Content transformation pipeline
  • Plugin architecture implementation
  • Component rendering system
  • Configuration management

πŸ“‹ Planned

  • Search functionality
  • Graph visualization
  • SPA navigation
  • Popover previews
  • Theme system

πŸ› οΈ Usage

πŸ“‹ Prerequisites

  • Node.js v22 or higher
  • npm v10.9.2 or higher

πŸ”§ Installation

# Clone the repository
git clone https://github.com/Open-IA/Open.Quartz.git
cd Open.Quartz

# Install dependencies
npm install

πŸš€ Available Commands

# 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 test

πŸ“š Learning Documentation

Detailed learning notes are maintained in the devlogs directory:

  • [2025-12-15] - Project entrypoint and setup
  • [2025-12-16] - Command create implementation
  • [2025-12-26] - Command update implementation
  • [2026-01-04] - Command sync implementation
  • [2026-02-06] - Command build implementation

πŸ—οΈ Architecture

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

πŸ§ͺ Type System

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)

🀝 Contributing

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

πŸ“œ License

MIT License - See LICENSE for details.


πŸ™ Acknowledgments

  • Original Quartz - jackyzha0/quartz
  • Community - Thanks to the thousands of students, developers, and teachers using Quartz

πŸ“Š Project Stats

Lines of Code TypeScript Learning


"The best way to learn is to build." - Unknown

About

🌱 a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors