feat: Add canonical=false option to disable canonical URL output#521
Open
rathboma wants to merge 1 commit intojekyll:masterfrom
Open
feat: Add canonical=false option to disable canonical URL output#521rathboma wants to merge 1 commit intojekyll:masterfrom
rathboma wants to merge 1 commit intojekyll:masterfrom
Conversation
Similar to the existing title=false option, this allows users to disable
the canonical URL output when using other plugins (like jekyll-polyglot)
to generate canonical URLs for multilingual sites.
Usage: {% seo canonical=false %}
This disables the <link rel="canonical"> tag while still outputting
the <meta property="og:url"> tag.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
rathboma
added a commit
to rathboma/polyglot
that referenced
this pull request
Jan 14, 2026
Instead of trying to exclude canonical URLs from relativization via regex (which was complex and error-prone), recommend using jekyll-seo-tag's new `canonical=false` option combined with Polyglot's I18n_Headers tag. This provides cleaner separation of concerns: - jekyll-seo-tag handles all SEO tags except canonical - Polyglot's I18n_Headers handles canonical and hreflang tags with proper translation detection Changes: - Remove canonical exclusion from absolute_url_regex - Update README to document jekyll-seo-tag integration - Remove test for canonical regex exclusion Related: jekyll/jekyll-seo-tag#521 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
10 tasks
Member
|
@rathboma this looks good. thanks for the contribution! If you could fix up the style guide issues, that would unblock merging this. I've pulled them out of the action to make it easier |
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.
Summary
Adds a new
canonical=falseoption to disable the<link rel="canonical">tag output, similar to the existingtitle=falseoption.Use Case
When using multilingual plugins like jekyll-polyglot, the canonical URL needs special handling:
By allowing users to disable the canonical output from jekyll-seo-tag, they can use their multilingual plugin's canonical URL generation instead.
Usage
{% seo canonical=false %}This disables only the
<link rel="canonical">tag while still outputting all other SEO tags including<meta property="og:url">.Changes
canonical?method toDropclass (similar totitle?)canonical?methodcanonical=falseTesting
All 222 existing tests pass, plus 5 new tests for the canonical feature.
🤖 Generated with Claude Code