🌐 site
A little static site generator

About

site is a simple, lightweight static site generator built in Python. It was extracted from my personal blog and designed to be easy to use with clear goals in mind.

Why site?

Mostly because I'm lazy and got tired of trying to learn other systems like Hugo. But it also comes with very clear goals:

Quick Start with uvx

If you have uv installed, you can run commands directly without cloning the repository:

$ Initialize a new site
uvx --from git+https://github.com/bradmontgomery/site site init
$ Build the site
uvx --from git+https://github.com/bradmontgomery/site site build
$ Create a new post
uvx --from git+https://github.com/bradmontgomery/site site new
$ Run local preview server
uvx --from git+https://github.com/bradmontgomery/site site server

Local Development

Clone the repository and install dependencies with uv:

$ git clone https://github.com/bradmontgomery/site $ cd site $ uv sync

Then use commands with uv run:

$ uv run site init # Initialize site structure $ uv run site build # Build the site $ uv run site new # Create a new post $ uv run site server # Run preview server

Content Structure

Organize your content in the following directory structure:

content/ blog/ <title-slug>/index.md page/ <title>.md

The index page should be a listing of recent posts.

Commands

site init
Initialize a new site structure (creates content/, templates/, and output/ directories)
site build
Build the static site from content/
site new
Create a new blog post (interactive)
site server
Run a local preview server on localhost:8000

Help Output

Run uvx --from git+https://github.com/bradmontgomery/site site --help for detailed command information:

Usage: site [OPTIONS] COMMAND [ARGS]... Static site generator. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ --help Show this message and exit. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────╮ build Build the site. init Initialize a new site structure. new Create a new blog post. server Run a local preview HTTP server. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Features

Client-Side Timezone Conversion

Blog post dates are stored and transmitted in UTC. When a page loads, a small JavaScript module (timezone.js) converts <time> elements to the reader's local timezone using the browser's Intl.DateTimeFormat API.

Use the Jinja macro for consistent markup:

{% import 'macros/dates.html' as dates %} {{ dates.local_date(post.date, post.date_iso) }} {{ dates.local_date(post.date, post.date_iso, format='long') }} {{ dates.local_date(post.date, post.date_iso, format='date-only') }}

If JavaScript is disabled, readers see the UTC fallback text rendered by the server. RSS/Atom feeds are unaffected and continue to use UTC.

Built With