mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +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
@@ -11,8 +11,6 @@ const gameDefinitions = await fetchGameDefinitions();
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
||||
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||
const strings = getStrings(locale);
|
||||
|
||||
console.log(`DEBUG: ${gameDefinitions.version}`);
|
||||
---
|
||||
|
||||
<style>
|
||||
|
||||
@@ -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