mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-02 03:37:48 +02:00
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:
parent
233737ec3d
commit
04fc4190f9
2 changed files with 8 additions and 1 deletions
|
@ -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 && (
|
||||
|
|
|
@ -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
|
||||
---
|
||||
|
||||

|
||||
|
|
Loading…
Add table
Reference in a new issue