Don't die when tags.tt is missing (#41)#67
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #41.
Diagnosis
tags.ttis arguably the one non-critical template, but a blog with no tags at all still died to publish without it:The cause:
publish_tag_indexesrenders 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: iftags.ttdoesn't exist, skip tag-page publication and let the rest of the blog publish. Warn (viacarp) — 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.twith two cases, both withtags.ttremoved:/tags\.tt/and still produces its post.Both died before the fix; both pass now. Full suite green (84 tests).
🤖 Generated with Claude Code