mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 08:19:07 +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 && (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue