mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: google crawler
This commit is contained in:
1 parent
2ef6d18f82
commit
c964e3c8ec
2 files changed
+5
-3
No files matched your search
@@ -39,7 +39,11 @@ const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||
window.location.pathname.startsWith(`/${locale}`),
|
||||
);
|
||||
|
||||
if (!isAPI && bestLocale !== currentPathLocale) {
|
||||
if (
|
||||
!isAPI && // not an api, duh!
|
||||
localStorage.getItem('preferred-locale') !== null && // no preference, so probably google's crawler
|
||||
bestLocale !== currentPathLocale // we need to redirect
|
||||
) {
|
||||
window.location.pathname = isI18nPath
|
||||
? window.location.pathname.replace(
|
||||
`/${currentPathLocale}`,
|
||||
|
||||
Reference in new issue
Block a user