No description
  • HTML 46.3%
  • Go 30.4%
  • CSS 22.5%
  • JavaScript 0.8%
Find a file
Arne Skaar Fismen 89dde2abd3 Add Basefile for Alpine container deployment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 19:20:51 +00:00
design Remove go-dev-server design spec 2026-04-06 17:47:55 +00:00
docs/superpowers Add implementation plan for markdown blog server 2026-04-03 11:41:10 +02:00
testdata feat: add archive listing handlers 2026-04-03 14:17:45 +02:00
.gitignore Add README and gitignore 2026-04-03 14:38:36 +02:00
Basefile Add Basefile for Alpine container deployment 2026-04-12 19:20:51 +00:00
go.mod fix: HTML-escape titles, use ⌘ for permalink, tidy go.mod 2026-04-03 14:26:07 +02:00
go.sum feat: add post model and frontmatter parsing 2026-04-03 14:11:38 +02:00
main.go Add Basefile for Alpine container deployment 2026-04-12 19:20:51 +00:00
main_test.go Apply blog design: logo, CSS, date separators, static file serving 2026-04-03 18:03:29 +02:00
README.md Add README and gitignore 2026-04-03 14:38:36 +02:00

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.

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 .