2024-09-25 22:20:47 +02:00
|
|
|
---
|
2024-10-06 11:41:27 +02:00
|
|
|
import Layout from "@/layouts/Layout.astro"
|
2025-02-15 19:25:44 +01:00
|
|
|
import BadgeList from "@/components/badge/BadgeList.astro"
|
|
|
|
import GiteaLink from "@/components/links/GiteaLink.astro"
|
2025-02-15 23:00:38 +01:00
|
|
|
import { languageTag } from "@/paraglide/runtime"
|
|
|
|
import { getEntry, render } from "astro:content"
|
|
|
|
import { Image } from "astro:assets"
|
|
|
|
import * as m from "@/paraglide/messages"
|
2024-10-06 11:41:27 +02:00
|
|
|
import "@/styles/global.css"
|
2024-09-25 22:20:47 +02:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
project: string // TODO typeof project slug
|
|
|
|
}
|
|
|
|
|
|
|
|
const { project } = Astro.props
|
|
|
|
|
|
|
|
const entry = await getEntry("projects", project)
|
2025-01-19 20:07:26 +01:00
|
|
|
const { Content } = await render(entry!)
|
2024-09-25 22:20:47 +02:00
|
|
|
const {
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
tags,
|
|
|
|
heroImage,
|
|
|
|
heroImageAlt,
|
|
|
|
source,
|
|
|
|
createdAt,
|
2025-02-15 14:59:32 +01:00
|
|
|
updatedAt,
|
2024-09-25 22:20:47 +02:00
|
|
|
} = entry!.data
|
|
|
|
---
|
|
|
|
|
2025-02-15 19:25:44 +01:00
|
|
|
<!--TODO day.js / Temporal API for dates?-->
|
2025-02-16 11:49:06 +01:00
|
|
|
<Layout title={title} class="mx-auto max-w-[750px]">
|
2024-09-25 22:20:47 +02:00
|
|
|
<div class="flex justify-between my-2">
|
|
|
|
<div>
|
2025-02-15 23:00:38 +01:00
|
|
|
<h2>{title}</h2>
|
2024-09-25 22:20:47 +02:00
|
|
|
<BadgeList tags={tags} />
|
|
|
|
</div>
|
|
|
|
<div class="flex flex-col items-end">
|
|
|
|
<p>
|
|
|
|
{m.createdAt()}: {new Date(createdAt).toLocaleDateString(languageTag())}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{m.updatedAt()}: {new Date(updatedAt).toLocaleDateString(languageTag())}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2025-02-15 19:25:44 +01:00
|
|
|
<Image src={heroImage} alt={heroImageAlt} class="m-auto" />
|
2024-09-25 22:20:47 +02:00
|
|
|
|
2025-02-16 11:49:06 +01:00
|
|
|
<GiteaLink href={source} class="my-2" />
|
2024-09-25 22:20:47 +02:00
|
|
|
|
|
|
|
<p class="my-2">{description}</p>
|
|
|
|
<Content />
|
|
|
|
</Layout>
|