Новый правки
This commit is contained in:
parent
6ac91f8099
commit
7f1a146da7
2 changed files with 18 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ export interface Props {
|
|||
categoryColor?: string;
|
||||
postTitle: string;
|
||||
date: string;
|
||||
dateIso?: string;
|
||||
author: string;
|
||||
readTime: string;
|
||||
readmeTime: string;
|
||||
|
|
@ -43,6 +44,7 @@ const {
|
|||
categoryColor = 'bg-gold',
|
||||
postTitle,
|
||||
date,
|
||||
dateIso,
|
||||
author,
|
||||
readTime,
|
||||
readmeTime,
|
||||
|
|
@ -65,6 +67,17 @@ const {
|
|||
<meta name="description" content={description} />
|
||||
{canonicalLink && <link rel="canonical" href={canonicalLink} />}
|
||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||
|
||||
<meta property="og:title" content={postTitle} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content={postUrl} />
|
||||
<meta property="og:image" content={heroImage} />
|
||||
<meta property="og:image:alt" content={heroAlt} />
|
||||
<meta property="og:site_name" content="Автоюрист Сургут" />
|
||||
<meta property="article:author" content={author} />
|
||||
<meta property="article:published_time" content={dateIso || date} />
|
||||
<meta property="article:tag" content={category} />
|
||||
</head>
|
||||
<body>
|
||||
<Toast />
|
||||
|
|
|
|||
|
|
@ -89,6 +89,10 @@ const formatDate = (date: string) => {
|
|||
return `${day}/${month}/${year}`;
|
||||
};
|
||||
|
||||
const formatDateIso = (date: string) => {
|
||||
return new Date(date).toISOString();
|
||||
};
|
||||
|
||||
// Для related posts берем те же категории
|
||||
const { posts: relatedPosts } = await getPosts({ perPage: 4, category: post.category });
|
||||
const filteredRelated = relatedPosts.filter(p => p.slug !== slug).slice(0, 3);
|
||||
|
|
@ -112,6 +116,7 @@ const heroImage = getPostImageUrl(post);
|
|||
categoryColor={post.categoryColor}
|
||||
postTitle={post.title}
|
||||
date={formatDate(post.date)}
|
||||
dateIso={formatDateIso(post.date)}
|
||||
author={post.author}
|
||||
readTime={post.readTime}
|
||||
readmeTime={post.readmeTime}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue