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 { LANGUAGES } from "@config";
import CommonUtils from "@utils/CommonUtils"; import { getBaseUrl } from "@utils";
import type { IPage } from "@interfaces/IPage"; import type { IPage } from "@interfaces/IPage";
/** /**
...@@ -12,7 +12,7 @@ export async function getStaticPaths() { ...@@ -12,7 +12,7 @@ export async function getStaticPaths() {
const rawContent = await Astro.glob<IPage>("../**/*.mdx"); const rawContent = await Astro.glob<IPage>("../**/*.mdx");
const allLocales = LANGUAGES.map((language) => language.locale); const allLocales = LANGUAGES.map((language) => language.locale);
const baseUrl = CommonUtils.getBaseUrl(true); const baseUrl = getBaseUrl(true);
const translatedContent = rawContent.filter((post) => const translatedContent = rawContent.filter((post) =>
Boolean(post.frontmatter.slug) Boolean(post.frontmatter.slug)
...@@ -62,7 +62,6 @@ export async function getStaticPaths() { ...@@ -62,7 +62,6 @@ export async function getStaticPaths() {
} }
}); });
return staticRoutes; return staticRoutes;
} }
...@@ -70,5 +69,7 @@ const { newTarget } = Astro.props; ...@@ -70,5 +69,7 @@ const { newTarget } = Astro.props;
--- ---
<html> <html>
<head><meta http-equiv="refresh" content={`0; url=${newTarget}`} /></head> <head>
<meta http-equiv="refresh" content={`0; url=${newTarget}`} />
</head>
</html> </html>
<script> <script>
import LanguageUtils from "@utils/LanguageUtils"; import { getBaseUrl } from "@utils";
import CommonUtils from "@utils/CommonUtils";
// Redirect user to previously set language preference (or get it from the browser) // Redirect user to previously set language preference (or get it from the browser)
const baseUrl = CommonUtils.getBaseUrl(true); const baseUrl = getBaseUrl(true);
// const preferredLanguage = // const preferredLanguage =
// LanguageUtils.getOrGuessInitialLanguageFromBrowser(); // LanguageUtils.getOrGuessInitialLanguageFromBrowser();
const preferredLanguage = "de"; const preferredLanguage = "de";
window.location.pathname = `${baseUrl}/${preferredLanguage.toLowerCase()}`; window.location.pathname = `${baseUrl}/${preferredLanguage.toLowerCase()}`;
</script> </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