tags pages added

This commit is contained in:
Al Murad Uzzaman
2024-05-17 18:25:14 +06:00
parent c137b8afcd
commit 5c03211dfe
17 changed files with 229 additions and 144 deletions
+13 -10
View File
@@ -3,15 +3,15 @@ import ImageMod from "@/components/ImageMod.astro";
import config from "@/config/config.json";
import Base from "@/layouts/Base.astro";
import { getListPage } from "@/lib/contentParser.astro";
import { supportedLang } from "@/lib/utils/i18nUtils";
import { markdownify } from "@/lib/utils/textConverter";
import CallToAction from "@/partials/CallToAction.astro";
import Testimonial from "@/partials/Testimonial.astro";
import type { Button, Feature } from "@/types";
import type { ContentEntryMap } from "astro:content";
import type { ContentCollectionKey, 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";
const { default_language } = config.settings;
interface Homepage {
banner: {
@@ -31,22 +31,25 @@ export function getStaticPaths() {
}
const { lang } = Astro.params;
const homepage = await getListPage("homepage", lang);
const { banner, features }: Homepage = homepage[0].data;
const homepage: any = await getListPage(
"homepage" as ContentCollectionKey,
lang as keyof ContentEntryMap,
);
const { banner, features } = homepage[0].data;
const testimonial = await getCollection(
(lang as keyof ContentEntryMap) || defaultLang,
(lang as keyof ContentEntryMap) || default_language,
({ id }: any) => {
return id.startsWith("sections/testimonial") && !id.endsWith("-index.md");
}
},
);
const call_to_action = await getCollection(
(lang as keyof ContentEntryMap) || defaultLang,
(lang as keyof ContentEntryMap) || default_language,
({ id }: any) => {
return (
id.startsWith("sections/call-to-action") && !id.endsWith("-index.md")
);
}
},
);
---
@@ -96,7 +99,7 @@ const call_to_action = await getCollection(
<!-- Features -->
{
features.map((feature, index: number) => (
features.map((feature: Feature, index: number) => (
<section class={`section-sm ${index % 2 === 0 && "bg-gradient"}`}>
<div class="container">
<div class="row items-center justify-between">