Новые правки в компоенты

This commit is contained in:
Web-serfer 2026-05-06 23:16:07 +05:00
parent d5c9c9a849
commit acf877f325
16 changed files with 460 additions and 32 deletions

View file

@ -1,6 +1,6 @@
---
interface Props {
posts: any[]; // Массив статей из PocketBase
posts: any[];
}
const { posts } = Astro.props;

View file

@ -2,8 +2,8 @@
import PostTags from '@components/blog/PostTags.astro';
interface Props {
post: any; // Объект статьи из PocketBase
compact?: boolean; // Опция для компактного вида (опционально)
post: any;
compact?: boolean;
}
const { post, compact = false } = Astro.props;

View file

@ -41,10 +41,13 @@ try {
];
}
// Фильтрация элементов верхнего меню (показываем только первые 5: Главная, Услуги, Маршруты, Цены, Контакты)
const topNavItems = navItems.filter(item => item.order <= 5);
// Фильтрация элемента "Startseite" на главной странице
const filteredNavItems = currentPath === '/'
? navItems.filter(item => item.label !== 'Startseite')
: navItems;
? topNavItems.filter(item => item.label !== 'Startseite')
: topNavItems;
const userName = session?.user?.name || session?.user?.email?.split('@')[0] || 'Gast';