From fd5998240f65e3bc3a94e4045f8f5c286a755b1c Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Tue, 15 Apr 2025 07:52:17 +0100 Subject: displays date on news items --- src/components/NewsIndex/NewsPreviewLink.astro | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/NewsIndex/NewsPreviewLink.astro b/src/components/NewsIndex/NewsPreviewLink.astro index fa01d8d..5b8153c 100644 --- a/src/components/NewsIndex/NewsPreviewLink.astro +++ b/src/components/NewsIndex/NewsPreviewLink.astro @@ -2,7 +2,7 @@ import translate from '$i18n/translate'; import tComponent from '$i18n/translations/components/newsIndex'; import { getLocaleFromPathOrThrow } from '$lib/getLocaleFromPath'; -import { getHref } from '$lib/newsUtils'; +import { getDate, getHref } from '$lib/newsUtils'; import type { CollectionEntry } from 'astro:content'; interface Props { @@ -13,6 +13,8 @@ interface Props { const { headingLevel, newsItem } = Astro.props; const locale = getLocaleFromPathOrThrow(Astro.url.pathname); const t = translate(locale); + +const publicationDate = getDate(newsItem); --- @@ -22,5 +24,14 @@ const t = translate(locale); `} />

{newsItem.data.summary}

+
-- cgit v1.2.3