diff --git a/frontend/src/components/single-post/BlogPost.astro b/frontend/src/components/single-post/BlogPost.astro index 5a3951e..a207a4a 100644 --- a/frontend/src/components/single-post/BlogPost.astro +++ b/frontend/src/components/single-post/BlogPost.astro @@ -3,7 +3,8 @@ import { MONTHS } from "@lib/constants"; import NumberedContent from "./NumberedContent.astro"; import AuthorConsultation from "./AuthorConsultation.astro"; -export interface Props { +// Определяем интерфейс пропсов +interface Props { title: string; excerpt: string; author: { @@ -30,6 +31,7 @@ function formatDate(dateInput: string | Date): string { return `${date.getDate()} ${MONTHS[date.getMonth()]} ${date.getFullYear()} года`; } +// Деструктуризация пропсов через Astro.props с явной типизацией const { title, excerpt, @@ -43,101 +45,101 @@ const { postId, likes = 0, dislikes = 0, -} = Astro.props; +} = Astro.props as Props; -// дата поста -const formattedPublishDate = typeof publishDate === "string" - ? publishDate - : formatDate(publishDate); +// Дата поста +const formattedPublishDate = typeof publishDate === "string" + ? publishDate + : formatDate(publishDate); ---
{ - featuredImage && ( -
- {title} - {/* Затемнение для контраста текста */} -
- - {/* Декоративные элементы */} -
- {/* Золотая линия сверху */} -
- -
-
-
- -
-
- -
+ featuredImage && ( +
+ {title} + {/* Затемнение для контраста текста */} +
+ + {/* Декоративные элементы */} +
+ {/* Золотая линия сверху */} +
+ +
+
+
+ +
+
+ +
Статья -
-
- - -

- {title} -

- - -
-
-
-
-
+
+
+ + +

+ {title} +

+ + +
+
+
+
+
+
+
-
-
- ) + ) }
{ - !featuredImage && ( -
-

- {title} -

-

{excerpt}

-
- ) + !featuredImage && ( +
+

+ {title} +

+

{excerpt}

+
+ ) }
{ - tags.length > 0 && ( -
- {tags.map((tag) => ( - + tags.length > 0 && ( +
+ {tags.map((tag) => ( + #{tag} - ))} -
- ) + ))} +
+ ) } { - tableOfContents.length > 0 && ( -
- + tableOfContents.length > 0 && ( +
+ Содержание - - - - -
-
    - {tableOfContents.map((item, index) => ( -
  1. - + + + +
+ -
- ) + {item.title} + + + ))} + +
+ + ) }
@@ -228,18 +230,18 @@ const formattedPublishDate = typeof publishDate === "string"

"Правовая грамотность — лучшая защита ваших интересов в любой жизненной ситуации." @@ -249,28 +251,28 @@ const formattedPublishDate = typeof publishDate === "string"

@@ -281,21 +283,21 @@ const formattedPublishDate = typeof publishDate === "string"
@@ -304,49 +306,45 @@ const formattedPublishDate = typeof publishDate === "string"
- - - -
- @@ -517,7 +502,6 @@ const formattedPublishDate = typeof publishDate === "string" box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); } - /* Лайк */ .vote-btn.like-btn:hover { border-color: #86efac; background: #f0fdf4; @@ -530,7 +514,6 @@ const formattedPublishDate = typeof publishDate === "string" color: #ffffff; } - /* Дизлайк */ .vote-btn.dislike-btn:hover { border-color: #fca5a5; background: #fef2f2; diff --git a/frontend/src/layouts/Layout.astro b/frontend/src/layouts/Layout.astro index 20f88d4..4111361 100644 --- a/frontend/src/layouts/Layout.astro +++ b/frontend/src/layouts/Layout.astro @@ -14,7 +14,7 @@ interface Props { pagePath?: string; blogPostTitle?: string; bodyClass?: string; - noContainer?: boolean; // Новый проп для отключения контейнера + noContainer?: boolean; } const props = Astro.props || {}; @@ -46,6 +46,8 @@ if (Astro.request) { {title} {description ? : null} {canonicalLink ? : null} + +
diff --git a/gin-app/README.md b/gin-app/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/cmd/server/main.go b/gin-app/cmd/server/main.go deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/internal/handlers/handlers.go b/gin-app/internal/handlers/handlers.go deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/internal/models/models.go b/gin-app/internal/models/models.go deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/internal/routes/routes.go b/gin-app/internal/routes/routes.go deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/static/css/style.css b/gin-app/static/css/style.css deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/static/images/logo.png b/gin-app/static/images/logo.png deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/static/js/app.js b/gin-app/static/js/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/templates/layouts/base.html b/gin-app/templates/layouts/base.html deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/templates/pages/about.html b/gin-app/templates/pages/about.html deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/templates/pages/index.html b/gin-app/templates/pages/index.html deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/templates/pages/user/dashboard.html b/gin-app/templates/pages/user/dashboard.html deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/templates/pages/user/profile.html b/gin-app/templates/pages/user/profile.html deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/templates/partials/footer.html b/gin-app/templates/partials/footer.html deleted file mode 100644 index e69de29..0000000 diff --git a/gin-app/templates/partials/header.html b/gin-app/templates/partials/header.html deleted file mode 100644 index e69de29..0000000