feat: add madeira blog post upgrade astro
Some checks failed
Deploy to SFTP Server / build (push) Failing after 5m43s

This commit is contained in:
2025-02-16 15:33:45 +01:00
parent dccd816f6e
commit 4c3e35efbf
48 changed files with 2839 additions and 3235 deletions

View File

@@ -3,18 +3,14 @@ import markdownToText from "@helpers/markdownToText";
import { Card } from "./card";
import { useTranslatedPath, useTranslations } from "@i18n/utils";
import Image from "@components/Image.astro";
import type { ImageMetadata } from "astro";
import type { InferEntrySchema } from "astro:content";
interface Props {
post: {
data: {
title: string;
icon?: string;
cover?: ImageMetadata;
};
data: InferEntrySchema<"projects">;
collection: string;
slug: string;
body: string;
id: string;
body?: string;
};
}
@@ -22,13 +18,13 @@ const {
data: { title, cover, icon },
collection,
body,
slug,
id,
} = Astro.props.post;
const translatePath = useTranslatedPath(Astro.url);
const t = useTranslations(Astro.url);
const link = translatePath(`/${collection}/${slug.split("/")[0]}`);
const link = translatePath(`/${collection}/${id.split("/")[0]}`);
---
<Card
@@ -39,7 +35,7 @@ const link = translatePath(`/${collection}/${slug.split("/")[0]}`);
{title}
</Card.Title>
<Card.Description>
{markdownToText(body).slice(0, 200)}
{markdownToText(body ?? "").slice(0, 200)}
</Card.Description>
<Card.ReadMoreButton link={link} text={t("read-more")} />
</Card.Content>