feat(frontend): prerender canonical URL for subpages#9455
Merged
Conversation
This was referenced Oct 7, 2025
AntonioVentilii
approved these changes
Oct 7, 2025
Collaborator
AntonioVentilii
left a comment
There was a problem hiding this comment.
Thank you! I think it is very worth merging and testing "on the field"
Collaborator
FOLLOW-UPOn this day I tested the following: A robot/crawler (or a direct HTTP request) sees the canonical and og:url on the deep URLs you mentioned.% curl -sL https://oisy.com/explore/ \
| sed -n '1,200p' \
| grep -E 'canonical|og:url'
<link href="https://oisy.com/explore/" rel="canonical" />
<meta content="https://oisy.com/explore/" property="og:url" />
% curl -sL "https://oisy.com/transactions/?token=0xdAC17F958D2ee523a2206206994597C13D831ec7&network=ETH" \
| sed -n '1,200p' \
| grep -E 'canonical|og:url'
<link href="https://oisy.com/transactions/" rel="canonical" />
<meta content="https://oisy.com/transactions/" property="og:url" />
% curl -sL "https://oisy.com/nfts/?nft=iivkv-pakor-uwiaa-aaaaa-buaph-yaqca-aad7b-q&collection=ol244-naaaa-aaaag-qb47a-cai&network=ICP" \
| sed -n '1,200p' \
| grep -E 'canonical|og:url'
<link href="https://oisy.com/nfts/" rel="canonical" />
<meta content="https://oisy.com/nfts/" property="og:url" />True prerendering per route% curl -sL https://oisy.com/ | shasum
curl -sL https://oisy.com/explore/ | shasum
07b6b9d014dbca189b8f49a760af3311e78bf04a -
f19d4cccd00195945eaa326dc52e5ee00d8e7150 -Verify in search consoleI could verify in https://search.google.com/search-console since I am not the owner. The tags are present for crawlers too% curl -A "facebookexternalhit/1.1" -sL https://oisy.com/explore/ |
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.
Motivation
I'm not entirely sure this is a strict requirement for a SPA, even if the pages are prerendered, since each page is behind a login screen and ultimately rendered with JavaScript. However, while reviewing a PR in Internet Identity, it crossed my mind that it might be more accurate to use a canonical URL - and correspondingly an
og:url- that reflects each subpage’s actual path rather than always pointing to the root. So, this PR introduces a similar change to what I just implemented for Juno (PR).Test
I tested the change locally, but it definitely needs to be verified the next time you deploy to any environment.
Notes
I'm really not certain this is necessary, so feel free to reject and close the PR if you don’t think it adds value.
Changes
og:urlafter build