feat: add some stuff
This commit is contained in:
@@ -1,8 +1,54 @@
|
||||
---
|
||||
import Layout from "@layouts/Layout.astro";
|
||||
import Max from "@components/Max.astro";
|
||||
import { Card } from "@components/card";
|
||||
import { getCollection } from "astro:content";
|
||||
import { filterCollection, useTranslatedPath } from "@i18n/utils";
|
||||
import markdownToText from "@helpers/markdownToText";
|
||||
import { getLocale } from "astro-i18n-aut";
|
||||
|
||||
const projects = filterCollection(
|
||||
await getCollection("projects"),
|
||||
getLocale(Astro.url),
|
||||
);
|
||||
|
||||
const translatePath = useTranslatedPath(Astro);
|
||||
|
||||
const locale = getLocale(Astro.url);
|
||||
|
||||
const projectSlides = await Promise.all(
|
||||
projects.map(async (project) => ({
|
||||
title: project.data.title,
|
||||
description: markdownToText(project.body),
|
||||
image: project.data.headerImg,
|
||||
link: translatePath(project.slug),
|
||||
})),
|
||||
);
|
||||
|
||||
const featuredProject = projects.find((project) => project.data?.featured);
|
||||
---
|
||||
|
||||
<Layout title="dude">
|
||||
<Layout title="Max Richter">
|
||||
<Max />
|
||||
{
|
||||
featuredProject && (
|
||||
<Card classes="flex overflow-hidden gradient border-1 border-light">
|
||||
<Card.Content classes="p-8">
|
||||
<Card.Title>{featuredProject.data.title}</Card.Title>
|
||||
<Card.Description>
|
||||
{markdownToText(featuredProject.body).slice(0, 200)}
|
||||
</Card.Description>
|
||||
<Card.ReadMoreButton
|
||||
link={translatePath(
|
||||
`/projects/${featuredProject.slug.split("/")[0]}`,
|
||||
)}
|
||||
/>
|
||||
</Card.Content>
|
||||
<Card.Image
|
||||
src={featuredProject.data.headerImg}
|
||||
alt={featuredProject.data.title}
|
||||
/>
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
</Layout>
|
||||
|
Reference in New Issue
Block a user