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

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

@ -8,4 +8,4 @@ Disallow: /email-verified
Disallow: /profile
Disallow: /auth/
Sitemap: https://www.minivan-berlin.de/sitemap-index.xml
Sitemap: https://minivan-berlin.de/sitemap-index.xml

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';

View file

@ -72,12 +72,12 @@ const dateOptions: Intl.DateTimeFormatOptions = { day: '2-digit', month: 'long',
<Layout
title={adjustedTitle}
description={post.description}
description={adjustedDescription}
skipSiteName={true}
breadcrumbs={[
{ label: 'Startseite', href: '/' },
{ label: 'Blog', href: '/blog' },
{ label: post.title, current: true }
{ label: adjustedTitle, current: true }
]}
>
@ -87,9 +87,12 @@ const dateOptions: Intl.DateTimeFormatOptions = { day: '2-digit', month: 'long',
<div class="max-w-4xl mx-auto px-4 py-8 sm:py-12">
<!-- HEADER СТАТЬИ -->
<div class="bg-yellow-100 p-2 text-center text-sm">
year={year}, title={post.title}, adjusted={adjustedTitle}
</div>
<header class="mb-10 text-center">
<h1 class="text-4xl sm:text-5xl font-extrabold text-gray-900 tracking-tight leading-tight mb-6">
{post.title}
{adjustedTitle}
</h1>
</header>
@ -98,7 +101,7 @@ const dateOptions: Intl.DateTimeFormatOptions = { day: '2-digit', month: 'long',
<div class="relative w-full aspect-video rounded-2xl overflow-hidden shadow-lg mb-6">
<img
src={`${import.meta.env.POCKETBASE_URL || import.meta.env.PUBLIC_POCKETBASE_URL}/api/files/${post.collectionId}/${post.id}/${post.image}`}
alt={post.title}
alt={adjustedTitle}
class="w-full h-full object-cover"
loading="eager"
width="1200"