From 8dd3185b2548c83dbf31324452b3b410408ab4dd Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Tue, 15 Aug 2023 19:19:51 +0100 Subject: Parametrises heading level in NewsPreviewLink --- src/components/NewsPreviewLink.astro | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/NewsPreviewLink.astro b/src/components/NewsPreviewLink.astro index 566f136..8486fe7 100644 --- a/src/components/NewsPreviewLink.astro +++ b/src/components/NewsPreviewLink.astro @@ -5,16 +5,21 @@ import getLocaleFromPath from '$lib/getLocaleFromPath'; import type { CollectionEntry } from 'astro:content'; interface Props { + headingLevel: 'h1' | 'h2' | 'h3' | 'h4'; newsItem: CollectionEntry<'news'>; } -const { newsItem } = Astro.props; +const { headingLevel, newsItem } = Astro.props; const locale = getLocaleFromPath(Astro.url.pathname); const t = translate(locale); --- -

{newsItem.data.title}

+ ${newsItem.data.title} + `} + />

{newsItem.data.summary}

-- cgit v1.2.3