Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use Astro.site property to generate default canonical urls #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jaredLunde
Copy link

@jaredLunde jaredLunde commented Apr 24, 2024

People are able to define a site URL in their Astro config, which should be preferred as the base URL for the canonical URL if it exists. This is the same URL that Astro itself uses for canonicalizing URLs and generating sitemaps. They strongly recommend setting this property in their config file.

Discrepancies can arise between Astro.url and Astro.site so it is important to use Astro.site if it exists. An example of this is preview websites on Vercel where you don't want the site to be indexed to avoid duplicated content penalties. Astro.url will be set to the preview URL and Astro.site will be set to the canonicalized URL.

See:

@jaredLunde jaredLunde changed the title fix: use Astro.site property to generate canonical urls fix: use Astro.site property to generate default canonical urls Apr 24, 2024
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.

None yet

1 participant