Skip to content

Treat subdomains of the site host as internal links - #7

Merged
etagwerker merged 1 commit into
mainfrom
FR-767-subdomains
Jul 31, 2026
Merged

Treat subdomains of the site host as internal links#7
etagwerker merged 1 commit into
mainfrom
FR-767-subdomains

Conversation

@julioalucero

Copy link
Copy Markdown
Member

Link to Jira

FR-767: Sibling subdomains get rel="nofollow" as if they were external links

PR description

SEMrush flagged 12 internal links across 9 pages of the FastRuby.io blog as nofollow. The nofollow isn't in the Jekyll sources, this gem adds it at build time: external_link? compared hosts exactly, so with url: https://www.fastruby.io the site host is fastruby.io and audit.fastruby.io / skunk.fastruby.io came out external. SEMrush counts subdomains as the same site. v0.2.0 already fixed the www. case, subdomains were the remaining gap.

  • Added a subdomain check to external_link? in lib/jekyll-external-link-accessibility.rb: a host ending in .<site_host> is internal
    • The leading dot is what keeps notfastruby.io external. fastruby.github.io stays external too, which matters because a post links to it
    • Guarded on site_host being present, otherwise a site with no url would compare against "."
  • Bumped VERSION to 0.3.0 (plus Gemfile.lock)
  • Documented the new behavior in the README usage section

After this is released, the blog repo needs the gem bumped in Gemfile / Gemfile.lock / Gemfile.next.lock, and our_hosts in blog/spec/blog_spec.rb widened to any *.fastruby.io host so the same thing can't slip through again.

QA steps

  1. Check the real hosts:

3Build the blog against this branch and confirm no nofollow on *.fastruby.io links, e.g. /blog/open-source-tooling.html had 3 of them

@julioalucero julioalucero self-assigned this Jul 30, 2026

@etagwerker etagwerker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julioalucero Good idea. Thanks!

@etagwerker
etagwerker merged commit cc73d75 into main Jul 31, 2026
8 checks passed
@etagwerker
etagwerker deleted the FR-767-subdomains branch July 31, 2026 01:33
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.

2 participants