From 869976b711d862581d1d99bf884dd166b1ecdf3b Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sun, 20 Aug 2023 07:57:21 +0100 Subject: Pulls out NewsIndex Astro component --- src/components/NewsIndex/NewsPreviewLink.astro | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/components/NewsIndex/NewsPreviewLink.astro (limited to 'src/components/NewsIndex/NewsPreviewLink.astro') diff --git a/src/components/NewsIndex/NewsPreviewLink.astro b/src/components/NewsIndex/NewsPreviewLink.astro new file mode 100644 index 0000000..aa8a371 --- /dev/null +++ b/src/components/NewsIndex/NewsPreviewLink.astro @@ -0,0 +1,25 @@ +--- +import translate from '$i18n/translate'; +import tComponent from '$i18n/translations/components/newsIndex'; +import getLocaleFromPath from '$lib/getLocaleFromPath'; +import type { CollectionEntry } from 'astro:content'; + +interface Props { + headingLevel: 'h1' | 'h2' | 'h3' | 'h4'; + newsItem: CollectionEntry<'news'>; +} + +const { headingLevel, newsItem } = Astro.props; +const locale = getLocaleFromPath(Astro.url.pathname); +const t = translate(locale); +--- + + + ${newsItem.data.title} + `} + /> +

{newsItem.data.summary}

+ +
-- cgit v1.2.3