feat: add madeira blog post upgrade astro
Some checks failed
Deploy to SFTP Server / build (push) Failing after 5m43s
Some checks failed
Deploy to SFTP Server / build (push) Failing after 5m43s
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user