blob: 99ecb6027c0f9fe3415300099e5589e844f09fb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
---
import translate from '$i18n/translate';
import tNewsPreviewLink from '$i18n/translations/components/newsPreviewLink';
import type Locale from '$types/Locale';
import type { CollectionEntry } from 'astro:content';
interface Props {
locale: Locale;
newsItem: CollectionEntry<'news'>;
}
const { locale, newsItem } = Astro.props;
const t = translate(locale);
---
<a class="news-index__item" href={`/${locale}/news/${newsItem.slug.replace('/', '-')}`}>
<h2>{newsItem.data.title}</h2>
<p>{newsItem.data.summary}</p>
<p class="link">{t(tNewsPreviewLink, { key: 'read-article' })}</p>
</a>
|