-
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.
TODO: - Implement pagination. - Modify log output to be more helpful for end-users.
- Loading branch information
Showing
19 changed files
with
266 additions
and
132 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
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,57 @@ | ||
--- | ||
title = "Collections & Pagination" | ||
date = 2024-06-07 | ||
layout = "post" | ||
permalink = "date" | ||
--- | ||
|
||
{% markdown %} | ||
|
||
## Goals | ||
- Supporting pages in multiple collections at once with path nesting. | ||
- If a build has failed, don't immediately retry. | ||
- Upgrading all direct dependencies. | ||
- Implement pagination. | ||
- Modify log output to be more helpful for end-users. | ||
|
||
### Collections | ||
|
||
To support this, `collections` must be renamed to `depends`, and `collection` to `collections`. | ||
|
||
The rule: one collection per path component, and collections including each successive path component. | ||
- Collection names must be represented as Liquid identifiers so they can be used in templating in dependent pages. | ||
- Example: `books/fantasy/page.vox` is in `books`, `fantasy`, and `books_fantasy`. | ||
- Example: `movies/fantasy/page.vox` is in `movies`, `fantasy`, and `movies_fantasy`. | ||
|
||
### Retrying Builds | ||
|
||
This was always the intended behaviour. The mistake was in accidentally checking for a [`JoinError`](https://docs.rs/tokio/latest/tokio/task/struct.JoinError.html) when the build thread had completed, rather than checking for errors from the build thread. | ||
|
||
### Upgrading Dependencies | ||
|
||
Notably, this brought my implementation of Jekyll's sorting filter, which was merged into the Liquid Rust implementation. | ||
|
||
### Pagination | ||
|
||
Pages may have a `pagination` frontmatter value, containing: | ||
* `pagination.collection`: the name of a collection in a page's `depends` list | ||
* `pagination.page_size`: the maximum number of collection pages per page | ||
|
||
Pages using pagination are copied in memory, with each copy being supplied different `pagination.page_number` values. | ||
The `pagination.page_number` is used in a page's `permalink`, and can be used with `pagination.page_size`: | ||
- to calculate the starting index in the collection for the current page | ||
- to calculate the total number of pages | ||
- to determine the URL of any page | ||
- to calculate the remaining number of pages | ||
- This requires the length of the paginated collection as well | ||
|
||
--- | ||
|
||
## Future Goals | ||
- Parallelising as much as possible. | ||
- Removing code that was commented out. | ||
- Documenting the CLI code. | ||
- Creating a logo for Vox. | ||
- 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
collections = ["blog"] | ||
depends = ["blog"] | ||
permalink = "blog/atom.xml" | ||
--- | ||
{% include atom.voxs posts = blog %} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
layout = "default" | ||
collections = ["blog"] | ||
depends = ["blog"] | ||
permalink = "blog/index.html" | ||
--- | ||
{% assign posts = blog | sort: "date" %} | ||
{% assign posts = blog | sort: "date.rfc_3339" | reverse %} | ||
{% include index.voxs posts = posts minimal = true %} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
collections = ["diary"] | ||
depends = ["diary"] | ||
permalink = "diary/atom.xml" | ||
--- | ||
{% include atom.voxs posts = diary %} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
layout = "default" | ||
collections = ["diary"] | ||
depends = ["diary"] | ||
permalink = "diary/index.html" | ||
--- | ||
{% assign posts = diary | sort: "date" %} | ||
{% assign posts = diary | sort: "date.rfc_3339" | reverse %} | ||
{% include index.voxs posts = posts minimal = true %} |
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
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.