disabled ln fn added

This commit is contained in:
Al Murad Uzzaman
2024-05-19 14:01:35 +06:00
parent 4df29fbf63
commit e2338efc6b
10 changed files with 127 additions and 85 deletions
+9 -1
View File
@@ -25,7 +25,15 @@ const { theme_switcher }: { theme_switcher: boolean } = config.settings;
const { default_language } = config.settings;
const { trailing_slash } = config.site;
const lang = getLangFromUrl(Astro.url);
let lang = getLangFromUrl(Astro.url);
// Check if the current language is disabled
const disabledLanguages = config.settings.disable_languages as string[];
if (disabledLanguages.includes(lang)) {
// Redirect to the default language or handle as per your application logic
lang = default_language;
}
const url = constructUrl("/", lang, default_language, trailing_slash);
---