Новые изменения в компоенты

This commit is contained in:
Web-serfer 2026-04-28 01:58:37 +05:00
parent 60f0009ae2
commit 38bf5d7dcf
6 changed files with 218 additions and 27 deletions

View file

@ -82,14 +82,12 @@ const heroImage = getPostImageUrl(post);
<div class="post-content" set:html={contentHtml} />
</article>
<!-- Комментарии и похожие статьи - ВНЕ article -->
{/*
<!-- Комментарии и похожие статьи -->
<div class="comments-wrapper">
<Comments postSlug={post.slug} client:load />
</div>
<RelatedPosts posts={filteredRelated} currentSlug={slug} />
*/}
<!-- Оглавление -->
<div slot="sidebar">

View file

@ -15,11 +15,11 @@ const { posts, total, totalPages } = await getPosts({ page: currentPage, perPage
const categories = await getAllCategories();
const formatDate = (date: string) => {
return new Date(date).toLocaleDateString('ru-RU', {
day: 'numeric',
month: 'long',
year: 'numeric'
});
const d = new Date(date);
const day = d.getDate().toString().padStart(2, '0');
const month = (d.getMonth() + 1).toString().padStart(2, '0');
const year = new Date().getFullYear().toString().slice(-2);
return `${day}/${month}/${year}`;
};
---

View file

@ -18,11 +18,11 @@ const { posts, total, totalPages } = await getPosts({ page: currentPage, perPage
const categories = await getAllCategories();
const formatDate = (date: string) => {
return new Date(date).toLocaleDateString('ru-RU', {
day: 'numeric',
month: 'long',
year: 'numeric'
});
const d = new Date(date);
const day = d.getDate().toString().padStart(2, '0');
const month = (d.getMonth() + 1).toString().padStart(2, '0');
const year = new Date().getFullYear().toString().slice(-2);
return `${day}/${month}/${year}`;
};
---

View file

@ -19,11 +19,11 @@ const breadcrumbsItems = [
];
const formatDate = (date: string) => {
return new Date(date).toLocaleDateString('ru-RU', {
day: 'numeric',
month: 'long',
year: 'numeric'
});
const d = new Date(date);
const day = d.getDate().toString().padStart(2, '0');
const month = (d.getMonth() + 1).toString().padStart(2, '0');
const year = new Date().getFullYear().toString().slice(-2);
return `${day}/${month}/${year}`;
};
---