mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 09:19:16 +02:00
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:
parent
01c6f15b15
commit
48f080ebca
20 changed files with 321 additions and 91 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue