Skip to content

fix: homepage redirects to log permalink, not dead /blog/log#12

Merged
tieubao merged 2 commits into
mainfrom
fix/stale-blog-links
Jun 27, 2026
Merged

fix: homepage redirects to log permalink, not dead /blog/log#12
tieubao merged 2 commits into
mainfrom
fix/stale-blog-links

Conversation

@tieubao

@tieubao tieubao commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

The homepage (layouts/_default/index.html) hardcoded a JS redirect to /blog/log. After posts moved off the /blog/ prefix (08 + slug-basename), that URL 404s , so the site's front door bounced visitors to a dead page.

Fix: redirect to the post's real Hugo permalink instead of a hardcoded path:

- window.location.replace(currentUrl + "/blog/log");
+ window.location.replace("{{ (site.GetPage "/blog/log").RelPermalink }}");   // -> /log/

Resolves to /log/ and follows the page through any future permalink change. GetPage "/blog/log" keys off the content path (unchanged), so the lookup still works.

Scope: this was the ONLY stale hardcoded post URL in layouts/ (nav/menu links are Hugo-generated and auto-updated). External/bookmarked /blog/<slug>/ links are handled by aliases: on the moved posts (separate content PR).

Proof (green + negative control): docs/verification/stale-blog-links.md.

🤖 Generated with Claude Code

tieubao and others added 2 commits June 28, 2026 04:18
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tieubao tieubao merged commit 17182ee into main Jun 27, 2026
1 check passed
@tieubao tieubao deleted the fix/stale-blog-links branch June 27, 2026 21:20
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.

1 participant