add correct news templates

This commit is contained in:
Profile Profile
2026-03-08 19:09:23 +03:00
parent 572ffd07e6
commit c9ed7c8fcc
8 changed files with 218 additions and 82 deletions

View File

@@ -1,56 +1,82 @@
---
const { category } = Astro.props;
const { category, contentType } = Astro.props;
import Stores from './LazyStores.astro';
import MainMenu from '@components/MainMenu.astro';
const MENU_ID = 3340; // 103246 (бургер 1). 103247 (бургер 2 )
let menuItems = [];
import Stores from './LazyStores.astro';
import MainMenu from '@components/MainMenu.astro';
const MENU_ID = 3340; // 103246 (бургер 1). 103247 (бургер 2 )
let menuItems = [];
---
<header class="header" itemscope itemtype="https://schema.org/WPHeader">
<div class="top-bar">
<img alt="Профиль" width="249" height="55" src="https://cdn.profile.ru/wp-content/themes/profile/assets/img/profile-logo-delovoy.svg">
<div class="top-bar">
<a href="/"><img alt="Профиль" width="249" height="55" src="https://cdn.profile.ru/wp-content/themes/profile/assets/img/profile-logo-delovoy.svg"></a>
{category && (
<div class="header__subtitle">
<a href={`/${category.slug}`}>{category.name}</a>
</div>
)}
<div class="header__subtitle">
{contentType === 'news' && (
<span class="header__news-badge"><a href="/news">Новости</a></span>
)}
<a href={`/${category.slug}`}>{category.name}</a>
</div>
)}
<Stores />
</div>
<MainMenu menuId={MENU_ID} />
</div>
<MainMenu menuId={MENU_ID} />
</header>
<style>
.top-bar {
display: flex;
justify-content: space-between;
align-items: center;
}
.top-bar{
display: flex;
justify-content: space-between;
align-items: center;
}
.header__subtitle {
font-size: 22px;
font-weight: bold;
margin-left: 42px;
position: relative;
display: flex;
align-items: center;
gap: 10px;
}
.header__subtitle{
font-size: 22px;
font-weight: bold;
margin-left: 42px;
position: relative;
}
.header__subtitle::before {
content: '';
position: absolute;
top: 50%;
left: -15px;
width: 3px;
height: 80%;
border-left: 3px solid;
transform: translate(0, -40%);
}
.header__subtitle::before{
content: '';
position: absolute;
top: 50%;
left: -15px;
width: 3px;
height: 80%;
border-left: 3px solid;
transform: translate(0, -40%);
}
.header__news-badge {
color: inherit;
font-weight: inherit;
position: relative;
padding-right: 10px;
}
.header__news-badge::after {
content: '|';
position: absolute;
right: -2px;
color: inherit;
font-weight: inherit;
}
.header__subtitle a {
text-decoration: none;
color: inherit;
font-weight: inherit;
}
.header__subtitle a:hover {
text-decoration: underline;
}
</style>