Skip to content

Add a self-referencing canonical tag to every page - #586

Merged
bilgeyucel merged 2 commits into
deepset-ai:mainfrom
jasdeepbhangal-oss:add-default-canonical-tag
Oct 12, 2026
Merged

bilgeyucel merged 2 commits into
deepset-ai:mainfrom
jasdeepbhangal-oss:add-default-canonical-tag

Conversation

@jasdeepbhangal-oss

@jasdeepbhangal-oss jasdeepbhangal-oss commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Search Console flagged 72 haystack.deepset.ai URLs as "Duplicate without user-selected canonical". They are pages reached through tracking links like /?utm_source=... and /?ref=itsfoss.com. Only pages with canonical_url set get a canonical tag, so Google treats each tracking link as a separate copy of the page.

This adds a canonical tag pointing at the page's own URL whenever canonical_url isn't set. The trailing slash is dropped to match the sitemap and the live URLs (trailingSlash: false). Pages with canonical_url keep it as before.

Paginated lists (/blog/2, /release-notes/3, tag and author pages) point at their own page rather than page 1. The blog post list moves into a shared blog-list-posts partial so the head and the body paginate the same list, otherwise Hugo reuses the wrong paginator without an error. Any new layout that paginates needs adding to the condition in head.html.

Checked with a local Hugo build against main: every page has exactly one canonical tag, the cross-posted blog posts still point at their original source, and the only other output change is whitespace.

🤖 Generated with Claude Code

Pages without canonical_url had no canonical tag, so Google treats tracking-parameter URLs (?utm_source=..., ?ref=...) as duplicates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jasdeepbhangal-oss
jasdeepbhangal-oss requested a review from a team as a code owner October 12, 2026 10:48
@vercel

vercel Bot commented Oct 12, 2026

Copy link
Copy Markdown

@jasdeepbhangal-oss is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

/blog/2 and the other pager pages took .Permalink, which is page 1. The blog post list moves into a shared partial so head.html and blog-list.html paginate the same collection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
haystack-home Ready Ready Preview Oct 12, 2026 12:10pm UTC

Request Review

@bilgeyucel bilgeyucel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR @jasdeepbhangal-oss!

@bilgeyucel
bilgeyucel merged commit 1697840 into deepset-ai:main Oct 12, 2026
3 of 4 checks passed
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