Новый правки
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;
|
categoryColor?: string;
|
||||||
postTitle: string;
|
postTitle: string;
|
||||||
date: string;
|
date: string;
|
||||||
|
dateIso?: string;
|
||||||
author: string;
|
author: string;
|
||||||
readTime: string;
|
readTime: string;
|
||||||
readmeTime: string;
|
readmeTime: string;
|
||||||
|
|
@ -43,6 +44,7 @@ const {
|
||||||
categoryColor = 'bg-gold',
|
categoryColor = 'bg-gold',
|
||||||
postTitle,
|
postTitle,
|
||||||
date,
|
date,
|
||||||
|
dateIso,
|
||||||
author,
|
author,
|
||||||
readTime,
|
readTime,
|
||||||
readmeTime,
|
readmeTime,
|
||||||
|
|
@ -65,6 +67,17 @@ const {
|
||||||
<meta name="description" content={description} />
|
<meta name="description" content={description} />
|
||||||
{canonicalLink && <link rel="canonical" href={canonicalLink} />}
|
{canonicalLink && <link rel="canonical" href={canonicalLink} />}
|
||||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<Toast />
|
<Toast />
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,10 @@ const formatDate = (date: string) => {
|
||||||
return `${day}/${month}/${year}`;
|
return `${day}/${month}/${year}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const formatDateIso = (date: string) => {
|
||||||
|
return new Date(date).toISOString();
|
||||||
|
};
|
||||||
|
|
||||||
// Для related posts берем те же категории
|
// Для related posts берем те же категории
|
||||||
const { posts: relatedPosts } = await getPosts({ perPage: 4, category: post.category });
|
const { posts: relatedPosts } = await getPosts({ perPage: 4, category: post.category });
|
||||||
const filteredRelated = relatedPosts.filter(p => p.slug !== slug).slice(0, 3);
|
const filteredRelated = relatedPosts.filter(p => p.slug !== slug).slice(0, 3);
|
||||||
|
|
@ -112,6 +116,7 @@ const heroImage = getPostImageUrl(post);
|
||||||
categoryColor={post.categoryColor}
|
categoryColor={post.categoryColor}
|
||||||
postTitle={post.title}
|
postTitle={post.title}
|
||||||
date={formatDate(post.date)}
|
date={formatDate(post.date)}
|
||||||
|
dateIso={formatDateIso(post.date)}
|
||||||
author={post.author}
|
author={post.author}
|
||||||
readTime={post.readTime}
|
readTime={post.readTime}
|
||||||
readmeTime={post.readmeTime}
|
readmeTime={post.readmeTime}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue