The backend is written in Go using templ and using stdlib HTTP.
Styling is done via tailwindcss.
Reactivity is done thanks to datastar.
All building is managed via nix.
Use nix build .#<name> to run a build command. The names are:
- #default: this produces the webserver binary
- #container: docker image containing the webserver binary
Run ./dev.sh for the dev loop: it starts the templ proxy, the Go server (air
rebuilds it on .go changes), the tailwindcss watcher, and an asset-sync
watcher, cleaning up stragglers on exit.
The webserver port is set via environment variable WEBSERVER_PORT.
The website fetches blog posts from configurable sources using the BLOG_SOURCE
environment variable:
Local Directory:
BLOG_SOURCE="~/projects/blogs/"
BLOG_SOURCE="/absolute/path/to/blogs/"
BLOG_SOURCE="./relative/path/"Git Repositories (Nix-style format):
BLOG_SOURCE="github:owner/repo"
BLOG_SOURCE="gitlab:owner/repo"Default: If no BLOG_SOURCE is set, defaults to my blogs
(github:ethanthoma/blogs).
Blog posts are in markdown. They support YAML frontmatter:
---
title: "Post Title"
date: "2024-01-15T10:30:00Z"
slug: "post-slug"
---
# Post Title
Content here...