correct tags

This commit is contained in:
Profile Profile
2026-03-13 20:22:35 +03:00
parent d3b8a0bb63
commit 684a7bffbf
4 changed files with 23 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ const { post, pageInfo } = Astro.props;
<div class="tags-list">
{post.tags.nodes.map((tag) => (
<a
href={`/tag/${encodeURIComponent(tag.name.replace(/\s+/g, '+'))}/`}
href={`/tag/${encodeURIComponent(tag.slug.replace(/\s+/g, '+'))}/`}
class="tag-link"
key={tag.id}
>

View File

@@ -254,7 +254,7 @@ export async function getPostsByTag(slug, first = 14, after = null) {
async () => {
const query = `
query GetPostsByTag($first: Int!, $after: String, $slug: ID!) {
tag(id: $slug, idType: NAME) {
tag(id: $slug, idType: SLUG) {
id
databaseId
name

View File

@@ -25,7 +25,7 @@ const endCursor = pageInfo?.endCursor || null;
title={`Записи по тегу: ${tagName}`}
description={`Информационное агентство Деловой журнал Профиль - записи по тегу ${tagName}`}
>
<h1>#{decodedSlug}</h1>
<h1 class="title-tag">{tagName}</h1>
<ContentGrid
items={posts}
pageInfo={pageInfo}

View File

@@ -52,6 +52,26 @@ main {
width:100%;
}
.title-tag{
margin-bottom: 12px;
position: relative;
padding-left: 40px; /* Отступ для иконки */
}
.title-tag::before {
content: "";
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 36px;
height: 37px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 37'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2.306 25.306l9.281 9.281a2 2 0 002.829 0l14.993-14.993a2 2 0 00.584-1.319l.464-9.746a2 2 0 00-2.093-2.093l-9.746.465a2 2 0 00-1.32.583L2.307 22.477a2 2 0 000 2.829zm18.264-8.983a2.997 2.997 0 104.239-4.239 2.997 2.997 0 00-4.239 4.239z' fill='%23E0E0E0'%3E%3C/path%3E%3C/svg%3E");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
@media (max-width: 767px) {