From a14c18542edd6aeea91fad1865428fd8f86c0edd Mon Sep 17 00:00:00 2001 From: Web-serfer Date: Sun, 26 Apr 2026 18:09:40 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D1=8B=D0=B5=20=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=B2=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=BF=D0=BE=D0=B5=D0=BD=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 23 ++ .../src/components/base/Breadcrumbs.astro | 15 ++ .../src/components/blog/PostSocialShare.astro | 13 +- .../src/components/blog/RelatedPosts.astro | 138 +++++++++-- .../components/blog/comments/CommentLock.tsx | 113 +++++---- .../src/components/blog/comments/Comments.tsx | 42 ++-- .../src/components/layout/header/Header.astro | 2 - frontend/src/icons/articles.svg | 1 + frontend/src/icons/comments.svg | 1 + frontend/src/layouts/ArticleLayout.astro | 222 +++++++++--------- frontend/src/layouts/Layout.astro | 3 + frontend/src/pages/blog/[slug].astro | 64 +++-- frontend/src/pages/cases/index.astro | 2 +- frontend/src/styles/global.css | 8 +- frontend/tsconfig.json | 3 +- 15 files changed, 417 insertions(+), 233 deletions(-) create mode 100644 frontend/src/icons/articles.svg create mode 100644 frontend/src/icons/comments.svg diff --git a/AGENTS.md b/AGENTS.md index 4be37b8..db40da8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -114,6 +114,29 @@ - Использовать Lighthouse и WebPageTest для аудита производительности - Реализовать performance budgets +## SEO рекомендации + +### Оптимальное количество страниц +- **50-100 страниц** — хороший объём для тематики "автоюрист" +- Минимум 30-50 страниц с уникальным контентом + +### Структура страниц +- Услуги (12 шт) — уже есть +- Кейсы — минимум 20-30 реальных примеров +- Блог — минимум 30-50 статей +- FAQ — 20-30 вопросов +- Городские страницы ("юрист в Сургуте", "возврат прав Сургут" и пр.) + +### Требования к контенту +- Каждая страница с уникальным текстом (не шаблон) +- Длинные статьи в блог (3000-5000 слов) +- Реальные кейсы с описанием проблемы и решения + +### Внутренние ссылки +- Связывать страницы между собой (услуги → кейсы → блог) +- Использовать sitemap для всех публичных страниц + + ## Ccылки на документацию - URL документации Astro: https://docs.astro.build/en/getting-started/ - URL документации PocketBase: https://pocketbase.io/docs/ diff --git a/frontend/src/components/base/Breadcrumbs.astro b/frontend/src/components/base/Breadcrumbs.astro index 7560d28..3ead666 100644 --- a/frontend/src/components/base/Breadcrumbs.astro +++ b/frontend/src/components/base/Breadcrumbs.astro @@ -84,14 +84,29 @@ const { items } = Astro.props; padding: 0 0 0.5rem; } + .breadcrumbs-list { + flex-wrap: nowrap; + overflow: hidden; + } + .breadcrumb-link, .breadcrumb-current { font-size: 0.8rem; + display: inline-block; + max-width: 90px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .breadcrumb-separator { width: 0.875rem; height: 0.875rem; + flex-shrink: 0; + } + + .breadcrumb-item { + flex-shrink: 0; } } diff --git a/frontend/src/components/blog/PostSocialShare.astro b/frontend/src/components/blog/PostSocialShare.astro index bd95ff9..2391853 100644 --- a/frontend/src/components/blog/PostSocialShare.astro +++ b/frontend/src/components/blog/PostSocialShare.astro @@ -1,8 +1,5 @@ --- -import telegramIcon from '../../icons/telegram.svg?raw'; -import vkIcon from '../../icons/vk.svg?raw'; -import whatsappIcon from '../../icons/whatsapp.svg?raw'; -import okIcon from '../../icons/ok.svg?raw'; +import { Icon } from 'astro-icon/components'; interface Props { title: string; @@ -27,7 +24,7 @@ const encodedUrl = encodeURIComponent(url); class="social-icon telegram" aria-label="Поделиться в Telegram" > - + @@ -38,7 +35,7 @@ const encodedUrl = encodeURIComponent(url); class="social-icon vk" aria-label="Поделиться в VK" > - + @@ -49,7 +46,7 @@ const encodedUrl = encodeURIComponent(url); class="social-icon whatsapp" aria-label="Поделиться в WhatsApp" > - + @@ -60,7 +57,7 @@ const encodedUrl = encodeURIComponent(url); class="social-icon odnoklassniki" aria-label="Поделиться в Одноклассниках" > - + diff --git a/frontend/src/components/blog/RelatedPosts.astro b/frontend/src/components/blog/RelatedPosts.astro index 5e8da5b..57fab8c 100644 --- a/frontend/src/components/blog/RelatedPosts.astro +++ b/frontend/src/components/blog/RelatedPosts.astro @@ -1,5 +1,4 @@ --- -import BlogCard from '@components/blog/BlogCard.astro'; import { getPostImageUrl } from '@lib/pb'; interface Post { @@ -22,7 +21,6 @@ interface Props { const { posts, currentSlug } = Astro.props; -// Форматируем дату const formatDate = (date: string) => { return new Date(date).toLocaleDateString('ru-RU', { day: 'numeric', @@ -31,46 +29,51 @@ const formatDate = (date: string) => { }); }; -// Фильтруем текущую статью -const filteredPosts = currentSlug - ? posts.filter(post => post.slug !== currentSlug).slice(0, 3) - : posts.slice(0, 3); +const filteredPosts = currentSlug + ? posts.filter((post: Post) => post.slug !== currentSlug) + : posts; --- - diff --git a/frontend/src/components/blog/comments/CommentLock.tsx b/frontend/src/components/blog/comments/CommentLock.tsx index 55acaa4..fe45782 100644 --- a/frontend/src/components/blog/comments/CommentLock.tsx +++ b/frontend/src/components/blog/comments/CommentLock.tsx @@ -3,6 +3,8 @@ import { createSignal, onMount } from "solid-js"; export default function CommentLock() { const [currentPath, setCurrentPath] = createSignal("/auth/sign-in"); + const commentsSvg = ``; + onMount(() => { const path = window.location.pathname; const hash = window.location.hash; @@ -11,51 +13,82 @@ export default function CommentLock() { }); return ( -
-
-

Комментарии

- - 0 - -
- -
-
- - - + <> +
+
+ +

Комментарии

+ + 0 +
-

- Комментарии доступны только авторизованным пользователям -

- - - - - Войти в аккаунт - -

- Нет аккаунта?{" "} - - Зарегистрироваться + + + +

+ +

+ Нужна авторизация для комментариев +

+
+ + + + Войти в аккаунт -

+

+ Нет аккаунта?{" "} + + Зарегистрироваться + +

+
-
+ + ); } \ No newline at end of file diff --git a/frontend/src/components/blog/comments/Comments.tsx b/frontend/src/components/blog/comments/Comments.tsx index 6877dfd..36dbe66 100644 --- a/frontend/src/components/blog/comments/Comments.tsx +++ b/frontend/src/components/blog/comments/Comments.tsx @@ -1,38 +1,17 @@ import { createSignal, For, Show, onMount } from "solid-js"; import CommentLock from "./CommentLock"; import CommentForm from "./CommentForm"; -import type { CommentWithReplies } from "../../../types/comments"; - -interface CommentsProps { - postSlug: string; -} - -interface ApiComment { - id: string; - post_slug: string; - user: string; - content: string; - parent?: string | null; - is_verified: boolean; - status: "pending" | "published" | "spam"; - created: string; - updated: string; - expand?: { - user?: { - id: string; - firstName?: string; - name?: string; - email: string; - avatar?: string; - }; - }; -} +import type { CommentWithReplies, CommentRecord } from "../../../types/comments"; interface ToastMessage { type: "success" | "error"; message: string; } +interface CommentsProps { + postSlug: string; +} + export default function Comments(props: CommentsProps) { const [isAuthenticated, setIsAuthenticated] = createSignal(false); const [currentUser, setCurrentUser] = createSignal<{ @@ -95,7 +74,7 @@ export default function Comments(props: CommentsProps) { const data = await response.json(); const commentsWithReplies: CommentWithReplies[] = await Promise.all( - data.items.map(async (comment: ApiComment) => { + data.items.map(async (comment: CommentRecord) => { const repliesResponse = await fetch( `/api/comments?post_slug=${encodeURIComponent(props.postSlug)}&parent=${comment.id}`, { @@ -289,6 +268,15 @@ export default function Comments(props: CommentsProps) { return ( <> + {(t) => (
\ No newline at end of file diff --git a/frontend/src/icons/comments.svg b/frontend/src/icons/comments.svg new file mode 100644 index 0000000..e8cad18 --- /dev/null +++ b/frontend/src/icons/comments.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/layouts/ArticleLayout.astro b/frontend/src/layouts/ArticleLayout.astro index c90c0c7..09131e1 100644 --- a/frontend/src/layouts/ArticleLayout.astro +++ b/frontend/src/layouts/ArticleLayout.astro @@ -106,11 +106,9 @@ const {
-
+
- +
@@ -123,9 +121,7 @@ const {
-
- -
+