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

Create "Astro.url" & Deprecate "Astro.canonicalURL" #232

Merged
merged 6 commits into from
Jul 20, 2022

Conversation

FredKSchott
Copy link
Member

@FredKSchott FredKSchott commented Jul 18, 2022

Summary

Create a general-purpose Astro.url helper. Deprecate Astro.canonicalURL to use Astro.url instead.

// Before:
const currentPathname = new URL(Astro.request.url).pathname;
const canonicalURL = Astro.canonicalURL;

// After:
const currentPathname = Astro.url.pathname;
const canonicalURL = new URL(Astro.url.pathname, Astro.site);

Links

@FredKSchott
Copy link
Member Author

FredKSchott commented Jul 18, 2022

We're getting close to the Astro v1.0 RC, so would appreciate quick reviews from anyone reading, especially from @withastro/tsc. Thanks!

@FredKSchott FredKSchott changed the title Create Astro.url helper, replace/rename Astro.canonicalURL Create "Astro.url" & Deprecate "Astro.canonicalURL" Jul 18, 2022
@FredKSchott FredKSchott merged commit 50d299e into main Jul 20, 2022
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