File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+
3+ export function PostOgpSeo ( { frontmatter } ) {
4+ return (
5+ < >
6+ < meta property = "og:title" content = { frontmatter . title } />
7+ < meta property = "og:type" content = "article" />
8+ < meta property = "article:published_time" content = { frontmatter . date } />
9+ < meta property = "article:author" content = { frontmatter . author } />
10+ < meta
11+ property = "og:image"
12+ content = "https://html.sammy-codes.com/images/large-profile.jpg"
13+ />
14+ < meta property = "og:description" content = "A one sentence description" />
15+ </ >
16+ ) ;
17+ }
18+
19+ export function PostTwitterSeo ( { frontmatter } ) {
20+ return (
21+ < >
22+ < meta name = "twitter:card" content = "summary_large_image" />
23+ < meta name = "twitter:site" content = "@lkpeto" />
24+ < meta name = "twitter:title" content = { frontmatter . title } />
25+ < meta
26+ name = "twitter:description"
27+ content = "Senior Selachimorpha at DigitalOcean"
28+ />
29+ < meta
30+ name = "twitter:image"
31+ content = "https://html.sammy-codes.com/images/large-profile.jpg"
32+ />
33+ </ >
34+ ) ;
35+ }
36+
37+ export function PostSeo ( { frontmatter } ) {
38+ return (
39+ < >
40+ < PostOgpSeo frontmatter = { frontmatter } />
41+ < PostTwitterSeo frontmatter = { frontmatter } />
42+ </ >
43+ ) ;
44+ }
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22import { PostLayout } from '../../components/PostLayout' ;
3+ import { PostSeo } from '../../components/PostSeo' ;
34
45export const Head = ( { pageContext } ) => {
56 const { frontmatter } = pageContext ;
6- return < title > { frontmatter . title } </ title > ;
7+ return (
8+ < >
9+ < title > { frontmatter . title } </ title >
10+ < PostSeo frontmatter = { frontmatter } />
11+ </ >
12+ ) ;
713} ;
814
915export default function PostPage ( { pageContext, children } ) {
You can’t perform that action at this time.
0 commit comments