Skip to content

Commit

Permalink
feat: COM-3646 Edit post OG images
Browse files Browse the repository at this point in the history
  • Loading branch information
vkosinov committed Jun 16, 2021
1 parent d5bda68 commit d81988d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions components/Post/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const Post = ({ posts, post, language, className, type = 'regular' }) => {
const title = isNews ? 'Новости 512 | CSSSR' : cleaningTitle(post.title, 'meta')
const description = getDescription(post, isNews)

const ogImage = getOriginal(
// В для всех новостей используем одинаковое изображение для обычных статей мобильную версию postCover
isNews ? newsPostOgImage : post.images.postCover[1],
)

return (
<article
className={cn(className, {
Expand All @@ -38,12 +43,7 @@ const Post = ({ posts, post, language, className, type = 'regular' }) => {
: `${process.env.BLOG_HOST}/${language}/article/${post.slug}`
}
/>
<meta
property="og:image"
content={getOriginal(
isNews ? newsPostOgImage : post.images.mainCoverL[post.images.mainCoverL.length - 1],
)}
/>
<meta property="og:image" content={ogImage} />

<meta property="article:section" content={post.tag} />
<meta property="article:published_time" content={post.date} />
Expand Down
2 changes: 1 addition & 1 deletion components/main/MainPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Head from 'next/head'
import { arrayOf, number, object, shape, string } from 'prop-types'
import React from 'react'

import myImageData from '../../public/images/resize/en/offshore-web-development/mainCoverL/desktop.m.png'
import myImageData from '../../public/images/og/main/desktop.m.png'
import Layout from '../Layout'
import Newsletter from '../Newsletter'

Expand Down
Binary file added public/images/og/main/desktop.m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d81988d

Please sign in to comment.