We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26ce1e4 commit 4b135a2Copy full SHA for 4b135a2
src/layouts/Layout.astro
@@ -19,7 +19,14 @@ const locale = getLocale(Astro.url);
19
const phrases = getPhrases(locale);
20
const title = props.title ? `${props.title} · Auth Wiki` : "Auth Wiki";
21
const description = props.description ?? phrases.site.description;
22
-const canonical = new URL(Astro.url.pathname, Astro.site).href;
+// Needs to remove the file extension from the URL since Astro will add it in production when
23
+// build format is set to "file".
24
+const canonical = new URL(
25
+ Astro.url.pathname.endsWith(".html")
26
+ ? Astro.url.pathname.slice(0, -5)
27
+ : Astro.url.pathname,
28
+ Astro.site,
29
+).href;
30
---
31
32
<!doctype html>
0 commit comments