Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
850c19f
feat(hugo): generate the Hugo theme's assets and add the theme metadata
phoduke Nov 12, 2026
eb2702f
feat(hugo): add the Marginalia example site
phoduke Nov 12, 2026
5e552f8
feat(hugo): add the sites that only the checks build
phoduke Nov 12, 2026
867a919
feat(hugo): add the Hugo build images, builds and checks
phoduke Nov 12, 2026
a0808e5
ci: check the Hugo theme on its minimum version and the latest
phoduke Nov 12, 2026
0607efe
feat(hugo): add the release script for the Hugo theme repository
phoduke Nov 12, 2026
ffb8264
docs: describe building and checking the Hugo theme
phoduke Nov 12, 2026
c1de54b
fix(hugo): load the demo's theme from the harness and ignore Hugo's o…
phoduke Nov 12, 2026
0481362
fix(hugo): resolve the demo's asset shortcode under the baseURL
phoduke Nov 12, 2026
8e92fd5
feat(hugo): list the allowed differences from the design pages
phoduke Nov 12, 2026
d80c5a4
feat(hugo): add the theme listing screenshots
phoduke Nov 12, 2026
e7761f4
feat(hugo): add the Readerly Hugo theme templates, strings and README
phoduke Nov 12, 2026
a9ae3dd
feat(hugo): add the Readerly Hugo theme templates and strings
phoduke Nov 12, 2026
582edb1
fix(hugo): print genre names as written and keep menu URLs under the …
phoduke Nov 12, 2026
9bb1302
docs: name the Hugo port in the repository README
phoduke Nov 12, 2026
1b548a2
fix(hugo): address review findings in the theme
phoduke Nov 12, 2026
605a801
fix(tools): harden the Hugo harness and release script
phoduke Nov 12, 2026
12ba00d
test(hugo): check that genre names keep the casing the posts give them
phoduke Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,28 @@ jobs:
trap 'docker rm -f "$cid" >/dev/null' EXIT
docker cp . "$cid:/repo"
docker start -a "$cid"

hugo:
name: Hugo theme on the minimum Hugo version and the latest
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
# Builds the demo and the fixtures on both versions. A build that writes
# anything to stderr fails.
- name: Build every site on both Hugo versions
run: |
set -euo pipefail
tools/hugo-dev/hugo-dev.sh images
tools/hugo-dev/hugo-dev.sh build
# Same-HTML, link, design-parity and browser checks, in the Playwright
# image that matches tools/package.json.
- name: Check the builds
run: |
set -euo pipefail
cid="$(docker create -w /repo mcr.microsoft.com/playwright:v1.61.0-noble bash -c 'npm ci --prefix tools --no-audit --no-fund >/dev/null && node tools/hugo-dev/check-builds.mjs tools/hugo-dev/out')"
trap 'docker rm -f "$cid" >/dev/null' EXIT
docker cp . "$cid:/repo"
docker start -a "$cid"
42 changes: 38 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Readerly

Readerly is a free theme for people who love books, for WordPress and for Jekyll. It is built for a book blog first, and it also gives you an author website and a reading log. Each use is optional: the theme creates no pages, posts or categories, and every section can be removed. It comes in two styles, Paper (light) and Lamplight (dark), and bundles its fonts, so it makes no third-party requests.
Readerly is a free theme for people who love books, for WordPress, Jekyll and Hugo. It is built for a book blog first, and it also gives you an author website and a reading log. Each use is optional: the theme creates no pages, posts or categories, and every section can be removed. It comes in two styles, Paper (light) and Lamplight (dark), and bundles its fonts, so it makes no third-party requests.

The WordPress theme requires WordPress 6.9 and PHP 7.4, under GPLv2 or later. The Jekyll theme runs on GitHub Pages and Jekyll 4, under the MIT License.
The WordPress theme requires WordPress 6.9 and PHP 7.4, under GPLv2 or later. The Jekyll theme runs on GitHub Pages and Jekyll 4, and the Hugo theme on Hugo 0.146.0 or later, both under the MIT License.

## Layout

Expand All @@ -14,7 +14,9 @@ The WordPress theme requires WordPress 6.9 and PHP 7.4, under GPLv2 or later. Th
| `jekyll/starter/` | A ready-to-publish site that uses the theme, published as the template repository `listofbooks-net/jekyll-theme-readerly-starter`. |
| `jekyll/demo/` | The Jekyll demo site, Marginalia, with the design pages' content. |
| `jekyll/fixtures/` | Sites that only the checks build: `bare` (a title and nothing else), `minima` (the output of `jekyll new`) and `sparse` (one post per missing field). |
| `tools/` | The generator, the checks that CI runs, the zip builder, a local WordPress and the Jekyll build images. None of it ships. |
| `hugo/theme/` | The Hugo theme, published as `listofbooks-net/hugo-theme-readerly`, with its demo site, Marginalia, in `hugo/theme/exampleSite/`. |
| `hugo/fixtures/` | Sites that only the checks build: `bare` (a title and nothing else), `quickstart` (what `hugo new site` and `hugo new content` make), `sparse` (one review per missing field), `paginated` (a custom pager path) and `no-credit` (the credit partial emptied). |
| `tools/` | The generator, the checks that CI runs, the zip builder, a local WordPress and the Jekyll and Hugo build images. None of it ships. |

## Generated files

Expand All @@ -25,6 +27,7 @@ The WordPress theme requires WordPress 6.9 and PHP 7.4, under GPLv2 or later. Th
- `wordpress/assets/fonts/`
- `jekyll/theme/assets/css/readerly.css` (fonts, tokens and `design/assets/css/style.css`), `jekyll/theme/assets/js/theme.js`, and the theme's fonts and images
- the demo's covers and images in `jekyll/demo/assets/`
- `hugo/theme/assets/readerly/css/readerly.css` (the same CSS as the Jekyll theme's) and `hugo/theme/assets/readerly/js/theme.js`, the theme's fonts and images in `hugo/theme/static/readerly/`, and the demo's covers and images in `hugo/theme/exampleSite/static/assets/`

```sh
node tools/build-tokens.mjs # regenerate
Expand Down Expand Up @@ -89,6 +92,37 @@ To compare the design pages with the demo by eye, run `node tools/jekyll-dev/sid

`tools/publish-jekyll.sh <version>` pushes a release to the two public repositories: the tag first, then, once the starter builds against that tag, the `v<major>` branch and `main`. Only an operator runs it; see the header of the script.

## Build and check the Hugo theme

You need Docker and Node. The script builds two images from the official extended Hugo release, each checked against its published checksum: the theme's minimum version (`0.146.0`, which must equal `[module.hugoVersion] min` in `hugo/theme/hugo.toml`) and the latest version the theme is tested on (`0.169.0`). Both load the theme from `hugo/theme/`, so nothing is downloaded from the published repository.

```sh
tools/hugo-dev/hugo-dev.sh images # build the two images, once
tools/hugo-dev/hugo-dev.sh build # build every site on both versions into tools/hugo-dev/out/
tools/hugo-dev/hugo-dev.sh serve demo # serve the demo at http://localhost:4000/sub/
```

`build` builds the demo and the five fixtures under the baseURL `http://localhost:4000/sub/`. A build fails when Hugo exits with an error or writes anything to stderr, where it prints every warning.

To run the checks, install the tools and point `CHROMIUM_PATH` at a Chromium:

```sh
npm ci --prefix tools
CHROMIUM_PATH=/usr/bin/chromium tools/hugo-dev/hugo-dev.sh check
```

`check` builds, then runs `tools/hugo-dev/check-builds.mjs`:

1. Each site's HTML is the same on both Hugo versions, whitespace aside.
2. Every internal link and asset resolves to a built file under the baseURL.
3. Every attribute parses, no heading is empty, and each fixture's own cases hold: quotes and `</script>` in titles and authors, a plain-string author and a menu of plain URLs on a site made with `hugo new site`, a custom pager path, and no credit link once the partial is emptied (`check-markup.mjs`).
4. The demo has the same markup as the seven design pages (`check-parity.mjs`). Each allowed difference is in `parity-exceptions.json` with its reason.
5. Every page of every site but `no-credit` passes `tools/wp-dev/check-pages.cjs` at 1280 px and 390 px, in Paper and Lamplight: no overflow, broken images, console errors or third-party requests, one h1, no empty headings or sections, and exactly one footer credit.

To compare the design pages with the demo by eye, run `node tools/hugo-dev/side-by-side.mjs` after a build. It writes `tools/hugo-dev/out/side-by-side/index.html`. `tools/hugo-dev/hugo-dev.sh screenshots` rebuilds the two listing images, `hugo/theme/images/screenshot.png` (1500 by 1000) and `tn.png` (900 by 600), from the demo home page in Paper.

`tools/publish-hugo.sh <version>` pushes a release to the public repository: the tag first, then `main`. Hugo Modules resolve the semantic version tag, so there is no branch to move. Only an operator runs it; see the header of the script.

## Build the zip

```sh
Expand All @@ -103,4 +137,4 @@ tools/wp-dev/wp-dev.sh zip-test dist/readerly-1.0.0.zip

## The footer credit

The footer keeps one link, "Theme by List of Books", to https://www.listofbooks.net/. In WordPress, a site owner can edit or delete it in the Site Editor. In Jekyll, a site owner removes it by adding an empty `_includes/shell/credit.html`.
The footer keeps one link, "Theme by List of Books", to https://www.listofbooks.net/. In WordPress, a site owner can edit or delete it in the Site Editor. In Jekyll, a site owner removes it by adding an empty `_includes/shell/credit.html`, and in Hugo an empty `layouts/_partials/credit.html`.
1 change: 1 addition & 0 deletions hugo/fixtures/bare/hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title = "Bare"
8 changes: 8 additions & 0 deletions hugo/fixtures/no-credit/content/reviews/the-only-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: The Only Review
date: 2026-10-01
book_author: Ada Lin
categories: [Essays]
rating: 4
---
A single review, so the home page, the archive and the review page all carry the footer.
1 change: 1 addition & 0 deletions hugo/fixtures/no-credit/hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title = "No credit"
Empty file.
6 changes: 6 additions & 0 deletions hugo/fixtures/paginated/content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
layout: sections
sections: [intro, recent-reviews]
intro:
heading: The blog
---
8 changes: 8 additions & 0 deletions hugo/fixtures/paginated/content/reviews/review-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Review number 1
date: 2026-10-01
book_author: Author 1
categories: [Essays]
rating: 4
---
Body 1.
8 changes: 8 additions & 0 deletions hugo/fixtures/paginated/content/reviews/review-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Review number 2
date: 2026-10-02
book_author: Author 2
categories: [Essays]
rating: 4
---
Body 2.
8 changes: 8 additions & 0 deletions hugo/fixtures/paginated/content/reviews/review-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Review number 3
date: 2026-10-03
book_author: Author 3
categories: [Essays]
rating: 4
---
Body 3.
8 changes: 8 additions & 0 deletions hugo/fixtures/paginated/content/reviews/review-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Review number 4
date: 2026-10-04
book_author: Author 4
categories: [Essays]
rating: 4
---
Body 4.
8 changes: 8 additions & 0 deletions hugo/fixtures/paginated/content/reviews/review-5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Review number 5
date: 2026-10-05
book_author: Author 5
categories: [Essays]
rating: 4
---
Body 5.
7 changes: 7 additions & 0 deletions hugo/fixtures/paginated/hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Two reviews a page and a custom pager path: page 2 of the blog is /blog/seite/2/.
baseURL = "https://example.org/"
title = "Paginated"

[pagination]
pagerSize = 2
path = "seite"
5 changes: 5 additions & 0 deletions hugo/fixtures/quickstart/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
date = '{{ .Date }}'
draft = true
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
+++
6 changes: 6 additions & 0 deletions hugo/fixtures/quickstart/content/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
date = '2026-11-10T09:00:00Z'
title = 'About'
+++

A plain page on a plain Hugo site.
13 changes: 13 additions & 0 deletions hugo/fixtures/quickstart/content/posts/my-first-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
+++
date = '2026-11-10T09:00:00Z'
draft = false
title = 'My First Post'
categories = ['Notes']
tags = ['hello']
+++

This is the first post on a site made with `hugo new site`, using the quickstart steps and nothing else.

The theme is added as a module or a submodule and named in `hugo.toml`. Nothing in the content changes.

A third paragraph proves that the whole body is printed, and that the byline names the author from `params.author`.
21 changes: 21 additions & 0 deletions hugo/fixtures/quickstart/hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# What `hugo new site` writes, plus a plain-string author and a menu of plain URLs.
baseURL = "https://example.org/"
title = "My New Hugo Site"

[params]
author = "Jane Doe"

[[menus.main]]
name = "Home"
url = "/"
weight = 1

[[menus.main]]
name = "Posts"
url = "/posts/"
weight = 2

[[menus.main]]
name = "About"
url = "/about/"
weight = 3
4 changes: 4 additions & 0 deletions hugo/fixtures/sparse/content/author.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
layout: author
title: An Author With "No" Books
---
5 changes: 5 additions & 0 deletions hugo/fixtures/sparse/content/reading-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: reading-log
title: Reading log
year: 2025
---
11 changes: 11 additions & 0 deletions hugo/fixtures/sparse/content/reviews/no-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: A Book With No Cover
date: 2026-10-01
book_author: Ada Lin
categories: [Fantasy]
rating: 3
status: read
finished: 2026-09-28
summary: The card shows a typeset cover with the title and author.
---
No `cover` key, so every card and the book panel show the typeset placeholder.
8 changes: 8 additions & 0 deletions hugo/fixtures/sparse/content/reviews/no-genre.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: A Book With No Genre
date: 2026-10-03
book_author: Cora Pike
rating: 4
pages: 200
---
No `genre`: no label above the title, no genre list entry and no related posts.
8 changes: 8 additions & 0 deletions hugo/fixtures/sparse/content/reviews/no-rating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: A Book With No Rating
date: 2026-10-02
book_author: Ben Ola
categories: [Fantasy]
status: read
---
No `rating`, so no stars, and no `finished`, so it sorts last on the Read shelf.
5 changes: 5 additions & 0 deletions hugo/fixtures/sparse/content/reviews/plain-article.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: A plain blog post
date: 2026-10-04
---
No book keys at all, so there is no book panel and the post is an ordinary article.
11 changes: 11 additions & 0 deletions hugo/fixtures/sparse/content/reviews/quoted-title.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: The "Quiet" Arithmetic
date: 2026-10-07
book_author: Ann "Ace" O'Neil </script>
categories: [Essays]
rating: 4
pages: 200
status: reading
current_page: 50
---
A title and an author with double quotes, and an author name that contains `</script>`, which must not end the JSON-LD block.
8 changes: 8 additions & 0 deletions hugo/fixtures/sparse/content/reviews/reading-no-pages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: A Book I Am Reading
date: 2026-10-06
book_author: Eli Moss
status: reading
current_page: 40
---
`status: reading` with no `pages`, so the card has a badge and no progress bar.
10 changes: 10 additions & 0 deletions hugo/fixtures/sparse/content/reviews/unknown-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: A Book With An Unknown Status
date: 2026-10-05
book_author: Dev Rao
categories: [Essays]
status: abandoned
verdict:
summary: A verdict with a summary and no lists.
---
An unknown `status` puts the book on no shelf and shows no badge.
2 changes: 2 additions & 0 deletions hugo/fixtures/sparse/data/books.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- featured: true
blurb: A featured book with no title, which the new-release section skips.
5 changes: 5 additions & 0 deletions hugo/fixtures/sparse/data/events.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Only a past event, so the events section prints nothing.
- title: A reading that already happened
date: 2020-01-01
- where: An upcoming event with no title, which is skipped
date: 2099-01-01
8 changes: 8 additions & 0 deletions hugo/fixtures/sparse/hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# One review per row of the theme's "when it is missing" table.
# No author, menus, footer, newsletter, archive page or praise.
baseURL = "https://example.org/"
title = "Sparse"

[params.readerly]
# A protocol-relative URL, which the theme must leave as written.
favicon = "//example.com/favicon.svg"
24 changes: 24 additions & 0 deletions hugo/theme/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MIT License

Copyright (c) 2026 List of Books

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

The fonts in static/readerly/fonts are licensed separately under the SIL Open Font
License 1.1; each font folder holds its OFL.txt.
Loading
Loading