gozzi

command module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 12 Imported by: 0

README

Gozzi

A Go static site generator born from curiosity.

I built Gozzi to learn how static site generators work. Now I use it for tduyng.com.

Features

  • Fast builds with live reload
  • Markdown-first content
  • Go templates with 40+ helper functions
  • RSS, sitemap, Open Graph support
  • Server-side KaTeX math & syntax highlighting
  • Mermaid diagrams
  • Built-in CSS and HTML minification (36-53% size reduction)
  • SCSS/SASS compilation support
  • Auto-generated content summaries (no manual work needed)

Quick Start

# Install
go install github.com/tduyng/gozzi@latest

# Create a site
mkdir my-blog && cd my-blog
mkdir -p content/blog templates static

# Configure
cat > config.toml << 'EOF'
base_url = "https://example.com"
title = "My Blog"
minify_css = true
minify_html = true
minify_js = true
minify_json = true
minify_svg = true
minify_xml = true
compile_scss = true
scss_output_style = "compressed"
EOF

# Create first post
cat > content/blog/hello.md << 'EOF'
+++
title = "Hello World"
date = 2024-01-15
+++

My first post!
EOF

# Serve with live reload
gozzi serve

Visit http://localhost:1313

Documentation

Read the full documentation at tduyng.com/gozzi

Example

My personal site tduyng.com runs on Gozzi:

  • 100+ blog posts and notes
  • Server-side KaTeX math rendering (no JS needed)
  • Syntax highlighting with Chroma
  • Full-text search
  • ~100ms builds

View the source →

Development

# Clone and build
git clone https://github.com/tduyng/gozzi.git
cd gozzi
go build -o gozzi .

# Run tests
# Note: Tests must be run with TZ=UTC for consistent snapshots
TZ=UTC go test ./...

# Update test snapshots
TZ=UTC UPDATE_SNAPSHOTS=1 go test ./integration

License

MIT License - see LICENSE for details.

Documentation

Overview

Gozzi is a fast static site generator built with Go.

Directories

Path Synopsis
app
builder
This file handles generating redirect HTML pages for URL aliases.
This file handles generating redirect HTML pages for URL aliases.
config
Package config handles TOML configuration loading and merging.
Package config handles TOML configuration loading and merging.
content
Package content provides content tree data structures and navigation for gozzi.
Package content provides content tree data structures and navigation for gozzi.
data
Package data handles loading external data files (JSON/YAML/TOML) for templates.
Package data handles loading external data files (JSON/YAML/TOML) for templates.
i18n
Core i18n package for multilingual site support Handles language configs, translation loading, and locale management
Core i18n package for multilingual site support Handles language configs, translation loading, and locale management
markdown
Package markdown provide AST node types for inline and block KaTeX math expressions.
Package markdown provide AST node types for inline and block KaTeX math expressions.
minify
Package minify provides CSS, HTML, JavaScript, JSON, SVG, and XML minification.
Package minify provides CSS, HTML, JavaScript, JSON, SVG, and XML minification.
paginate
Package paginate provides pagination utilities for content sections.
Package paginate provides pagination utilities for content sections.
parser
Package parser provides tag parsing and tracking for content pages.
Package parser provides tag parsing and tracking for content pages.
scss
Package scss provides SCSS/SASS compilation to CSS.
Package scss provides SCSS/SASS compilation to CSS.
server
This file implements the file change detection and classification system.
This file implements the file change detection and classification system.
summary
ABOUTME: This file provides automatic content summary generation from HTML content.
ABOUTME: This file provides automatic content summary generation from HTML content.
template
Package template provides template function registry and management.
Package template provides template function registry and management.
template/funcs
Package funcs provides content-specific template functions for filtering and grouping.
Package funcs provides content-specific template functions for filtering and grouping.
utils
Package utils provides worker pool and concurrent processing utilities.
Package utils provides worker pool and concurrent processing utilities.
Snapshot testing utilities for integration tests
Snapshot testing utilities for integration tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL