#static #blog #static-site-generator #personal #generator #educational #site #exercise #learning #build

bin+lib futhorc

A static site generator to learn Rust and to build my personal blog

14 releases

new 0.1.13 Feb 21, 2023
0.1.12 Feb 21, 2023
0.1.11 Jul 14, 2022
0.1.7 May 2, 2022
0.1.6 Apr 19, 2021

#817 in Web programming

Download history 4/week @ 2022-11-03 2/week @ 2022-11-10 5/week @ 2022-11-17 1/week @ 2022-12-01 1/week @ 2022-12-08 13/week @ 2022-12-22 1/week @ 2023-01-05 1/week @ 2023-01-19 10/week @ 2023-01-26 1/week @ 2023-02-02 24/week @ 2023-02-09 56/week @ 2023-02-16

91 downloads per month

GPL-3.0 license

1.5K SLoC


Futhorc is an educational exercise to learn Rust while writing a static site generator.


The library code for the futhorc static site generator. The architecture can be generally broken down into two distinct steps:

  1. Parsing posts from source files on disk ([crate::post])
  2. Converting the posts into output files on disk ([crate::write])

Of the two, the second step is the more involved. It is itself composed of three distinct sub-steps:

  1. Building post pages
  2. Building index pages
  3. Rendering all pages to disk

Again here the second sub-step is the more involved, because we need to create groups of index pages for each tag and another group for the empty tag which corresponds to all posts. A group of index pages is referred to as an "index", and each index is paginated--converted into groups of pages based on a configurable number of posts per index page.

The third substep is pretty straight-forward: for each page, apply the template (either the post template or the index template) and write the result to disk.


~302K SLoC