Customizing the Theme
The site uses the Serene theme, installed as a git submodule. Customizations are made by overriding theme files, not editing the theme directly.
The Override Pattern
Zola checks your project’s directories first, then falls back to the theme:
templates/blog.html ← Zola uses this (your override)
themes/serene/templates/blog.html ← Ignored when override exists
To customize any theme template:
- Find the original in
themes/serene/templates/ - Copy it to the same relative path in your project’s
templates/ - Modify your copy
The theme’s original stays untouched, so git submodule update --remote can pull theme updates without conflicts.
Template Customization
Modifying an Existing Template
Example: changing the back link text on the blog page.
- The theme’s
blog.htmlhas a generic back link - Copy
themes/serene/templates/blog.html→templates/blog.html - Change the back link:
<a id="back-link" href="{{ get_url(path="/") }}">← Home</a>
Adding a New Taxonomy Template
Serene provides tags/ templates but no series/ templates. To add series support:
- Create
templates/series/list.htmlandtemplates/series/single.html - Model them after the existing
tags/templates - Use the same
{% extends "_base.html" %}pattern and CSS classes
The templates will automatically be used for URLs matching /series/ and /series/<name>/.
Style Customization
SCSS Overrides
The sass/ directory is currently empty. To override Serene’s styles:
- Find the SCSS file in
themes/serene/sass/ - Create a file with the same name in your
sass/directory - Zola compiles yours instead of the theme’s
Inline Styles
For small, one-off tweaks, inline styles work in templates:
<div id="series-info" style="margin-top: 0.5em; font-size: 0.9em;">
This is acceptable for minor additions but should be moved to SCSS as customizations grow.
Theme Features (Controlled via Config)
These Serene features are toggled in content/posts/_index.md under [extra]:
| Feature | Setting | Current |
|---|---|---|
| Table of contents | toc | true |
| Code copy button | copy | true |
| Comments (Giscus) | comment | false |
| Outdate alert | outdate_alert | false |
Site-wide features are in zola.toml under [extra]:
| Feature | Setting | Current |
|---|---|---|
| Dark mode toggle | force_theme = false | Enabled |
| Emoji reactions | reaction | false |
| Footer credits | footer_credits | true |
Updating the Theme
# Pull latest changes from Serene
git submodule update --remote themes/serene
# Test locally
zola serve
# If everything works, commit the submodule update
git add themes/serene
git commit -m "Update Serene theme"
Caution: If Serene changes the structure of a template you’ve overridden, your override may break. Always test locally after updating.