Point index.html symlink at recent.html by basename (#54)#70
Merged
Conversation
The docroot/index.html symlink was created with recent_file's full path
as its target. When the docroot was named by a relative path, that target
("docroot/recent.html") resolved to docroot/docroot/recent.html from
inside the docroot, leaving index.html dangling. Even with an absolute
path the link was non-portable, breaking if the tree moved.
index.html sits beside recent.html in the docroot, so link to it by
basename. The relative sibling target is correct for absolute and
relative configs alike and survives the tree being moved.
Adds t/index_symlink.t asserting the link targets "recent.html" and
resolves.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Per review, remove the three-line comment added above the symlink call. 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 #54.
Diagnosis
publish_recent_pagecreated thedocroot/index.htmlsymlink withrecent_file's full path as the target:When the blog's docroot is named by a relative path,
recent_filestringifies to something likedocroot/recent.html. Since the symlink lives inside docroot, that target resolves todocroot/docroot/recent.html— soindex.htmldangles. (This is exactly what the reporter saw:index.html -> docroot/recent.html.) Even with an absolute path the link technically resolved but was non-portable — it broke if the published tree was moved or served from a different mount.Fix
index.htmlsits right besiderecent.htmlin the docroot, so link to it by basename:A relative sibling target is correct whether the docroot is configured with an absolute or relative path, and survives the whole tree being relocated.
Test
Adds
t/index_symlink.t: after publishing, assertsdocroot/index.htmlis a symlink, thatreadlinkreturns exactlyrecent.html, and that it resolves to an existing file. Thereadlinkassertion failed before the fix (the target was the full path); all pass now. Also verified end-to-end against the reporter's relative-path scenario. Full suite green (81 tests).🤖 Generated with Claude Code