This commit is contained in:
@ -7,19 +7,22 @@ type CustomProps = {
|
||||
layout?: "normal" | "transparent";
|
||||
backlink?: string;
|
||||
};
|
||||
type Props = CollectionEntry<"blog">["data"] & CustomProps;
|
||||
type Props = CollectionEntry<"blog"> & CustomProps;
|
||||
|
||||
const { title, date, _layout, backlink = "/blog" } = Astro.props;
|
||||
const { headings, data } = Astro.props;
|
||||
console.log(Astro.props);
|
||||
const { title, date, links, _layout, backlink = "/blog" } = data;
|
||||
const path = useTranslatedPath(Astro.url);
|
||||
---
|
||||
|
||||
<Layout title={title}>
|
||||
<div
|
||||
class="top-info flex items-center place-content-between opacity-50 m-y-4"
|
||||
class="top-info flex items-center place-content-between opacity-50 m-y-2"
|
||||
>
|
||||
<a class="flex items-center gap-1" href={path(backlink)}
|
||||
><span class="i-tabler-arrow-left"></span> overview</a
|
||||
>
|
||||
|
||||
<div class="date">
|
||||
{
|
||||
date.toLocaleString("en-US", {
|
||||
@ -30,8 +33,31 @@ const path = useTranslatedPath(Astro.url);
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<article class={`layout-${_layout} flex flex-col gap-2`}>
|
||||
<h1 class="text-4xl my-4">{title}</h1>
|
||||
<article class={`layout-${_layout} flex flex-col gap-4`}>
|
||||
<div class="mb-4 flex flex-col gap-4">
|
||||
<h1 class="text-4xl">
|
||||
{title}
|
||||
</h1>
|
||||
|
||||
<div class="toc"></div>
|
||||
|
||||
{
|
||||
links?.length && (
|
||||
<div class="flex gap-4">
|
||||
{links.map(([title, url]: string[]) => (
|
||||
<a href={url} class="flex external items-center gap-[4px]">
|
||||
{title}
|
||||
{title === "git" ? (
|
||||
<span class="i-tabler-brand-git w-4 h-4" />
|
||||
) : (
|
||||
<span class="i-tabler-external-link w-4 h-3" />
|
||||
)}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
<slot />
|
||||
</article>
|
||||
</Layout>
|
||||
|
Reference in New Issue
Block a user