-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
219 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
title = "Fixing Static Site Generators" | ||
date = 2024-06-11 | ||
layout = "post" | ||
permalink = "date" | ||
--- | ||
|
||
{% markdown %} | ||
|
||
Static site generators (SSGs) are a class of software that evaluate template files at runtime to output new files. | ||
Many of these tools are intended for creating Web sites, used when you want to **publish your own content and syndicate it elsewhere**. | ||
|
||
SSGs are described as 'simple', with minimal installation & configuration burden, human-readable content files, and freedom from databases. | ||
This makes creating & updating sites relatively painless in many circumstances, and makes deployment fairly straightforward. | ||
|
||
Despite the advantages over traditional content management systems (CMSes), there are some disadvantages common to many SSGs: | ||
* Intended for software developers | ||
* Difficult to iterate with and scale | ||
* Templates are too limited for many use cases | ||
|
||
Vox aims to address these issues to expand the use-cases of SSGs over CMSes: | ||
* When you want to **own** your content long-term | ||
* When you want to **distribute** your content to many places | ||
* When you want to **control** the infrastructure hosting your content | ||
|
||
--- | ||
|
||
## Content Management Pipeline | ||
|
||
The process of writing content, rendering it, and then deploying it, sounds straightforward. | ||
Unfortunately, each of these steps involves domain-specific knowledge that can harm the user experience. | ||
|
||
### Prerequisite Knowledge | ||
|
||
To write content, you likely need to know: | ||
* the notation used by frontmatter | ||
* the templating language | ||
* the markup language | ||
|
||
For many people without technical backgrounds, the writing process alone forces them toward a traditional CMS. | ||
In fact, I'd argue no SSG---including Vox---can or *should* solve this problem. This is exactly what the role of a static CMS should be. | ||
The role of Vox here is to be interoperable with a static CMS that simplifies writing and deployment. | ||
|
||
### Reducing New Concepts | ||
|
||
Many SSGs introduce dozens of concepts relating to their use & operation, while Vox tries to remain relatively simple. | ||
|
||
* The **layout-partial paradigm**: site consistency is maintained with <a href="{{ global.url | append: "/guide/Data Model.html#layouts" }}">layouts</a>, elements are reused with <a href="{{ global.url | append: "/guide/Data Model.html#include" }}">includes</a> | ||
* Simple <a href="{{ global.url | append: "/guide/Data Model.html" }}">data model</a> that draws only upon the aforementioned pre-requisite knowledge | ||
* Straightforward <a href="{{ global.url | append: "/guide" }}">user guide</a> | ||
|
||
### Providing Feedback | ||
|
||
When the SSG is unfamiliar or a site has particularly high cognitive complexity, unexpected rendering or build errors can become frustrating rather quickly. | ||
Vox provides logging messages that aid users in debugging their sites, both during the initial build and incremental rebuilds. | ||
|
||
--- | ||
|
||
## Scale & Iteration | ||
|
||
A major source of pain for too many SSGs is build performance; many sites should take fractions of a second to build on a laptop, not minutes. | ||
Even then, once a site reaches a certain size, rebuilding from scratch when changes are made is not feasible. Incremental rebuilds should be done intelligently. | ||
Vox enables rapid iteration and unrestricted scaling of sites with its <a href="{{ global.url | append: "/guide/Rendering Pipeline.html" }}">unique rendering pipeline</a>, rebuilding only what it needs to while ensuring the entire site is up-to-date. | ||
|
||
--- | ||
|
||
## Emergent Capabilities | ||
|
||
As a consequence of Vox's abstractions, various capabilities emerge without the cost of added software complexity. | ||
|
||
### Content Traversal | ||
|
||
<a href="{{ global.url | append: "/guide/Data Model.html#layouts" }}">Layout inheritance</a> and <a href="{{ global.url | append: "/guide/Frontmatter.html#collections" }}">collections</a> enable content traversal with a content hierarchy. | ||
A single page can reference pieces of content elsewhere in the site with ease, making content management simple by introducing relations between pages. | ||
|
||
### Generalising Beyond Markup | ||
|
||
Vox pages have only three elements: the frontmatter, the body, and the templating within the body. | ||
As such, content can resemble anything; the body is not restricted to Markdown and the output is not restricted to HTML. | ||
Pages aren't relegated to being single chunk of markup with some metadata on top. | ||
|
||
### Simple Theming | ||
|
||
Due to the relational nature of pages, a Vox site is free to have its own schema of sorts, as established by the layouts & includes. | ||
Consequently, 'themes' can be written which involve configuration of `global.toml` and nothing more, provided pages are written in accordance to the theme's 'schema'. | ||
|
||
--- | ||
|
||
Vox is opinionated, but with its uniqueness comes distinct advantages. | ||
In the future, I'll write about extending Vox with a bespoke static CMS to replace traditional CMSes in countless more use-cases. | ||
Thanks for reading! | ||
|
||
{% endmarkdown %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
title = "Approaching Initial Release" | ||
date = 2024-06-11 | ||
layout = "post" | ||
permalink = "date" | ||
--- | ||
|
||
{% markdown %} | ||
|
||
## 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 | ||
|
||
--- | ||
|
||
## Future Goals | ||
|
||
- Move as much CLI code as possible into library. | ||
- Incorporating `global.toml` into DAG construction. | ||
- Incorporating snippets into DAG construction. | ||
|
||
{% endmarkdown %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.