Vox A performant static site generator built to scale.

⟵ Diary

Approaching Initial Release

Goals

  • Modify log output to be more helpful for end-users.
  • Removing code that was commented out.
  • Parallelising as much as possible.
  • Creating a logo for Vox.

Logging

Logging is done at the following levels:

  • Error: Recoverable runtime errors.
  • Warning: Warnings that an unexpected situation has occurred at runtime.
  • Information: Provides helpful information to the end user.
  • Debug: Messages that aid the end user in debugging build issues with their site.
  • Trace: Logging that indicates notable events during runtime.

Cleanup of Removed Code

This made the code easier to read.

Paralellisation

In builds.rs, there are ten sequential loops:

  1. Setting the appearance of nodes in the DAG visualisation.
  2. Recursively getting the descendants of a page in the DAG.
  3. Recursively getting the ancestors of a page in the DAG.
  4. Recursively getting the non-layout ancestors of a page in the DAG.
  5. Recursively constructing the Liquid contexts of the ancestors of a page in the DAG.
  6. Rendering all pages.
  7. Iterating over all parent pages when rendering a page.
  8. Noting parent collection pages when rendering a page.
  9. Generating dependent collection contexts when rendering a page.
  10. Recursively rendering a page’s children.

The sixth and tenth loops cannot be parallelised as rendering order matters (must be done in topological order), while the rest cannot be parallelised as they involve mutating data outside the loop (causing a race condition if done in parallel).

In page.rs, there is one sequential loop when iteratively determining the collections from a page’s path; this is inherently iterative and cannot be done in parallel.

In templates.rs, there is one sequential loop when determining the snippets in the snippets directory, but this would introduce race conditions if done in parallel.

In main.rs, upon initial inspection, the following loops may be parallelised:

  1. The fourth step (DAG merging) of the re-rendering pipeline.
  2. Deleting the output of removed pages in the fifth step of the re-rendering pipeline.
  3. Recursively ascending a layout hierarchy to obtain the first non-layout page URL.

Logo

I wanted the logo to depict something living. I ended up picking a botanical illustration of a pineapple.


Future Goals

  • Move as much CLI code as possible into library.
  • Incorporating global.toml into DAG construction.
  • Incorporating snippets into DAG construction.