Templates¶
Inkfeed uses Jinja2 templates for HTML-based output formats (HTML and Sleepscreen).
Template Directory¶
Templates are stored in inkfeed/templates/ and bundled with the package via pyproject.toml:
[tool.setuptools.package-data]
inkfeed = ["templates/*.html", "assets/fonts/*.ttf", "assets/fonts/LICENSE.txt"]
Available Templates¶
Core Templates¶
| Template | Purpose |
|---|---|
base.html |
Base layout with common HTML structure |
main_index.html |
Top-level date index page |
html_index.html |
Source-level index page |
html_article.html |
Individual article page |
Source-Specific Story Templates¶
| Template | Used By |
|---|---|
hn_story.html |
Hacker News articles (includes comments) |
kagi_story.html |
Kagi News articles |
rss_story.html |
RSS feed articles |
Sleepscreen Templates¶
| Template | Purpose |
|---|---|
sleepscreen_base.html |
Base layout for e-ink display |
sleepscreen_title.html |
Title/header card |
sleepscreen_spotlight.html |
Featured article card |
sleepscreen_headlines.html |
Headlines list card |
Template Variables¶
Templates receive context variables from their respective writers. Common variables include:
title— Page or article titledate_str— Date string (e.g.,"2026-02-18")articles— List of article objectsentries— List of index entries for navigation
Customizing Templates¶
Templates use standard Jinja2 syntax. To customize:
- Locate the template in
inkfeed/templates/ - Edit the HTML/Jinja2 markup
- Run Inkfeed to see your changes
Note
Template changes are picked up immediately — no rebuild or cache clearing needed.
Warning
Templates are part of the package. If you reinstall Inkfeed, your customizations may be overwritten. Consider keeping a backup.