Fix tag links 404 by applying baseurl (Fixes #100) - #102
Merged
Conversation
Tag links were hardcoded as /tags/<tag>/ and the per-tag RSS link as /tags/<tag>/feed.xml, omitting the site baseurl (/Blog). On the GitHub Pages project site this resolved to ultimatecoder.github.io/tags/<tag>/ (404) instead of the generated page at .../Blog/tags/<tag>/. Route both through the relative_url filter so site.baseurl is prepended, matching the pattern already used for post.url in tag_index.html. This also URL-encodes tags containing spaces. Fixes #100 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ultimatecoder
added a commit
that referenced
this pull request
Aug 1, 2026
The site has been served as a GitHub Pages project site at ultimatecoder.github.io/Blog/, which forced a "/Blog" baseurl through _config.yml and scripts/test. That prefix already caused one production bug (#100, tag links 404) and still breaks the root-absolute favicon and apple-touch-icon paths in _includes/head.html, which resolve against the domain root rather than /Blog/. Point the site at blog.jaysinh.dev instead. The custom domain serves from the domain root, so baseurl becomes empty: * CNAME (new) tells GitHub Pages which domain to attach. The deploy is artifact-based (actions/deploy-pages), and Jekyll copies unknown root files into _site/, so the artifact carries it. * _config.yml drops the "/Blog" baseurl. * _config_production.yml points url at the new host, which feeds jekyll-seo-tag canonicals and the jekyll-sitemap output. * scripts/test no longer needs --swap-urls "^/Blog:" — with an empty baseurl, _site/ on disk already matches the served paths. The 73 internal links now pass unrewritten, which is what proves the change is internally consistent. Tag links need no change: #102 routed them through relative_url, so they pick up the empty baseurl and render as /tags/<tag>/ automatically. Posts referencing {{ site.url }}{{ site.baseurl }}/assets/... resolve correctly for the same reason. Also ignore www.gweca.ac.in in the link checker. It returns 200 to curl over both HTTP and HTTPS but 415 to htmlproofer — the same bot/WAF blocking already recorded as "ci-block" for other hosts. Unrelated to this change, but it fails CI. Co-authored-by: Jaysinh Shukla <jaysinhshukla@Jaysinhs-MacBook-Pro-2.local> Co-authored-by: Claude Opus 5 <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.
Problem
Clicking any tag from the Tags page returns a 404 (issue #100).
The site is a GitHub Pages project site with
baseurl: "/Blog". The custom plugin_plugins/tag_gen.rbcorrectly generates each tag page at/Blog/tags/<tag>/index.html, but the links to those pages were hardcoded absolute as/tags/<tag>/, dropping the/Blogprefix. The browser then requestedultimatecoder.github.io/tags/<tag>/(404) instead of the real page at.../Blog/tags/<tag>/.Fix
Route the links through the Jekyll
relative_urlfilter, which prependssite.baseurl— matching the pattern already used forpost.url | relative_urlintag_index.html._layouts/tags_folder_index.html— tag list link_layouts/tag_index.html— per-tag RSS subscribe linkNo plugin changes needed; page generation was already correct. As a bonus,
relative_urlURL-encodes tags containing spaces.Verification
Rebuilt locally (
bundle exec jekyll build):/Blog/tags/<tag>/(e.g./Blog/tags/How-to/,/Blog/tags/Ubuntu/)/Blog/tags/<tag>/feed.xmlTargets
masterso the Pages deploy workflow (.github/workflows/pages.yml, triggered on push to master) publishes the fix.Fixes #100
🤖 Generated with Claude Code