From 5bd179631df6ace845a3b3c3b3c3ef53d9ae192b Mon Sep 17 00:00:00 2001 From: andwati Date: Mon, 31 Aug 2026 08:25:28 +0300 Subject: [PATCH] Compute the footer copyright range from the earliest post's year MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "© 2021-2026 andwati" — start year is the minimum date across all published writings (src/lib/copyright-year.ts), not a hand-maintained config value like the old zola.toml's copyright_start_year. Updates itself automatically both as the year changes and if an older post is ever added. --- apps/site/src/layouts/Base.astro | 4 +++- apps/site/src/lib/copyright-year.ts | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 apps/site/src/lib/copyright-year.ts diff --git a/apps/site/src/layouts/Base.astro b/apps/site/src/layouts/Base.astro index e3bfb90..e26b205 100644 --- a/apps/site/src/layouts/Base.astro +++ b/apps/site/src/layouts/Base.astro @@ -3,6 +3,7 @@ import "@fontsource-variable/fraunces"; import "@fontsource-variable/newsreader"; import "@fontsource/jetbrains-mono"; import "../styles/global.css"; +import { copyrightYearRange } from "../lib/copyright-year"; import { siteConfig } from "../site.config"; interface Props { @@ -14,6 +15,7 @@ interface Props { const { title, description, wide = false } = Astro.props; const metaDescription = description ?? siteConfig.description; const currentPath = Astro.url.pathname; +const copyrightRange = await copyrightYearRange(); --- @@ -131,7 +133,7 @@ const currentPath = Astro.url.pathname;