Skip to content

feat(frontend): prerender canonical URL for subpages#7401

Open
peterpeterparker wants to merge 3 commits intomainfrom
feat/canonical-subpages
Open

feat(frontend): prerender canonical URL for subpages#7401
peterpeterparker wants to merge 3 commits intomainfrom
feat/canonical-subpages

Conversation

@peterpeterparker
Copy link
Member

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) and OISY (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

  • Added a script to update the canonical and og:url after build
  • Chained the script in the post-process step before calculating the CSP

Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
peterpeterparker and others added 2 commits October 7, 2025 20:50
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