feat: add updated block to page template

This commit is contained in:
Stefan Imhoff
2025-01-03 09:07:52 +01:00
parent 70ce8c9110
commit c156662f1a
4 changed files with 18 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
--- ---
// Cspell:words astro frontmatter // Cspell:words astro frontmatter
import { dateToFormat, dateToISO } from '../utils';
import { animation, animationDelay } from '../data/site';
import Pullquote from '../components/Pullquote.astro'; import Pullquote from '../components/Pullquote.astro';
import Image from '../components/Image.astro'; import Image from '../components/Image.astro';
import PageTitle from '../components/PageTitle.astro'; import PageTitle from '../components/PageTitle.astro';
@@ -39,5 +42,15 @@ const gridVariant = frontmatter.grid || grid;
) )
} }
<slot /> <slot />
{
frontmatter.updated && (
<footer class="mbs-10" {...animationDelay}>
<b>Last Updated:</b>
<time datetime={dateToISO(frontmatter.updated)}>
{dateToFormat(frontmatter.updated)}
</time>
</footer>
)
}
<slot name="after-content" /> <slot name="after-content" />
</GridLayout> </GridLayout>

View File

@@ -1,6 +1,7 @@
--- ---
layout: ../layouts/PageLayout.astro layout: ../layouts/PageLayout.astro
title: Colophon title: Colophon
updated: 2025-01-03
description: The design and technology behind this website explained. description: The design and technology behind this website explained.
intro: In publishing, a colophon is a brief statement containing information about the publication. intro: In publishing, a colophon is a brief statement containing information about the publication.
backLink: / backLink: /

View File

@@ -1,6 +1,7 @@
--- ---
layout: ../layouts/PageLayout.astro layout: ../layouts/PageLayout.astro
title: Now title: Now
updated: 2025-01-03
description: This is my Now page, listing the things I currently do. description: This is my Now page, listing the things I currently do.
intro: This is my Now page, a website with the content of what I am focused on at this point in my life. intro: This is my Now page, a website with the content of what I am focused on at this point in my life.
backLink: / backLink: /
@@ -12,7 +13,7 @@ export const components = mapping;
<div {...animation}> <div {...animation}>
This is my [Now](https://nownownow.com/) page, an idea by [Derek Silvers](https://sive.rs/) for a website with the focus of <q>what this person is focused on at this point in their life.</q> The concept of a [Now](https://nownownow.com/) page is an idea by [Derek Silvers](https://sive.rs/).
</div> </div>

View File

@@ -1,8 +1,9 @@
--- ---
layout: ../layouts/PageLayout.astro layout: ../layouts/PageLayout.astro
title: Tools title: Tools
updated: 2022-01-03
description: I enjoy learning how other people work, what hardware, software, tools, and gadgets they use. On this page, I present my tools. description: I enjoy learning how other people work, what hardware, software, tools, and gadgets they use. On this page, I present my tools.
intro: I enjoy learning how other people work, what hardware, software, tools, and gadgets they use. On this page, I present my tools. intro: I enjoy learning how other people work, what hardware, software, tools, and gadgets they use. Here, I present my tools.
cover: /assets/images/cover/home-office.webp cover: /assets/images/cover/home-office.webp
backLink: / backLink: /
--- ---