🐛 Fix bad canonical url

This commit is contained in:
Luke Vella 2023-08-07 09:47:41 +01:00
parent 951a3e2ebc
commit 934d321f5d

View file

@ -44,7 +44,7 @@ const MyApp: NextPage<AppPropsWithLayout> = ({ Component, pageProps }) => {
}, []);
const canonicalUrl = React.useMemo(() => {
const path = router.pathname === "/" ? "" : router.pathname;
const path = router.asPath === "/" ? "" : router.asPath;
if (router.locale === router.defaultLocale) {
return absoluteUrl(path);
} else {