No description
- HTML 46.3%
- Go 30.4%
- CSS 22.5%
- JavaScript 0.8%
|
|
||
|---|---|---|
| design | ||
| docs/superpowers | ||
| testdata | ||
| .gitignore | ||
| Basefile | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| main_test.go | ||
| README.md | ||
blog
A single-file Go blog server that serves markdown files as HTML. No database, no CSS, no build step.
Usage
go build -o blog .
./blog /path/to/content
The content directory should contain:
posts/
2026/
04/
03-my-post.md
publish/
The server listens on :8080.
Publishing
Drop a .md file into publish/. The server watches the directory, adds a published timestamp to the frontmatter, and moves the file to posts/YYYY/MM/DD-slug.md.
Post format
---
published: 2026-04-03T14:30:00Z
---
# Post Title
Content here.
Link posts
Add link: <url> to frontmatter. The heading links to the external URL, with a ⌘ permalink back to the post on the blog.
---
published: 2026-04-03T14:30:00Z
link: https://example.com/interesting
---
# Interesting Thing
Commentary.
Routes
| Path | Description |
|---|---|
/ |
20 most recent posts, full content |
/posts/ |
Archive by year |
/posts/YYYY/ |
Archive by month |
/posts/YYYY/MM/ |
Posts in a month |
/posts/YYYY/MM/DD-slug |
Single post |
/feed/all |
JSON Feed (all posts) |
/feed/articles |
JSON Feed (articles only) |
Deployment
Deployed to arne.fismen.no via an Alpine Incus container on fismen. Binary at /usr/local/bin/blog, content at /var/www/arne/ (mounted from host). Caddy reverse proxies to the container.
Build a static binary:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o blog .