Skip to content

tduyng/gozzi

Repository files navigation

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.

About

Simple static site generator written in Go

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •