Hello World
This is the first post on a static blog built with Ruby, NGINX, and Kamal.
The entire site is a collection of markdown files converted to HTML at Docker build time. No application server, no JavaScript framework โ just static files served by NGINX.
How it works
A small Ruby script reads each markdown file, runs it through Redcarpet with Rouge for syntax highlighting, wraps it in an ERB layout, and writes the result to _site/.
posts = Dir["posts/*.md"].map { |f| parse_post(f) }
posts.each do |post|
html = markdown.render(post[:body])
write_page(post[:slug], title: post[:title], content: html)
end
The Dockerfile does this in a multi-stage build โ Ruby in the first stage, then the output gets copied into an NGINX image. Kamal deploys the NGINX container.
Why?
Sometimes you just want to write and ship.