mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-19 06:33:33 +09:00
config ln array changed
This commit is contained in:
@@ -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")
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user