summaryrefslogtreecommitdiff
path: root/src/components/NewsPreviewLink.astro
diff options
context:
space:
mode:
authorJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-20 07:57:21 +0100
committerJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-20 07:57:21 +0100
commit869976b711d862581d1d99bf884dd166b1ecdf3b (patch)
tree966024bf1d14ffbc36d719d51ab8d2b88b5b3f15 /src/components/NewsPreviewLink.astro
parent863b292304fe130f8a91b191c3b844521ef19ac3 (diff)
Pulls out NewsIndex Astro component
Diffstat (limited to 'src/components/NewsPreviewLink.astro')
-rw-r--r--src/components/NewsPreviewLink.astro25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/components/NewsPreviewLink.astro b/src/components/NewsPreviewLink.astro
deleted file mode 100644
index 90cce61..0000000
--- a/src/components/NewsPreviewLink.astro
+++ /dev/null
@@ -1,25 +0,0 @@
----
-import translate from '$i18n/translate';
-import tNewsPreviewLink from '$i18n/translations/components/newsPreviewLink';
-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);
----
-
-<a class="news-index__item group-hover" href={`/${locale}/news/${newsItem.slug.replace('/', '-')}`}>
- <Fragment
- set:html={`
- <${headingLevel}>${newsItem.data.title}</${headingLevel}>
- `}
- />
- <p>{newsItem.data.summary}</p>
- <p class="link">{t(tNewsPreviewLink, { key: 'read-article' })}</p>
-</a>