Skip to content

Commit 0bfa654

Browse files
ultimatecoderJaysinh Shuklaclaude
authored
Serve the blog at the custom domain blog.jaysinh.dev (#103)
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>
1 parent 719bffb commit 0bfa654

5 files changed

Lines changed: 11 additions & 13 deletions

File tree

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blog.jaysinh.dev

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Blog - [Jaysinh's own heed](https://ultimatecoder.github.io/Blog/)
1+
# Blog - [Jaysinh's own heed](https://blog.jaysinh.dev/)
22

33
This repository contains backend tool I use to write and publish my blog. Since begining, I have invested more time in identifying proper flow than writing blog post.
44

55
* Framework: Jekyll
6-
* URL: https://ultimatecoder.github.io/Blog/
6+
* URL: https://blog.jaysinh.dev/
77
* Build/deploy: GitHub Actions ([`.github/workflows/`](.github/workflows)) — every pull request runs a build + link-check ([`ci.yml`](.github/workflows/ci.yml)), and pushes to `master` build and publish to GitHub Pages ([`pages.yml`](.github/workflows/pages.yml)).

_config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ description: > # this means to ignore newlines until "baseurl:"
2020
and an Actor by gene. I write mostly on programming topics. Browse through
2121
my blog posts to identify my taste of writing.
2222
23-
# GitHub Pages project site path. Keep in sync with the "^/Blog" prefix
24-
# in scripts/test's --swap-urls, which strips it for local link-checking.
25-
baseurl: "/Blog" # the subpath of your site, e.g. /blog
23+
# Served at the root of the custom domain in CNAME, so there is no subpath.
24+
baseurl: "" # the subpath of your site, e.g. /blog
2625
twitter_username: jaysinhp
2726
github_username: ultimatecoder
2827

_config_production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
url: "https://ultimatecoder.github.io" # the base hostname & protocol for your site, e.g. https://example.com
1+
url: "https://blog.jaysinh.dev" # the base hostname & protocol for your site, e.g. https://example.com

scripts/test

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export LANG=en_US.UTF-8
77

88
# External URLs htmlproofer should not fail on. Two reasons appear here:
99
# dead — confirmed 404/gone, unrelated to this repo
10-
# ci-block — live (200 from a browser) but returns 403 to GitHub Actions'
11-
# shared runner IPs, i.e. bot/WAF blocking, not a broken link
10+
# ci-block — live (200 from a browser) but returns 403/415 to htmlproofer,
11+
# i.e. bot/WAF blocking, not a broken link
1212
ignore_urls=(
1313
"https://drive.google.com/file/d/0B_TmiicGbqjHb2ZGcE5QYmtXRHc/view?usp=sharing" # dead
1414
"https://reps.mozilla.org/e/maker-party-gujarat/" # dead
@@ -17,14 +17,12 @@ ignore_urls=(
1717
"https://www.ahduni.edu.in/" # ci-block
1818
"https://pythonexpress.in/" # ci-block
1919
"https://www.hackerearth.com" # ci-block
20+
"http://www.gweca.ac.in" # ci-block
2021
)
2122
# htmlproofer wants a single comma-separated string.
2223
ignore_urls_csv=$(IFS=,; echo "${ignore_urls[*]}")
2324

24-
# _site/ is the site root on disk, but pages link internally with the
25-
# "/Blog" baseurl (this is a GitHub Pages project site, not a custom
26-
# domain) — strip it so internal-link checks resolve against ./_site/.
27-
# Keep this "^/Blog" prefix in sync with baseurl in _config.yml.
25+
# baseurl is empty (the site is served at the root of a custom domain), so
26+
# internal links already resolve against ./_site/ with no URL rewriting.
2827
bundle exec htmlproofer ./_site/ --only-4xx --no-enforce-https \
29-
--swap-urls "^/Blog:" \
3028
--ignore-urls "$ignore_urls_csv"

0 commit comments

Comments
 (0)