feat(content-blog): Allow pagination for BlogTagsPostsPage (#6221)

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
Muhammad Redho Ayassa 2022-02-04 00:33:13 +07:00 committed by GitHub
parent 01c6f15b15
commit 48f080ebca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 321 additions and 91 deletions

View file

@ -13,6 +13,7 @@ import BlogPostItem from '@theme/BlogPostItem';
import type {Props} from '@theme/BlogTagsPostsPage';
import Translate, {translate} from '@docusaurus/Translate';
import {ThemeClassNames, usePluralForm} from '@docusaurus/theme-common';
import BlogListPaginator from '@theme/BlogListPaginator';
// Very simple pluralization: probably good enough for now
function useBlogPostsPlural() {
@ -33,7 +34,7 @@ function useBlogPostsPlural() {
}
export default function BlogTagsPostsPage(props: Props): JSX.Element {
const {metadata, items, sidebar} = props;
const {metadata, items, sidebar, listMetadata} = props;
const {allTagsPath, name: tagName, count} = metadata;
const blogPostsPlural = useBlogPostsPlural();
const title = translate(
@ -77,6 +78,7 @@ export default function BlogTagsPostsPage(props: Props): JSX.Element {
<BlogPostContent />
</BlogPostItem>
))}
<BlogListPaginator metadata={listMetadata} />
</BlogLayout>
);
}