HeadlinesBriefing favicon HeadlinesBriefing.com

Building a Phoenix Blog with Elixir and NimblePublisher

Hacker News •
×

A developer has detailed their approach to building a blog using Elixir and Phoenix, opting for server-side rendering over static site generators. The setup uses NimblePublisher to parse Markdown files from the priv/posts directory, compiling them at build time rather than runtime. This eliminates database dependencies while maintaining full control over the application's functionality.

Posts are organized by year in the file structure and feature syntax highlighting through Makeup. The blog leverages Tailwind CSS for styling, with custom Earmark processors adding appropriate classes to HTML elements. The developer shared specific configuration code for integrating Tailwind classes with Markdown output, demonstrating how to target elements like headers, paragraphs, and code blocks.

The deployment uses Dokploy on Hetzner infrastructure, with automatic builds triggered by GitHub updates. The multi-stage Docker setup keeps the final image lean by pulling most dependencies during build time. The system achieves near-instantaneous deployments through cached layers, with rolling updates replacing running replicas in about 30 seconds.