September 2nd, 2024

My Blog Engine Is the Erlang Build Tool

The author uses Rebar3 to power a minimalist, static blog focused on fast loading and accessibility, utilizing erlydtl for templates and a DAG for efficient file rebuilding, despite its complexity.

Read original articleLink Icon
My Blog Engine Is the Erlang Build Tool

The author discusses their unique choice of using the Erlang Build Tool, Rebar3, to power their minimalist blog, which has been active for 14 years. The blog is designed to be static, with no dynamic content, JavaScript, or tracking, focusing instead on fast loading times and accessibility. The author highlights the need for a simple yet effective way to manage updates and features, such as syntax highlighting and RSS feeds, without relying on a database. The blog engine utilizes erlydtl, an Erlang implementation of Django Templates, to manage templates and content. The Rebar3 compiler is central to the blog's functionality, allowing for efficient rebuilding of only necessary files through a Directed Acyclic Graph (DAG) that tracks dependencies and modifications. The author emphasizes that while this setup works well for them, it may not be suitable for others due to its complexity and reliance on Erlang. The blog's structure includes various templates and sections, with a straightforward configuration that integrates seamlessly with the Rebar3 build process. Overall, the author finds this approach optimal for their needs, despite acknowledging its impracticality for a broader audience.

- The blog is powered by the Erlang Build Tool, Rebar3, emphasizing a static and minimalist design.

- It utilizes erlydtl for template management and focuses on fast loading and accessibility.

- The Rebar3 compiler efficiently rebuilds only necessary files using a Directed Acyclic Graph (DAG).

- The author acknowledges the setup's complexity, making it potentially unsuitable for most users.

- The blog's configuration is straightforward, integrating various templates and sections effectively.

Link Icon 5 comments
By @lihaoyi - 5 months
My own blog http://www.lihaoyi.com/ is also built using the Mill build tool. Incremental builds, parallelosm, watch-and-rebuild, etc are all things that static sites need as much as builds tools do; except you're compiling markdown to html instead of java to classfilrz or whatever. Cool to see others taking the same approach
By @paradox460 - 5 months
It's very impressive how expressive and flexible the compilers in the BEAMverse are. Elixir extends this rather far, and there are whole utilities such as Surface[1] that are built atop and make heavy use of custom compilers

For more germane blogging and ssg in elixir/beam, I use and recommend the excellent tableau generator[2], by Mitch Hanberg. I use it to power my own personal site[3], and publish the source[4] for anyone who is interested.

[1] https://surface-ui.org/

[2] https://github.com/elixir-tools/tableau

[3] https://pdx.su

[4] https://github.com/paradox460/pdx.su

By @swiftcoder - 5 months
That's a pretty cool re-use of existing tooling. Always interested to see the custom static site generators folks have come up with.
By @hiccuphippo - 5 months
There's a similar tool for building static sites using the zig build system: https://github.com/kristoff-it/zine

They made their own template language on top of html. An interesting outcome of this is that any error in the html, like a missing closing tag, becomes a build time error.