--- import type { Post } from '@globalInterfaces'; interface Props { posts: Post[]; } const { posts } = Astro.props; function formatDate(date: string): string { if (!date) return ''; return new Date(date).toLocaleString('ru-RU', { year: 'numeric', month: 'long', day: 'numeric', }); } --- { posts.map((post) => { const postLink = `/blog/${post.slug}`; const formattedDate = formatDate(post.publishDate); const displayTitle = post.title.replace('{year}', new Date().getFullYear().toString()); return (
{/* ГЛАВНАЯ ССЫЛКА z-0 - самый нижний слой */} {/* КОНТЕНТ z-10 - слой выше */}
{/* ВЕРХНЯЯ СТРОКА: Слева - декоративная линия Справа - Дата */}
{/* Слева: Декоративная линия ("строка") */}
{/* Справа: Дата */}
{formattedDate}
{/* Заголовок */}

{displayTitle}

{/* Описание */}

{post.description}

{/* НИЗ: Теги z-20 - верхний слой, клики включены */} {post.tags && post.tags.length > 0 && (
{post.tags.map((tag) => ( #{tag} ))}
)}
); }) }