diff options
| author | Yuqian Yang <crupest@crupest.life> | 2026-01-23 23:16:45 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2026-01-23 23:16:45 +0800 |
| commit | 78e3e234877cb10ca1088df31e831b36fa4a12c0 (patch) | |
| tree | a4b86275895b33d47df4686e5ce8f98b57016f90 /www-2/src/layouts/ArticlePage.astro | |
| parent | 3af5ef00b38c6962c6e3f63add0312fa6537b74b (diff) | |
| download | crupest-78e3e234877cb10ca1088df31e831b36fa4a12c0.tar.gz crupest-78e3e234877cb10ca1088df31e831b36fa4a12c0.tar.bz2 crupest-78e3e234877cb10ca1088df31e831b36fa4a12c0.zip | |
HALF WORK!
Diffstat (limited to 'www-2/src/layouts/ArticlePage.astro')
| -rw-r--r-- | www-2/src/layouts/ArticlePage.astro | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/www-2/src/layouts/ArticlePage.astro b/www-2/src/layouts/ArticlePage.astro new file mode 100644 index 0000000..b6ea5d0 --- /dev/null +++ b/www-2/src/layouts/ArticlePage.astro @@ -0,0 +1,50 @@ +--- +import PageBase from "./PageBase.astro"; +import Nav from "../components/Nav.astro"; + +interface Props { + id: string; + data: { + title: string; + date: Date; + lastmod?: Date; + }; +} + +const { + id, + data: { title, date, lastmod }, +} = Astro.props; +--- + +<PageBase> + <Nav /> + <h1 class="post-title">{title}</h1> + <hr /> + <p class="post-info"> + <span class="created">{date.toLocaleString()}</span> | + { + lastmod && ( + <span class="last-updated"> + Last updated: {lastmod.toLocaleString()} + </span> + ) + } + </p> + <slot /> +</PageBase> + +<style> + .post-info { + margin-block: 0; + font-family: monospace; + font-size: 0.95em; + display: flex; + flex-wrap: wrap; + gap: 1em; + + & > .created { + margin-inline-end: auto; + } + } +</style> |
