Skip to content

Commit

Permalink
fix: 포스트에서 meta og가 정상적으로 되지 않는 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
cruelladevil committed Oct 29, 2023
1 parent d3bc0a8 commit 16926db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/templates/post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { inner, outer, SiteMain } from '../styles/shared';
import config from '../website-config';
import { AuthorList } from '../components/AuthorList';
import Utterances from './Utterances';
import defaultImage from '../content/img/tecoble-background.png';

export interface Author {
name: string;
Expand Down Expand Up @@ -102,8 +103,6 @@ const PageTemplate = ({ data, pageContext, location }: PageTemplateProps) => {
// 20 AUG 2018
const displayDatetime = format(date, 'dd LLL yyyy');

const defaultImage = require('../content/img/tecoble-background.png');

return (
<IndexLayout className="post-template">
<Helmet>
Expand All @@ -115,11 +114,11 @@ const PageTemplate = ({ data, pageContext, location }: PageTemplateProps) => {
<meta property="og:type" content="article" />
<meta property="og:title" content={post.frontmatter.title} />
<meta property="og:description" content={post.frontmatter.excerpt || post.excerpt} />
<meta property="og:url" content={config.siteUrl.split('/tecoble')[0] + location.pathname} />
<meta property="og:url" content={config.siteUrl + location.pathname} />
{post.frontmatter.image && (
<meta
property="og:image"
content={config.siteUrl.split('/tecoble')[0] + getSrc(post.frontmatter.image)}
content={`${config.siteUrl}${getSrc(post.frontmatter.image)}`}
/>
)}
<meta property="article:published_time" content={post.frontmatter.date} />
Expand All @@ -134,7 +133,7 @@ const PageTemplate = ({ data, pageContext, location }: PageTemplateProps) => {
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={post.frontmatter.title} />
<meta name="twitter:description" content={post.frontmatter.excerpt || post.excerpt} />
<meta name="twitter:url" content={config.siteUrl.split('/tecoble')[0] + location.pathname} />
<meta name="twitter:url" content={config.siteUrl + location.pathname} />
{post.frontmatter.image && (
<meta
name="twitter:image"
Expand Down
2 changes: 1 addition & 1 deletion src/website-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const config: WebsiteConfig = {
coverImage: 'img/wooteco.jpeg',
logo: 'img/tecoble.png',
lang: 'en',
siteUrl: 'https://tecoble.techcourse.co.kr/',
siteUrl: 'https://tecoble.techcourse.co.kr',
showSubscribe: false,
mailchimpAction: 'https://twitter.us19.list-manage.com/subscribe/post?u=a89b6987ac248c81b0b7f3a0f&amp;id=7d777b7d75',
mailchimpName: 'b_a89b6987ac248c81b0b7f3a0f_7d777b7d75',
Expand Down

0 comments on commit 16926db

Please sign in to comment.