mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-26 14:59:14 +01:00
fix: added opengraph tags
This commit is contained in:
parent
bebfe1638e
commit
e6ebd5b79f
@ -30,12 +30,14 @@ const Layout: React.FC<Props> = ({
|
||||
<html lang="en" />
|
||||
<title>{title}</title>
|
||||
<meta name="description" content={description} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:site_name" content={title} />
|
||||
<meta property="og:image" content={metaImageUrl} />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
<meta name="twitter:image" content={metaImageUrl} />
|
||||
<meta property="twitter:site" content="@mastermindzh" />
|
||||
{noIndex && <meta name="robots" content="noindex" />}
|
||||
</Helmet>
|
||||
{children}
|
||||
|
@ -1,5 +1,7 @@
|
||||
import type { Node } from "@/types";
|
||||
import React from "react";
|
||||
import { Helmet } from "react-helmet";
|
||||
import { useSiteMetadata } from "../../hooks";
|
||||
import { Author } from "./Author";
|
||||
import { Comments } from "./Comments";
|
||||
import { Content } from "./Content";
|
||||
@ -14,9 +16,18 @@ interface Props {
|
||||
const Post: React.FC<Props> = ({ post }: Props) => {
|
||||
const { html } = post;
|
||||
const { tagSlugs, slug, readingTime } = post.fields;
|
||||
const { tags, title, date, disqusId } = post.frontmatter;
|
||||
const { tags, title, date, disqusId, category } = post.frontmatter;
|
||||
const { url } = useSiteMetadata();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="article:publisher" content={url} />
|
||||
<meta property="article:section" content={category} />
|
||||
<meta property="article:tag" content={tags ? tags[0] : ""} />
|
||||
</Helmet>
|
||||
|
||||
<div className={styles.post}>
|
||||
<div className={styles.content}>
|
||||
<Content body={html} title={title} subTitle={readingTime?.text} />
|
||||
@ -32,6 +43,7 @@ const Post: React.FC<Props> = ({ post }: Props) => {
|
||||
<Comments disqusId={disqusId} postSlug={slug} postTitle={post.frontmatter.title} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user