Skip to content

Commit e0f9501

Browse files
committed
Add more opengraph meta elements
1 parent 5d56095 commit e0f9501

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/layouts/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export default ({ children }) => (
3131
<title>{site.siteMetadata.title}</title>
3232
<link rel="me" href="https://mastodon.social/@testingrequired" />
3333

34-
<meta property="og:title" content={site.siteMetadata.title} />
3534
<meta property="og:url" content={location.href} />
3635
</Helmet>
3736

src/templates/post.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,20 @@ import Layout from '../layouts';
55

66
export default function Template({ data }) {
77
const { siteMetadata } = data.site;
8-
const { frontmatter, html } = data.markdownRemark;
8+
const { frontmatter, html, excerpt } = data.markdownRemark;
99
const { title, date } = frontmatter;
1010

1111
return (
1212
<Layout>
13-
<Helmet title={`${title} - ${siteMetadata.title}`} />
13+
<Helmet>
14+
<title>{`${title} - ${siteMetadata.title}`}</title>
15+
16+
<meta
17+
property="og:title"
18+
content={`${title} - ${siteMetadata.title}`}
19+
/>
20+
<meta property="og:description" content={excerpt} />
21+
</Helmet>
1422

1523
<div className="blog-post-container">
1624
<div className="blog-post">
@@ -31,6 +39,7 @@ export const pageQuery = graphql`
3139
query BlogPostByPath($path: String!) {
3240
markdownRemark(frontmatter: { path: { eq: $path } }) {
3341
html
42+
excerpt
3443
frontmatter {
3544
date(formatString: "MMMM DD, YYYY")
3645
title

0 commit comments

Comments
 (0)