blog/src/article.tsx

29 lines
819 B
TypeScript
Raw Normal View History

import { Document } from "asciidoctor";
import { DateTime } from "luxon";
2024-06-24 17:31:11 +00:00
import { asset } from "../lib/assets.js";
type Props = {
article: Document;
date: DateTime;
body: string;
};
2024-06-24 17:31:11 +00:00
export default ({ article, date, body }: Props) => (
<>
<nav>
<a href="/" title="Back to home page">
<img src={asset("avatar.avif")} alt="Adædra's avatar" />
Adædra
</a>
</nav>
<article>
<header class="article-header">
{date.toLocaleString(DateTime.DATE_FULL)}
<h1 dangerouslySetInnerHTML={{ __html: article.getDocumentTitle() as string }} />
</header>
<a name="content" />
<main dangerouslySetInnerHTML={{ __html: body }} />
</article>
</>
);