Skip to content

Commit

Permalink
feat: handle URL edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tobySolutions committed Oct 16, 2024
1 parent e128800 commit 832c375
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/layouts/BaseHtml.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const { ogMeta } = Astro.props;
const baseUrl = getSiteUrl();
const hasSecondaryMenu = hasSecondaryMenuItem(Astro.url.pathname);
const canonicalUrl = generateCanonicalUrl(baseUrl, ogMeta?.slug);
const contentSlug = ogMeta?.slug || Astro.url.pathname;
const canonicalUrl = generateCanonicalUrl(baseUrl, contentSlug);
---

<!doctype html>
Expand Down

0 comments on commit 832c375

Please sign in to comment.