Get the latest tech news
Crafting your own Static Site Generator using Phoenix (2023)
Building your own Static Site Generator using Phoenix and NimblePublisher, the complete guide.
The build/3 function pulls apart the path to collect the year, month, day and id from the file name and builds a Date struct. Don’t worry about scaling this, because if you do hit the point where this takes up too much memory, you will have people who are eager to fix this for you, because they will be tired of generating markdown files. The render_file/2 function does have one interesting line, Phoenix.HTML.Safe.to_iodata/1 will take a Phoenix rendered component and output it to an HTML safe iodata, which is a weird name for a string in a list, but Erlang knows how to use these to be very efficient.
Or read this on Hacker News