mirror of
https://github.com/10h30/astroplate.git
synced 2026-06-05 15:08:00 +09:00
i18nUtils renamed with languageParser
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"main": [
|
||||
{ "name": "الرئيسية", "url": "/" },
|
||||
{ "name": "نبذة عنا", "url": "/about" },
|
||||
{ "name": "العناصر", "url": "/elements" },
|
||||
{
|
||||
"name": "Pages",
|
||||
"url": "",
|
||||
"hasChildren": true,
|
||||
"children": [
|
||||
{ "name": "اتصل بنا", "url": "/contact" },
|
||||
{ "name": "المدونة", "url": "/blog" },
|
||||
{ "name": "المؤلفون", "url": "/authors" },
|
||||
{ "name": "التصنيفات", "url": "/categories" },
|
||||
{ "name": "العلامات", "url": "/tags" },
|
||||
{ "name": "صفحة 404", "url": "/404" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"footer": [
|
||||
{ "name": "العناصر", "url": "/elements" },
|
||||
{ "name": "سياسة الخصوصية", "url": "/privacy-policy" }
|
||||
]
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import Share from "@/components/Share.astro";
|
||||
import config from "@/config/config.json";
|
||||
import Disqus from "@/helpers/Disqus";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import dateFormat from "@/lib/utils/dateFormat";
|
||||
import { slugSelector } from "@/lib/utils/languageParser";
|
||||
import similarItems from "@/lib/utils/similarItems";
|
||||
import { humanize, markdownify, slugify } from "@/lib/utils/textConverter";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import { getLangFromUrl } from "@/lib/utils/i18nUtils";
|
||||
import { getLangFromUrl, slugSelector } from "@/lib/utils/languageParser";
|
||||
import { plainify } from "@/lib/utils/textConverter";
|
||||
import ImageMod from "./ImageMod.astro";
|
||||
import Social from "./Social.astro";
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
---
|
||||
import config from "@/config/config.json";
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import dateFormat from "@/lib/utils/dateFormat";
|
||||
import { getLangFromUrl, getTranslations } from "@/lib/utils/i18nUtils";
|
||||
import {
|
||||
getLangFromUrl,
|
||||
getTranslations,
|
||||
slugSelector,
|
||||
} from "@/lib/utils/languageParser";
|
||||
import { humanize, plainify, slugify } from "@/lib/utils/textConverter";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
import { FaRegFolder, FaRegUserCircle } from "react-icons/fa";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import { humanize } from "@/lib/utils/textConverter";
|
||||
|
||||
const { className }: { className?: string } = Astro.props;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
---
|
||||
import config from "@/config/config.json";
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import { getLangFromUrl } from "@/lib/utils/i18nUtils";
|
||||
import ImageMod from "./ImageMod.astro";
|
||||
import { getLangFromUrl, slugSelector } from "@/lib/utils/languageParser";
|
||||
|
||||
const { src, srcDarkmode }: { src?: string; srcDarkmode?: string } =
|
||||
Astro.props;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import { getLangFromUrl } from "@/lib/utils/i18nUtils";
|
||||
import { getLangFromUrl, slugSelector } from "@/lib/utils/languageParser";
|
||||
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
|
||||
|
||||
@@ -3,8 +3,11 @@ import Logo from "@/components/Logo.astro";
|
||||
import Social from "@/components/Social.astro";
|
||||
import config from "@/config/config.json";
|
||||
import social from "@/config/social.json";
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import { getLangFromUrl, getTranslations } from "@/lib/utils/i18nUtils";
|
||||
import {
|
||||
getLangFromUrl,
|
||||
getTranslations,
|
||||
slugSelector,
|
||||
} from "@/lib/utils/languageParser";
|
||||
import { markdownify } from "@/lib/utils/textConverter";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ import ThemeSwitcher from "@/components/ThemeSwitcher.astro";
|
||||
import config from "@/config/config.json";
|
||||
import languages from "@/config/language.json";
|
||||
import LanguageSwitcher from "@/helpers/LanguageSwitcher";
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import { getLangFromUrl, getTranslations } from "@/lib/utils/i18nUtils";
|
||||
import { getLangFromUrl, getTranslations, slugSelector } from "@/lib/utils/languageParser";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
import { IoSearch } from "react-icons/io5";
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import { getLangFromUrl } from "@/lib/utils/i18nUtils";
|
||||
import { getLangFromUrl, slugSelector } from "@/lib/utils/languageParser";
|
||||
import { humanize } from "@/lib/utils/textConverter";
|
||||
|
||||
const { tags, categories, allCategories } = Astro.props;
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
import config from "../../config/config.json";
|
||||
import languagesJSON from "../../config/language.json";
|
||||
import { getRelativeLocaleUrl } from "astro:i18n";
|
||||
const { default_language } = config.settings;
|
||||
|
||||
const locales: { [key: string]: any } = {};
|
||||
|
||||
// Load menu and dictionary dynamically
|
||||
languagesJSON.forEach((language) => {
|
||||
const { languageCode } = language;
|
||||
import(`../../config/menu.${languageCode}.json`).then((menu) => {
|
||||
import(`../../i18n/${languageCode}.json`).then((dictionary) => {
|
||||
locales[languageCode] = { ...menu, ...dictionary };
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Extract all languages from the locales object
|
||||
const languages = Object.keys(locales);
|
||||
|
||||
// Export the locales and languages
|
||||
export { languages, locales };
|
||||
|
||||
export function getLangFromUrl(url: URL): string {
|
||||
const [, lang] = url.pathname.split("/");
|
||||
if (locales.hasOwnProperty(lang)) {
|
||||
return lang;
|
||||
}
|
||||
return default_language;
|
||||
}
|
||||
|
||||
export const getTranslations = async (lang: string) => {
|
||||
const {
|
||||
default_language,
|
||||
disable_languages,
|
||||
}: { default_language: string; disable_languages: string[] } =
|
||||
config.settings;
|
||||
|
||||
if (disable_languages.includes(lang)) {
|
||||
lang = default_language;
|
||||
}
|
||||
|
||||
let language = languagesJSON.find((l) => l.languageCode === lang);
|
||||
|
||||
if (!language) {
|
||||
lang = default_language;
|
||||
language = languagesJSON.find((l) => l.languageCode === default_language);
|
||||
}
|
||||
|
||||
if (!language) {
|
||||
throw new Error("Default language not found");
|
||||
}
|
||||
|
||||
const contentDir = language.contentDir;
|
||||
|
||||
let menu, dictionary;
|
||||
try {
|
||||
menu = await import(`../../config/menu.${lang}.json`);
|
||||
dictionary = await import(`../../i18n/${lang}.json`);
|
||||
} catch (error) {
|
||||
menu = await import(`../../config/menu.${default_language}.json`);
|
||||
dictionary = await import(`../../i18n/${default_language}.json`);
|
||||
}
|
||||
|
||||
return { ...menu.default, ...dictionary.default, contentDir };
|
||||
};
|
||||
|
||||
export const constructUrl = (
|
||||
url: string,
|
||||
lang: string,
|
||||
default_language: string,
|
||||
trailing_slash: boolean,
|
||||
) => {
|
||||
let constructedUrl;
|
||||
if (url === "/") {
|
||||
constructedUrl = lang === default_language ? "/" : `/${lang}`;
|
||||
} else {
|
||||
constructedUrl = getRelativeLocaleUrl(lang, url, {
|
||||
normalizeLocale: false,
|
||||
});
|
||||
}
|
||||
if (trailing_slash) {
|
||||
if (!constructedUrl.endsWith("/")) {
|
||||
constructedUrl += "/";
|
||||
}
|
||||
} else {
|
||||
if (constructedUrl.endsWith("/")) {
|
||||
constructedUrl = constructedUrl.slice(0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure home URL is absolute
|
||||
if (constructedUrl === "") {
|
||||
constructedUrl = "/";
|
||||
}
|
||||
|
||||
return constructedUrl;
|
||||
};
|
||||
|
||||
const supportedLang = ["", ...languagesJSON.map((lang) => lang.languageCode)];
|
||||
const disabledLanguages = config.settings.disable_languages as string[];
|
||||
|
||||
// Filter out disabled languages from supportedLang
|
||||
const filteredSupportedLang = supportedLang.filter(
|
||||
(lang) => !disabledLanguages.includes(lang),
|
||||
);
|
||||
|
||||
export { filteredSupportedLang as supportedLang };
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
import config from "@/config/config.json";
|
||||
import languagesJSON from "@/config/language.json";
|
||||
import { getRelativeLocaleUrl } from "astro:i18n";
|
||||
import config from "../../config/config.json";
|
||||
import languagesJSON from "../../config/language.json";
|
||||
const { default_language } = config.settings;
|
||||
|
||||
const locales: { [key: string]: any } = {};
|
||||
@@ -69,8 +68,9 @@ export const getTranslations = async (lang: string) => {
|
||||
const supportedLang = ["", ...languagesJSON.map((lang) => lang.languageCode)];
|
||||
const disabledLanguages = config.settings.disable_languages as string[];
|
||||
|
||||
// Filter out disabled languages from supportedLang
|
||||
const filteredSupportedLang = supportedLang.filter(
|
||||
(lang) => !disabledLanguages.includes(lang)
|
||||
(lang) => !disabledLanguages.includes(lang),
|
||||
);
|
||||
|
||||
export { filteredSupportedLang as supportedLang };
|
||||
@@ -115,4 +115,3 @@ export const slugSelector = (url: string, lang: string) => {
|
||||
|
||||
return constructedUrl;
|
||||
};
|
||||
---
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
---
|
||||
import config from "@/config/config.json";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import {
|
||||
getLangFromUrl,
|
||||
getTranslations,
|
||||
supportedLang,
|
||||
} from "@/lib/utils/i18nUtils";
|
||||
slugSelector,
|
||||
} from "@/lib/utils/languageParser";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
|
||||
export function getStaticPaths() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
|
||||
@@ -19,7 +19,7 @@ export async function getStaticPaths() {
|
||||
page,
|
||||
},
|
||||
}));
|
||||
}),
|
||||
})
|
||||
);
|
||||
return paths.flat();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import ImageMod from "@/components/ImageMod.astro";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getListPage } from "@/lib/contentParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import { markdownify } from "@/lib/utils/textConverter";
|
||||
import type { ContentCollectionKey, ContentEntryMap } from "astro:content";
|
||||
|
||||
@@ -16,7 +16,7 @@ export function getStaticPaths() {
|
||||
const { lang } = Astro.params;
|
||||
const about: any = await getListPage(
|
||||
"about" as ContentCollectionKey,
|
||||
lang as keyof ContentEntryMap,
|
||||
lang as keyof ContentEntryMap
|
||||
);
|
||||
|
||||
const { Content } = await about[0].render();
|
||||
|
||||
@@ -4,7 +4,7 @@ import ImageMod from "@/components/ImageMod.astro";
|
||||
import Social from "@/components/Social.astro";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import { slugify } from "@/lib/utils/textConverter";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
|
||||
@@ -14,12 +14,12 @@ export async function getStaticPaths() {
|
||||
|
||||
const paths = await Promise.all(
|
||||
supportedLang.map(async (lang) => {
|
||||
const authors = await getSinglePage(
|
||||
const authors: any = await getSinglePage(
|
||||
COLLECTION_FOLDER,
|
||||
lang as keyof ContentEntryMap
|
||||
);
|
||||
|
||||
return authors.map((author) => ({
|
||||
return authors.map((author: any) => ({
|
||||
params: {
|
||||
lang: lang || undefined,
|
||||
single: author.slug.split("/").pop(),
|
||||
@@ -42,7 +42,7 @@ const { Content } = await author.render();
|
||||
const BLOG_FOLDER = "blog";
|
||||
const posts = await getSinglePage(BLOG_FOLDER, lang as keyof ContentEntryMap);
|
||||
const postFilterByAuthor = posts.filter(
|
||||
(post) => slugify(post.data.author) === slugify(title)
|
||||
(post: any) => slugify(post.data.author) === slugify(title)
|
||||
);
|
||||
---
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import AuthorCard from "@/components/AuthorCard.astro";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getListPage, getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import { type ContentEntryMap } from "astro:content";
|
||||
|
||||
@@ -18,11 +18,11 @@ export function getStaticPaths() {
|
||||
const { lang } = Astro.params;
|
||||
const authorIndex: any = await getListPage(
|
||||
COLLECTION_FOLDER,
|
||||
lang as keyof ContentEntryMap,
|
||||
lang as keyof ContentEntryMap
|
||||
);
|
||||
const authors = await getSinglePage(
|
||||
COLLECTION_FOLDER,
|
||||
lang as keyof ContentEntryMap,
|
||||
lang as keyof ContentEntryMap
|
||||
);
|
||||
---
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import PostSingle from "@/layouts/PostSingle.astro";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import config from "@/config/config.json";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getListPage, getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import { sortByDate } from "@/lib/utils/sortFunctions";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import PostSidebar from "@/partials/PostSidebar.astro";
|
||||
|
||||
@@ -5,7 +5,7 @@ import config from "@/config/config.json";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getListPage, getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import { sortByDate } from "@/lib/utils/sortFunctions";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import PostSidebar from "@/partials/PostSidebar.astro";
|
||||
@@ -21,16 +21,16 @@ if (!lang) {
|
||||
|
||||
const postIndex: any = await getListPage(
|
||||
BLOG_FOLDER,
|
||||
lang as keyof ContentEntryMap,
|
||||
lang as keyof ContentEntryMap
|
||||
);
|
||||
const posts = await getSinglePage(BLOG_FOLDER, lang as keyof ContentEntryMap);
|
||||
const allCategories = await getAllTaxonomy(
|
||||
lang as keyof ContentEntryMap,
|
||||
"categories",
|
||||
"categories"
|
||||
);
|
||||
const categories = await getTaxonomy(
|
||||
lang as keyof ContentEntryMap,
|
||||
"categories",
|
||||
"categories"
|
||||
);
|
||||
const tags = await getTaxonomy(lang as keyof ContentEntryMap, "tags");
|
||||
const sortedPosts = sortByDate(posts);
|
||||
@@ -47,7 +47,7 @@ export async function getStaticPaths() {
|
||||
supportedLang.map(async (lang) => {
|
||||
const posts = await getSinglePage(
|
||||
BLOG_FOLDER,
|
||||
lang as keyof ContentEntryMap,
|
||||
lang as keyof ContentEntryMap
|
||||
);
|
||||
const totalPages = Math.ceil(posts.length / config.settings.pagination);
|
||||
const langString = lang.toString();
|
||||
@@ -63,7 +63,7 @@ export async function getStaticPaths() {
|
||||
}
|
||||
|
||||
return langPaths;
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
return paths.flat();
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
---
|
||||
import BlogCard from "@/components/BlogCard.astro";
|
||||
import config from "@/config/config.json";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import { sortByDate } from "@/lib/utils/sortFunctions";
|
||||
import taxonomyFilter from "@/lib/utils/taxonomyFilter";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
import config from "@/config/config.json";
|
||||
|
||||
// get all static paths for categories
|
||||
export async function getStaticPaths() {
|
||||
@@ -18,7 +18,7 @@ export async function getStaticPaths() {
|
||||
supportedLang.map(async (lang) => {
|
||||
const categories = await getTaxonomy(
|
||||
lang as keyof ContentEntryMap,
|
||||
"categories",
|
||||
"categories"
|
||||
);
|
||||
|
||||
return categories.map((category) => ({
|
||||
@@ -30,13 +30,13 @@ export async function getStaticPaths() {
|
||||
category,
|
||||
},
|
||||
}));
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
// Handle default path (no lang)
|
||||
const defaultCategories = await getTaxonomy(
|
||||
default_language as keyof ContentEntryMap,
|
||||
"categories",
|
||||
"categories"
|
||||
);
|
||||
const defaultPaths = defaultCategories.map((category) => ({
|
||||
params: {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
import config from "@/config/config.json";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { slugSelector, supportedLang } from "@/lib/utils/languageParser";
|
||||
import { humanize } from "@/lib/utils/textConverter";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import config from "@/config/config.json";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getListPage } from "@/lib/contentParser.astro";
|
||||
import { getTranslations, supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { getTranslations, supportedLang } from "@/lib/utils/languageParser";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import type { CollectionKey } from "astro:content";
|
||||
import { type ContentEntryMap } from "astro:content";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import ImageMod from "@/components/ImageMod.astro";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getListPage, getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import { markdownify } from "@/lib/utils/textConverter";
|
||||
import CallToAction from "@/partials/CallToAction.astro";
|
||||
import Testimonial from "@/partials/Testimonial.astro";
|
||||
|
||||
@@ -4,7 +4,7 @@ import config from "@/config/config.json";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { supportedLang } from "@/lib/utils/languageParser";
|
||||
import { sortByDate } from "@/lib/utils/sortFunctions";
|
||||
import taxonomyFilter from "@/lib/utils/taxonomyFilter";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
@@ -27,13 +27,13 @@ export async function getStaticPaths() {
|
||||
tag,
|
||||
},
|
||||
}));
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
// Handle default path (no lang)
|
||||
const defaultCategories = await getTaxonomy(
|
||||
default_language as keyof ContentEntryMap,
|
||||
"tags",
|
||||
"tags"
|
||||
);
|
||||
const defaultPaths = defaultCategories.map((tag) => ({
|
||||
params: {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
import config from "@/config/config.json";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { slugSelector } from "@/lib/languageParser.astro";
|
||||
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import { supportedLang } from "@/lib/utils/i18nUtils";
|
||||
import { slugSelector, supportedLang } from "@/lib/utils/languageParser";
|
||||
import { humanize } from "@/lib/utils/textConverter";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import type { ContentEntryMap } from "astro:content";
|
||||
|
||||
Reference in New Issue
Block a user