Skip to content
Snippets Groups Projects
Commit 81e5480f authored by Moritz Stückler's avatar Moritz Stückler :cowboy:
Browse files

fix: missing update from old repo

parent cdd840e5
No related branches found
No related tags found
No related merge requests found
Pipeline #5944 passed
---
import { LANGUAGES } from "@config";
import CommonUtils from "@utils/CommonUtils";
import { getBaseUrl } from "@utils";
import type { IPage } from "@interfaces/IPage";
/**
......@@ -12,7 +12,7 @@ export async function getStaticPaths() {
const rawContent = await Astro.glob<IPage>("../**/*.mdx");
const allLocales = LANGUAGES.map((language) => language.locale);
const baseUrl = CommonUtils.getBaseUrl(true);
const baseUrl = getBaseUrl(true);
const translatedContent = rawContent.filter((post) =>
Boolean(post.frontmatter.slug)
......@@ -62,7 +62,6 @@ export async function getStaticPaths() {
}
});
return staticRoutes;
}
......@@ -70,5 +69,7 @@ const { newTarget } = Astro.props;
---
<html>
<head><meta http-equiv="refresh" content={`0; url=${newTarget}`} /></head>
<head>
<meta http-equiv="refresh" content={`0; url=${newTarget}`} />
</head>
</html>
<script>
import LanguageUtils from "@utils/LanguageUtils";
import CommonUtils from "@utils/CommonUtils";
import { getBaseUrl } from "@utils";
// Redirect user to previously set language preference (or get it from the browser)
const baseUrl = CommonUtils.getBaseUrl(true);
const baseUrl = getBaseUrl(true);
// const preferredLanguage =
// LanguageUtils.getOrGuessInitialLanguageFromBrowser();
const preferredLanguage = "de";
window.location.pathname = `${baseUrl}/${preferredLanguage.toLowerCase()}`;
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment