A simple Hugo theme for books.
- Chapters: welcome
- Anthologies: natch
- Footnotes and citations: modal
- Typography: pretty good
- Nice on mobile: yep
- LLM-blocking
robots.txt: included
For works with chapters, create a folder in content (I usually use read) and put a file in it named _index.md containing the following:
---
type: chapter
---Then, for all of your chapters, put them in Markdown or HTML files that directory. They'll be paginated in alphabetical order, so I usually name the files 001.md, 002.md, etc.
For anthologies, each work can be in a Markdown/HTML file of type story. Create a file in data called e.g: works.yaml. For each story, create an entry:
- title: Your story's title
authors:
- Author A
- Author B
contributors:
- Contributor A
type: short story # This is freeform text, just metadata for the readers
description: This is my great short story where a bunch of neat things happen
cw: optional content warnings go here
spoilers: optional spoilers for other works go hereThis is good for basic short stories. If you have short stories that are logically grouped together, you can add a category entry in their YAML, then create a categories.yaml file in data:
- id: my-cateogry
name: My CategoryAnd the listing will break it up accordingly. If a work has associated works (like an essay that goes with a novella), you can add a parent entry to its YAML that contains the parent's title exactly, and it will nest it accordingly.
Authors can have their names linked out by creating an authors.yaml file in data with the key being the author's name and the value being the url:
Author A: https://example.com
Contributor A: https://example.orgThen, wherever you want the story listing, you can use the shortcode:
{{< works corpus="works" collections="collections" creators="creators" >}}For a good example of both chapters and an anthology, see the repo for Marsh.