yarkov.tech/src/pages/articles.astro

27 lines
907 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
import type { ArticleType } from '@root/types';
import PageLayout from '@layouts/default.astro';
import ArticlesList from '@components/ArticlesList';
import { transformArticles, formatToArticleBlocks } from '@utils/articles';
const articles = await Astro.glob<ArticleType>('../../content/articles/**/*.md');
const tags = new Set(articles.map((article) => article.frontmatter.tags).flat());
---
<PageLayout
title='Статьи'
description='Технические статьи, туториалы и различные справочные материалы которые связаны с IT тематикой находятся здесь.'
>
<section>
<ArticlesList
client:load
data={{
articles: formatToArticleBlocks(transformArticles(articles)),
tags: [...tags],
}}
emptyPlaceholder='Не найдено ни одной статьи...'
/>
</section>
</PageLayout>