config ln array changed

This commit is contained in:
Al Murad Uzzaman
2024-05-16 17:11:25 +06:00
parent 97d6f22dcb
commit c137b8afcd
24 changed files with 200 additions and 362 deletions
+5 -8
View File
@@ -11,6 +11,7 @@ import type { ContentEntryMap } from "astro:content";
import { getCollection } from "astro:content";
import { FaCheck } from "react-icons/fa";
const { defaultLang } = config.language;
import { supportedLang } from "@/lib/utils/i18nUtils";
interface Homepage {
banner: {
@@ -23,29 +24,25 @@ interface Homepage {
}
export function getStaticPaths() {
const { supported } = config.language;
const paths = supported.map((lang) => ({
const paths = supportedLang.map((lang) => ({
params: { lang: lang || undefined },
}));
return paths;
}
const { lang } = Astro.params;
const homepage = await getListPage("homepage", lang as keyof ContentEntryMap);
// const testimonial = await getEntry("sections", "testimonial");
// const call_to_action = await getEntry("sections", "call-to-action");
const homepage = await getListPage("homepage", lang);
const { banner, features }: Homepage = homepage[0].data;
const testimonial = await getCollection(
(lang as keyof ContentEntryMap) || defaultLang,
({ id }) => {
({ id }: any) => {
return id.startsWith("sections/testimonial") && !id.endsWith("-index.md");
}
);
const call_to_action = await getCollection(
(lang as keyof ContentEntryMap) || defaultLang,
({ id }) => {
({ id }: any) => {
return (
id.startsWith("sections/call-to-action") && !id.endsWith("-index.md")
);