Skip to content

Don't die when tags.tt is missing (#41)#67

Merged
jmacdotorg merged 1 commit into
masterfrom
fix/41-missing-tags-template
Jun 22, 2026
Merged

Don't die when tags.tt is missing (#41)#67
jmacdotorg merged 1 commit into
masterfrom
fix/41-missing-tags-template

Conversation

@jmacdotorg

Copy link
Copy Markdown
Owner

Closes #41.

Diagnosis

tags.tt is arguably the one non-critical template, but a blog with no tags at all still died to publish without it:

Can't open template file .../templates/tags.tt for reading: No such file or directory

The cause: publish_tag_indexes renders the tag index page unconditionally (even when the tag map is empty), so the missing template is touched on every publish regardless of whether the blog uses tags.

Fix

Guard publish_tag_indexes: if tags.tt doesn't exist, skip tag-page publication and let the rest of the blog publish. Warn (via carp) — rather than die — only when the blog actually uses tags and is therefore losing content by skipping their pages.

Test

Adds t/missing_tags_template.t with two cases, both with tags.tt removed:

  • a tag-free blog publishes silently and produces its post;
  • a tagged blog publishes with a warning matching /tags\.tt/ and still produces its post.

Both died before the fix; both pass now. Full suite green (84 tests).

🤖 Generated with Claude Code

tags.tt is the one non-critical template, but publication died without it
even for blogs that have no tags, because the tag *index* page was always
rendered. Guard publish_tag_indexes: if tags.tt is absent, skip tag-page
publication and carry on. Warn (rather than die) only when the blog
actually uses tags and therefore loses content.

Adds t/missing_tags_template.t covering both the tag-free case (publishes
silently) and the tagged case (publishes with a warning).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jmacdotorg jmacdotorg merged commit 022f41a into master Jun 22, 2026
3 checks passed
@jmacdotorg jmacdotorg deleted the fix/41-missing-tags-template branch June 22, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

If tags.tt is missing, publication breaks messily

1 participant