Hacker News new | ask | show | jobs
by alin23 1280 days ago
After building SPAs in next.js and blogs in Hugo, I finally settled on the simplest stack: Caddy+Markdown/HTML templates

I’ve talked about it more here: https://notes.alinpanaitiu.com/How%20I%20write%20this%20blog...

But the gist is that you have a Caddyfile like:

    http://localhost, notes.alinpanaitiu.com {
        root * /static/notes/
    
        file_server
        templates {
            mime text/html text/plain text/xml
        }

        encode zstd gzip

        try_files {path} /index.html?path={path}
    }
…and any .md inside /static/notes will be rendered to HTML, plus any .html/.xml will support Go template syntax.

This comes with the benefit of automatic HTTPS, asset compression and a one binary server.

Deploying is as simple as copying the folder with the Caddyfile and assets to my public server and running “caddy run”

2 comments

This is very cool, thanks for sharing. I just built a jekyll site and have plans for another SG site, so this is likely to get played with.
This is the kind of content I come to HN for. I love that you found a solution that works best for you. Hopefully many other iPhone owning, train commuters with thoughts worth sharing pick this up. :)
Thank you ^_^