feat(v2): Support keywords meta in blog posts (#3038)

* #3036: support rendering  meta tag for blog posts (only in theme-classic)

* #3036: add keywords in an existing blog post
This commit is contained in:
Deepak Giri 2020-07-09 20:32:00 +05:30 committed by GitHub
parent 233737ec3d
commit 04fc4190f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -40,7 +40,7 @@ function BlogPostItem(props): JSX.Element {
isBlogPostPage = false,
} = props;
const {date, permalink, tags, readingTime} = metadata;
const {author, title, image} = frontMatter;
const {author, title, image, keywords} = frontMatter;
const authorURL = frontMatter.author_url || frontMatter.authorURL;
const authorTitle = frontMatter.author_title || frontMatter.authorTitle;
@ -97,6 +97,9 @@ function BlogPostItem(props): JSX.Element {
return (
<>
<Head>
{keywords && keywords.length && (
<meta name="keywords" content={keywords.join(',')} />
)}
{image && <meta property="og:image" content={imageUrl} />}
{image && <meta property="twitter:image" content={imageUrl} />}
{image && (

View file

@ -5,6 +5,10 @@ authorURL: http://twitter.com/JoelMarcey
authorImageURL: https://graph.facebook.com/611217057/picture/?height=200&width=200
authorFBID: 611217057
authorTwitter: JoelMarcey
keywords:
- documentation
- blog
- docusaurus
---
![Introducing Slash](/img/slash-introducing.svg)