diff --git a/packages/docusaurus-theme-classic/src/theme/BlogLayout/index.tsx b/packages/docusaurus-theme-classic/src/theme/BlogLayout/index.tsx index f99aa4c5f2f9..e5c29fcdc03e 100644 --- a/packages/docusaurus-theme-classic/src/theme/BlogLayout/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/BlogLayout/index.tsx @@ -31,7 +31,9 @@ function BlogLayout(props: Props): JSX.Element { className={clsx('col', { 'col--7': hasSidebar, 'col--9 col--offset-1': !hasSidebar, - })}> + })} + itemScope + itemType="http://schema.org/Blog"> {children} {toc && ( diff --git a/packages/docusaurus-theme-classic/src/theme/BlogPostItem/index.tsx b/packages/docusaurus-theme-classic/src/theme/BlogPostItem/index.tsx index 7ed64193b359..325b559c4600 100644 --- a/packages/docusaurus-theme-classic/src/theme/BlogPostItem/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/BlogPostItem/index.tsx @@ -10,6 +10,7 @@ import clsx from 'clsx'; import {MDXProvider} from '@mdx-js/react'; import Translate, {translate} from '@docusaurus/Translate'; import Link from '@docusaurus/Link'; +import {useBaseUrlUtils} from '@docusaurus/useBaseUrl'; import {usePluralForm} from '@docusaurus/theme-common'; import MDXComponents from '@theme/MDXComponents'; import Seo from '@theme/Seo'; @@ -40,6 +41,7 @@ function useReadingTimePlural() { function BlogPostItem(props: Props): JSX.Element { const readingTimePlural = useReadingTimePlural(); + const {withBaseUrl} = useBaseUrlUtils(); const { children, frontMatter, @@ -74,11 +76,19 @@ function BlogPostItem(props: Props): JSX.Element { return (
- - {isBlogPostPage ? title : {title}} + + {isBlogPostPage ? ( + title + ) : ( + + {title} + + )}
- + {readingTime && ( <> @@ -93,16 +103,25 @@ function BlogPostItem(props: Props): JSX.Element { {author} )} -
- {author && ( - <> -
- {author} -
- {authorTitle} - - )} -
+ {author && ( + + )}
); @@ -112,11 +131,24 @@ function BlogPostItem(props: Props): JSX.Element { <> -
+
{renderPostHeader()} -
+ + {image && ( + + )} + +
{children}
+ {(tags.length > 0 || truncated) && (