feat: add some stuff

This commit is contained in:
2024-03-28 18:30:52 +01:00
parent 31b24de86c
commit d4128840b9
196 changed files with 3393 additions and 390 deletions

View File

@ -4,16 +4,20 @@ import Layout from "./Layout.astro";
import { useTranslatedPath } from "@i18n/utils";
import { getLocale } from "astro-i18n-aut";
type Props = CollectionEntry<"blog">["data"];
type CustomProps = {
layout?: "normal" | "transparent";
backlink?: string;
};
type Props = CollectionEntry<"blog">["data"] & CustomProps;
const { title, date } = Astro.props;
const path = useTranslatedPath(getLocale(Astro.url));
const { title, date, _layout = "normal", backlink = "/blog" } = Astro.props;
const path = useTranslatedPath(Astro);
---
<Layout title={title}>
<article>
<article class={`layout-${_layout}`}>
<div class="top-info">
<a href={path("/blog")}>← overview</a>
<a href={path(backlink)}>← overview</a>
<div class="date">
{
date.toLocaleString("en-US", {
@ -35,6 +39,9 @@ const path = useTranslatedPath(getLocale(Astro.url));
display: flex;
flex-direction: column;
gap: 10px;
}
article.layout-transparent {
padding: 20px;
background: var(--background);
}
@ -51,13 +58,4 @@ const path = useTranslatedPath(getLocale(Astro.url));
text-decoration: none;
color: var(--outline);
}
article :global(p) {
margin-top: 1em;
margin-bottom: 1em;
}
article :global(img) {
margin-bottom: 2em;
}
</style>