All checks were successful
Build and deploy website / build (push) Successful in 56s
58 lines
1.4 KiB
Plaintext
58 lines
1.4 KiB
Plaintext
---
|
|
import * as m from "@/paraglide/messages"
|
|
import Layout from "@/layouts/Layout.astro"
|
|
import BadgeList from "@/components/badge/BadgeList.astro"
|
|
import GiteaLink from "@/components/links/GiteaLink.astro"
|
|
import { languageTag } from "@/paraglide/runtime"
|
|
import { getEntry, render } from "astro:content"
|
|
import { Image } from "astro:assets"
|
|
import dayjs from "dayjs"
|
|
import "@/styles/global.css"
|
|
|
|
interface Props {
|
|
project: string // TODO typeof project slug
|
|
}
|
|
|
|
const { project } = Astro.props
|
|
|
|
const entry = await getEntry("projects", project)
|
|
const { Content } = await render(entry!)
|
|
const {
|
|
title,
|
|
description,
|
|
tags,
|
|
heroImage,
|
|
heroImageAlt,
|
|
source,
|
|
createdAt,
|
|
updatedAt,
|
|
} = entry!.data
|
|
|
|
function localeDateString(isoString: string): string {
|
|
return dayjs(isoString).locale(languageTag()).format("YYYY-MM-DD")
|
|
}
|
|
---
|
|
|
|
<Layout title={title} class="mx-auto max-w-[750px]">
|
|
<div class="flex justify-between my-2">
|
|
<div>
|
|
<h2>{title}</h2>
|
|
<BadgeList tags={tags} />
|
|
</div>
|
|
<div class="flex flex-col items-end">
|
|
<p>
|
|
{m.createdAt()}: {localeDateString(createdAt)}
|
|
</p>
|
|
<p>
|
|
{m.updatedAt()}: {localeDateString(updatedAt)}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<Image src={heroImage} alt={heroImageAlt} class="m-auto" />
|
|
|
|
<GiteaLink href={source} class="my-2" />
|
|
|
|
<p class="my-2">{description}</p>
|
|
<Content />
|
|
</Layout>
|