--- import BaseLayout from '../../layouts/BaseLayout.astro'; import ArticleTile from '../../components/ArticleTile.astro'; import { getCollection } from 'astro:content'; import { useTranslations } from '../../i18n/ui'; const lang = 'cs'; const t = useTranslations(lang); const posts = (await getCollection('blog', ({ data }) => !data.draft)) .filter(p => p.id.startsWith('cs/')) .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf()); const allTags = [...new Set(posts.flatMap(p => p.data.tags))].sort(); --- {posts.length === 0 ? ( {t('empty.articles')} ) : ( {allTags.length > 0 && ( {t('filter.all')} {allTags.map((tag) => ( <> · {tag} > ))} )} {posts.map((post, i) => { const baseSlug = post.id.replace(/^cs\//, '').replace(/\.md$/, ''); return ( ); })} )}