@docusaurus/theme-classic 0.0.0-4735 → 0.0.0-4738
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/theme-classic.d.ts +63 -33
- package/lib-next/theme/BlogArchivePage/index.js +13 -9
- package/lib-next/theme/BlogListPage/index.js +34 -13
- package/lib-next/theme/BlogPostPage/index.js +56 -45
- package/lib-next/theme/BlogTagsListPage/index.js +16 -12
- package/lib-next/theme/BlogTagsPostsPage/index.js +40 -33
- package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +27 -6
- package/lib-next/theme/DocItem/index.js +78 -63
- package/lib-next/theme/DocPage/index.js +85 -77
- package/lib-next/theme/DocPage/styles.module.css +0 -4
- package/lib-next/theme/DocSidebar/Mobile/index.js +24 -20
- package/lib-next/theme/DocTagDocListPage/index.js +38 -31
- package/lib-next/theme/DocTagsListPage/index.js +21 -16
- package/lib-next/theme/Layout/index.js +15 -10
- package/lib-next/theme/LayoutProviders/index.js +4 -6
- package/lib-next/theme/MDXPage/index.js +32 -26
- package/lib-next/theme/Navbar/ColorModeToggle/index.js +25 -0
- package/lib-next/theme/Navbar/Content/index.js +70 -0
- package/lib-next/theme/Navbar/Content/styles.module.css +15 -0
- package/lib-next/theme/Navbar/Layout/index.js +54 -0
- package/{src/theme/Navbar → lib-next/theme/Navbar/Layout}/styles.module.css +0 -13
- package/lib-next/theme/Navbar/Logo/index.js +17 -0
- package/lib-next/theme/Navbar/MobileSidebar/Header/index.js +33 -0
- package/lib-next/theme/Navbar/MobileSidebar/Layout/index.js +28 -0
- package/lib-next/theme/Navbar/MobileSidebar/PrimaryMenu/index.js +33 -0
- package/lib-next/theme/Navbar/MobileSidebar/SecondaryMenu/index.js +36 -0
- package/lib-next/theme/Navbar/MobileSidebar/Toggle/index.js +23 -0
- package/lib-next/theme/Navbar/MobileSidebar/index.js +31 -0
- package/lib-next/theme/Navbar/index.js +6 -273
- package/lib-next/theme/NotFound.js +38 -33
- package/lib-next/theme/{LayoutHead → SiteMetadata}/index.js +11 -26
- package/package.json +13 -13
- package/src/theme/BlogArchivePage/index.tsx +13 -9
- package/src/theme/BlogListPage/index.tsx +32 -13
- package/src/theme/BlogPostPage/index.tsx +55 -48
- package/src/theme/BlogTagsListPage/index.tsx +16 -12
- package/src/theme/BlogTagsPostsPage/index.tsx +39 -32
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +31 -4
- package/src/theme/DocItem/index.tsx +65 -52
- package/src/theme/DocPage/index.tsx +85 -77
- package/src/theme/DocPage/styles.module.css +0 -4
- package/src/theme/DocSidebar/Mobile/index.tsx +26 -23
- package/src/theme/DocTagDocListPage/index.tsx +38 -30
- package/src/theme/DocTagsListPage/index.tsx +21 -16
- package/src/theme/Layout/index.tsx +15 -10
- package/src/theme/LayoutProviders/index.tsx +4 -6
- package/src/theme/MDXPage/index.tsx +32 -26
- package/src/theme/Navbar/ColorModeToggle/index.tsx +30 -0
- package/src/theme/Navbar/Content/index.tsx +81 -0
- package/src/theme/Navbar/Content/styles.module.css +15 -0
- package/src/theme/Navbar/Layout/index.tsx +57 -0
- package/{lib-next/theme/Navbar → src/theme/Navbar/Layout}/styles.module.css +0 -13
- package/src/theme/Navbar/Logo/index.tsx +19 -0
- package/src/theme/Navbar/MobileSidebar/Header/index.tsx +34 -0
- package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +31 -0
- package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +38 -0
- package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +38 -0
- package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +25 -0
- package/src/theme/Navbar/MobileSidebar/index.tsx +33 -0
- package/src/theme/Navbar/index.tsx +6 -292
- package/src/theme/NotFound.tsx +38 -33
- package/src/theme/{LayoutHead → SiteMetadata}/index.tsx +11 -25
- package/src/theme-classic.d.ts +63 -33
- package/lib-next/theme/Seo/index.js +0 -40
- package/src/theme/Seo/index.tsx +0 -49
package/lib/theme-classic.d.ts
CHANGED
|
@@ -364,31 +364,17 @@ declare module '@theme/Layout' {
|
|
|
364
364
|
|
|
365
365
|
export interface Props {
|
|
366
366
|
readonly children?: ReactNode;
|
|
367
|
-
readonly title?: string;
|
|
368
367
|
readonly noFooter?: boolean;
|
|
369
|
-
readonly description?: string;
|
|
370
|
-
readonly image?: string;
|
|
371
|
-
readonly keywords?: string | string[];
|
|
372
|
-
readonly permalink?: string;
|
|
373
368
|
readonly wrapperClassName?: string;
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
};
|
|
369
|
+
|
|
370
|
+
// Not really layout-related, but kept for convenience/retro-compatibility
|
|
371
|
+
readonly title?: string;
|
|
372
|
+
readonly description?: string;
|
|
379
373
|
}
|
|
380
374
|
|
|
381
375
|
export default function Layout(props: Props): JSX.Element;
|
|
382
376
|
}
|
|
383
377
|
|
|
384
|
-
declare module '@theme/LayoutHead' {
|
|
385
|
-
import type {Props as LayoutProps} from '@theme/Layout';
|
|
386
|
-
|
|
387
|
-
export interface Props extends Omit<LayoutProps, 'children'> {}
|
|
388
|
-
|
|
389
|
-
export default function LayoutHead(props: Props): JSX.Element;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
378
|
declare module '@theme/LayoutProviders' {
|
|
393
379
|
import type {ReactNode} from 'react';
|
|
394
380
|
|
|
@@ -460,6 +446,64 @@ declare module '@theme/Navbar' {
|
|
|
460
446
|
export default function Navbar(): JSX.Element;
|
|
461
447
|
}
|
|
462
448
|
|
|
449
|
+
declare module '@theme/Navbar/ColorModeToggle' {
|
|
450
|
+
export interface Props {
|
|
451
|
+
readonly className?: string;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export default function NavbarColorModeToggle(
|
|
455
|
+
props: Props,
|
|
456
|
+
): JSX.Element | null;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
declare module '@theme/Navbar/Logo' {
|
|
460
|
+
export default function NavbarLogo(): JSX.Element;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
declare module '@theme/Navbar/Content' {
|
|
464
|
+
export default function NavbarContent(): JSX.Element;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
declare module '@theme/Navbar/Layout' {
|
|
468
|
+
export interface Props {
|
|
469
|
+
readonly children: React.ReactNode;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export default function NavbarLayout(props: Props): JSX.Element;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
declare module '@theme/Navbar/MobileSidebar' {
|
|
476
|
+
export default function NavbarMobileSidebar(): JSX.Element;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
declare module '@theme/Navbar/MobileSidebar/Layout' {
|
|
480
|
+
import type {ReactNode} from 'react';
|
|
481
|
+
|
|
482
|
+
interface Props {
|
|
483
|
+
header: ReactNode;
|
|
484
|
+
primaryMenu: ReactNode;
|
|
485
|
+
secondaryMenu: ReactNode;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export default function NavbarMobileSidebarLayout(props: Props): JSX.Element;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
declare module '@theme/Navbar/MobileSidebar/Toggle' {
|
|
492
|
+
export default function NavbarMobileSidebarToggle(): JSX.Element;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
declare module '@theme/Navbar/MobileSidebar/PrimaryMenu' {
|
|
496
|
+
export default function NavbarMobileSidebarPrimaryMenu(): JSX.Element;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
declare module '@theme/Navbar/MobileSidebar/SecondaryMenu' {
|
|
500
|
+
export default function NavbarMobileSidebarSecondaryMenu(): JSX.Element;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
declare module '@theme/Navbar/MobileSidebar/Header' {
|
|
504
|
+
export default function NavbarMobileSidebarHeader(): JSX.Element;
|
|
505
|
+
}
|
|
506
|
+
|
|
463
507
|
declare module '@theme/NavbarItem/DefaultNavbarItem' {
|
|
464
508
|
import type {Props as NavbarNavLinkProps} from '@theme/NavbarItem/NavbarNavLink';
|
|
465
509
|
|
|
@@ -758,7 +802,7 @@ declare module '@theme/ColorModeToggle' {
|
|
|
758
802
|
readonly onChange: (colorMode: ColorMode) => void;
|
|
759
803
|
}
|
|
760
804
|
|
|
761
|
-
export default function
|
|
805
|
+
export default function ColorModeToggle(props: Props): JSX.Element;
|
|
762
806
|
}
|
|
763
807
|
|
|
764
808
|
declare module '@theme/Logo' {
|
|
@@ -869,17 +913,3 @@ declare module '@theme/prism-include-languages' {
|
|
|
869
913
|
PrismObject: typeof PrismNamespace,
|
|
870
914
|
): void;
|
|
871
915
|
}
|
|
872
|
-
|
|
873
|
-
declare module '@theme/Seo' {
|
|
874
|
-
import type {ReactNode} from 'react';
|
|
875
|
-
|
|
876
|
-
export interface Props {
|
|
877
|
-
readonly title?: string;
|
|
878
|
-
readonly description?: string;
|
|
879
|
-
readonly keywords?: readonly string[] | string;
|
|
880
|
-
readonly image?: string;
|
|
881
|
-
readonly children?: ReactNode;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
export default function Seo(props: Props): JSX.Element;
|
|
885
|
-
}
|
|
@@ -8,6 +8,7 @@ import React from 'react';
|
|
|
8
8
|
import Layout from '@theme/Layout';
|
|
9
9
|
import Link from '@docusaurus/Link';
|
|
10
10
|
import {translate} from '@docusaurus/Translate';
|
|
11
|
+
import {PageMetadata} from '@docusaurus/theme-common';
|
|
11
12
|
|
|
12
13
|
function Year({year, posts}) {
|
|
13
14
|
return (
|
|
@@ -67,14 +68,17 @@ export default function BlogArchive({archive}) {
|
|
|
67
68
|
});
|
|
68
69
|
const years = listPostsByYears(archive.blogPosts);
|
|
69
70
|
return (
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
<>
|
|
72
|
+
<PageMetadata title={title} description={description} />
|
|
73
|
+
<Layout>
|
|
74
|
+
<header className="hero hero--primary">
|
|
75
|
+
<div className="container">
|
|
76
|
+
<h1 className="hero__title">{title}</h1>
|
|
77
|
+
<p className="hero__subtitle">{description}</p>
|
|
78
|
+
</div>
|
|
79
|
+
</header>
|
|
80
|
+
<main>{years.length > 0 && <YearsSection years={years} />}</main>
|
|
81
|
+
</Layout>
|
|
82
|
+
</>
|
|
79
83
|
);
|
|
80
84
|
}
|
|
@@ -9,9 +9,16 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
|
9
9
|
import BlogLayout from '@theme/BlogLayout';
|
|
10
10
|
import BlogPostItem from '@theme/BlogPostItem';
|
|
11
11
|
import BlogListPaginator from '@theme/BlogListPaginator';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
import {
|
|
13
|
+
PageMetadata,
|
|
14
|
+
HtmlClassNameProvider,
|
|
15
|
+
ThemeClassNames,
|
|
16
|
+
} from '@docusaurus/theme-common';
|
|
17
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
18
|
+
import clsx from 'clsx';
|
|
19
|
+
|
|
20
|
+
function BlogListPageMetadata(props) {
|
|
21
|
+
const {metadata} = props;
|
|
15
22
|
const {
|
|
16
23
|
siteConfig: {title: siteTitle},
|
|
17
24
|
} = useDocusaurusContext();
|
|
@@ -19,16 +26,17 @@ export default function BlogListPage(props) {
|
|
|
19
26
|
const isBlogOnlyMode = permalink === '/';
|
|
20
27
|
const title = isBlogOnlyMode ? siteTitle : blogTitle;
|
|
21
28
|
return (
|
|
22
|
-
|
|
23
|
-
title={title}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
<>
|
|
30
|
+
<PageMetadata title={title} description={blogDescription} />
|
|
31
|
+
<SearchMetadata tag="blog_posts_list" />
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function BlogListPageContent(props) {
|
|
37
|
+
const {metadata, items, sidebar} = props;
|
|
38
|
+
return (
|
|
39
|
+
<BlogLayout sidebar={sidebar}>
|
|
32
40
|
{items.map(({content: BlogPostContent}) => (
|
|
33
41
|
<BlogPostItem
|
|
34
42
|
key={BlogPostContent.metadata.permalink}
|
|
@@ -43,3 +51,16 @@ export default function BlogListPage(props) {
|
|
|
43
51
|
</BlogLayout>
|
|
44
52
|
);
|
|
45
53
|
}
|
|
54
|
+
|
|
55
|
+
export default function BlogListPage(props) {
|
|
56
|
+
return (
|
|
57
|
+
<HtmlClassNameProvider
|
|
58
|
+
className={clsx(
|
|
59
|
+
ThemeClassNames.wrapper.blogPages,
|
|
60
|
+
ThemeClassNames.page.blogListPage,
|
|
61
|
+
)}>
|
|
62
|
+
<BlogListPageMetadata {...props} />
|
|
63
|
+
<BlogListPageContent {...props} />
|
|
64
|
+
</HtmlClassNameProvider>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -5,36 +5,62 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import Seo from '@theme/Seo';
|
|
9
8
|
import BlogLayout from '@theme/BlogLayout';
|
|
10
9
|
import BlogPostItem from '@theme/BlogPostItem';
|
|
11
10
|
import BlogPostPaginator from '@theme/BlogPostPaginator';
|
|
12
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
PageMetadata,
|
|
13
|
+
HtmlClassNameProvider,
|
|
14
|
+
ThemeClassNames,
|
|
15
|
+
} from '@docusaurus/theme-common';
|
|
13
16
|
import TOC from '@theme/TOC';
|
|
14
|
-
|
|
17
|
+
import clsx from 'clsx';
|
|
18
|
+
|
|
19
|
+
function BlogPostPageMetadata(props) {
|
|
20
|
+
const {content: BlogPostContents} = props;
|
|
21
|
+
const {assets, metadata} = BlogPostContents;
|
|
22
|
+
const {title, description, date, tags, authors, frontMatter} = metadata;
|
|
23
|
+
const {keywords} = frontMatter;
|
|
24
|
+
const image = assets.image ?? frontMatter.image;
|
|
25
|
+
return (
|
|
26
|
+
<PageMetadata
|
|
27
|
+
title={title}
|
|
28
|
+
description={description}
|
|
29
|
+
keywords={keywords}
|
|
30
|
+
image={image}>
|
|
31
|
+
<meta property="og:type" content="article" />
|
|
32
|
+
<meta property="article:published_time" content={date} />
|
|
33
|
+
{/* TODO double check those article meta array syntaxes, see https://ogp.me/#array */}
|
|
34
|
+
{authors.some((author) => author.url) && (
|
|
35
|
+
<meta
|
|
36
|
+
property="article:author"
|
|
37
|
+
content={authors
|
|
38
|
+
.map((author) => author.url)
|
|
39
|
+
.filter(Boolean)
|
|
40
|
+
.join(',')}
|
|
41
|
+
/>
|
|
42
|
+
)}
|
|
43
|
+
{tags.length > 0 && (
|
|
44
|
+
<meta
|
|
45
|
+
property="article:tag"
|
|
46
|
+
content={tags.map((tag) => tag.label).join(',')}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
</PageMetadata>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function BlogPostPageContent(props) {
|
|
15
54
|
const {content: BlogPostContents, sidebar} = props;
|
|
16
55
|
const {assets, metadata} = BlogPostContents;
|
|
17
|
-
const {
|
|
18
|
-
title,
|
|
19
|
-
description,
|
|
20
|
-
nextItem,
|
|
21
|
-
prevItem,
|
|
22
|
-
date,
|
|
23
|
-
tags,
|
|
24
|
-
authors,
|
|
25
|
-
frontMatter,
|
|
26
|
-
} = metadata;
|
|
56
|
+
const {nextItem, prevItem, frontMatter} = metadata;
|
|
27
57
|
const {
|
|
28
58
|
hide_table_of_contents: hideTableOfContents,
|
|
29
|
-
keywords,
|
|
30
59
|
toc_min_heading_level: tocMinHeadingLevel,
|
|
31
60
|
toc_max_heading_level: tocMaxHeadingLevel,
|
|
32
61
|
} = frontMatter;
|
|
33
|
-
const image = assets.image ?? frontMatter.image;
|
|
34
62
|
return (
|
|
35
63
|
<BlogLayout
|
|
36
|
-
wrapperClassName={ThemeClassNames.wrapper.blogPages}
|
|
37
|
-
pageClassName={ThemeClassNames.page.blogPostPage}
|
|
38
64
|
sidebar={sidebar}
|
|
39
65
|
toc={
|
|
40
66
|
!hideTableOfContents &&
|
|
@@ -47,34 +73,6 @@ export default function BlogPostPage(props) {
|
|
|
47
73
|
/>
|
|
48
74
|
) : undefined
|
|
49
75
|
}>
|
|
50
|
-
<Seo // TODO refactor needed: it's a bit annoying but Seo MUST be inside
|
|
51
|
-
// BlogLayout, otherwise default image (set by BlogLayout) would shadow
|
|
52
|
-
// the custom blog post image
|
|
53
|
-
title={title}
|
|
54
|
-
description={description}
|
|
55
|
-
keywords={keywords}
|
|
56
|
-
image={image}>
|
|
57
|
-
<meta property="og:type" content="article" />
|
|
58
|
-
<meta property="article:published_time" content={date} />
|
|
59
|
-
|
|
60
|
-
{/* TODO double check those article meta array syntaxes, see https://ogp.me/#array */}
|
|
61
|
-
{authors.some((author) => author.url) && (
|
|
62
|
-
<meta
|
|
63
|
-
property="article:author"
|
|
64
|
-
content={authors
|
|
65
|
-
.map((author) => author.url)
|
|
66
|
-
.filter(Boolean)
|
|
67
|
-
.join(',')}
|
|
68
|
-
/>
|
|
69
|
-
)}
|
|
70
|
-
{tags.length > 0 && (
|
|
71
|
-
<meta
|
|
72
|
-
property="article:tag"
|
|
73
|
-
content={tags.map((tag) => tag.label).join(',')}
|
|
74
|
-
/>
|
|
75
|
-
)}
|
|
76
|
-
</Seo>
|
|
77
|
-
|
|
78
76
|
<BlogPostItem
|
|
79
77
|
frontMatter={frontMatter}
|
|
80
78
|
assets={assets}
|
|
@@ -89,3 +87,16 @@ export default function BlogPostPage(props) {
|
|
|
89
87
|
</BlogLayout>
|
|
90
88
|
);
|
|
91
89
|
}
|
|
90
|
+
|
|
91
|
+
export default function BlogPostPage(props) {
|
|
92
|
+
return (
|
|
93
|
+
<HtmlClassNameProvider
|
|
94
|
+
className={clsx(
|
|
95
|
+
ThemeClassNames.wrapper.blogPages,
|
|
96
|
+
ThemeClassNames.page.blogPostPage,
|
|
97
|
+
)}>
|
|
98
|
+
<BlogPostPageMetadata {...props} />
|
|
99
|
+
<BlogPostPageContent {...props} />
|
|
100
|
+
</HtmlClassNameProvider>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
@@ -8,24 +8,28 @@ import React from 'react';
|
|
|
8
8
|
import BlogLayout from '@theme/BlogLayout';
|
|
9
9
|
import TagsListByLetter from '@theme/TagsListByLetter';
|
|
10
10
|
import {
|
|
11
|
+
PageMetadata,
|
|
12
|
+
HtmlClassNameProvider,
|
|
11
13
|
ThemeClassNames,
|
|
12
14
|
translateTagsPageTitle,
|
|
13
15
|
} from '@docusaurus/theme-common';
|
|
16
|
+
import SearchMetadata from '../SearchMetadata';
|
|
17
|
+
import clsx from 'clsx';
|
|
14
18
|
export default function BlogTagsListPage(props) {
|
|
15
19
|
const {tags, sidebar} = props;
|
|
16
20
|
const title = translateTagsPageTitle();
|
|
17
21
|
return (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</
|
|
22
|
+
<HtmlClassNameProvider
|
|
23
|
+
className={clsx(
|
|
24
|
+
ThemeClassNames.wrapper.blogPages,
|
|
25
|
+
ThemeClassNames.page.blogTagsListPage,
|
|
26
|
+
)}>
|
|
27
|
+
<PageMetadata title={title} />
|
|
28
|
+
<SearchMetadata tag="blog_tags_list" />
|
|
29
|
+
<BlogLayout sidebar={sidebar}>
|
|
30
|
+
<h1>{title}</h1>
|
|
31
|
+
<TagsListByLetter tags={Object.values(tags)} />
|
|
32
|
+
</BlogLayout>
|
|
33
|
+
</HtmlClassNameProvider>
|
|
30
34
|
);
|
|
31
35
|
}
|
|
@@ -9,8 +9,15 @@ import Link from '@docusaurus/Link';
|
|
|
9
9
|
import BlogLayout from '@theme/BlogLayout';
|
|
10
10
|
import BlogPostItem from '@theme/BlogPostItem';
|
|
11
11
|
import Translate, {translate} from '@docusaurus/Translate';
|
|
12
|
-
import {
|
|
13
|
-
|
|
12
|
+
import {
|
|
13
|
+
PageMetadata,
|
|
14
|
+
HtmlClassNameProvider,
|
|
15
|
+
ThemeClassNames,
|
|
16
|
+
usePluralForm,
|
|
17
|
+
} from '@docusaurus/theme-common';
|
|
18
|
+
import BlogListPaginator from '@theme/BlogListPaginator';
|
|
19
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
20
|
+
import clsx from 'clsx'; // Very simple pluralization: probably good enough for now
|
|
14
21
|
|
|
15
22
|
function useBlogPostsPlural() {
|
|
16
23
|
const {selectMessage} = usePluralForm();
|
|
@@ -47,38 +54,38 @@ export default function BlogTagsPostsPage(props) {
|
|
|
47
54
|
},
|
|
48
55
|
);
|
|
49
56
|
return (
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<h1>{title}</h1>
|
|
57
|
+
<HtmlClassNameProvider
|
|
58
|
+
className={clsx(
|
|
59
|
+
ThemeClassNames.wrapper.blogPages,
|
|
60
|
+
ThemeClassNames.page.blogTagPostListPage,
|
|
61
|
+
)}>
|
|
62
|
+
<PageMetadata title={title} />
|
|
63
|
+
<SearchMetadata tag="blog_tags_posts" />
|
|
64
|
+
<BlogLayout sidebar={sidebar}>
|
|
65
|
+
<header className="margin-bottom--xl">
|
|
66
|
+
<h1>{title}</h1>
|
|
61
67
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
<Link href={allTagsPath}>
|
|
69
|
+
<Translate
|
|
70
|
+
id="theme.tags.tagsPageLink"
|
|
71
|
+
description="The label of the link targeting the tag list page">
|
|
72
|
+
View All Tags
|
|
73
|
+
</Translate>
|
|
74
|
+
</Link>
|
|
75
|
+
</header>
|
|
70
76
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
{items.map(({content: BlogPostContent}) => (
|
|
78
|
+
<BlogPostItem
|
|
79
|
+
key={BlogPostContent.metadata.permalink}
|
|
80
|
+
frontMatter={BlogPostContent.frontMatter}
|
|
81
|
+
assets={BlogPostContent.assets}
|
|
82
|
+
metadata={BlogPostContent.metadata}
|
|
83
|
+
truncated>
|
|
84
|
+
<BlogPostContent />
|
|
85
|
+
</BlogPostItem>
|
|
86
|
+
))}
|
|
87
|
+
<BlogListPaginator metadata={listMetadata} />
|
|
88
|
+
</BlogLayout>
|
|
89
|
+
</HtmlClassNameProvider>
|
|
83
90
|
);
|
|
84
91
|
}
|
|
@@ -5,23 +5,35 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
PageMetadata,
|
|
10
|
+
useCurrentSidebarCategory,
|
|
11
|
+
} from '@docusaurus/theme-common';
|
|
9
12
|
import DocCardList from '@theme/DocCardList';
|
|
10
13
|
import DocPaginator from '@theme/DocPaginator';
|
|
11
|
-
import Seo from '@theme/Seo';
|
|
12
14
|
import DocVersionBanner from '@theme/DocVersionBanner';
|
|
13
15
|
import DocVersionBadge from '@theme/DocVersionBadge';
|
|
14
16
|
import DocBreadcrumbs from '@theme/DocBreadcrumbs';
|
|
15
17
|
import Heading from '@theme/Heading';
|
|
16
18
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
17
19
|
import styles from './styles.module.css';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
function DocCategoryGeneratedIndexPageMetadata({categoryGeneratedIndex}) {
|
|
22
|
+
return (
|
|
23
|
+
<PageMetadata
|
|
24
|
+
title={categoryGeneratedIndex.title}
|
|
25
|
+
description={categoryGeneratedIndex.description}
|
|
26
|
+
keywords={categoryGeneratedIndex.keywords} // TODO `require` this?
|
|
27
|
+
image={useBaseUrl(categoryGeneratedIndex.image)}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function DocCategoryGeneratedIndexPageContent({categoryGeneratedIndex}) {
|
|
21
33
|
const category = useCurrentSidebarCategory();
|
|
22
34
|
return (
|
|
23
35
|
<>
|
|
24
|
-
<
|
|
36
|
+
<PageMetadata
|
|
25
37
|
title={categoryGeneratedIndex.title}
|
|
26
38
|
description={categoryGeneratedIndex.description}
|
|
27
39
|
keywords={categoryGeneratedIndex.keywords} // TODO `require` this?
|
|
@@ -52,3 +64,12 @@ export default function DocCategoryGeneratedIndexPage({
|
|
|
52
64
|
</>
|
|
53
65
|
);
|
|
54
66
|
}
|
|
67
|
+
|
|
68
|
+
export default function DocCategoryGeneratedIndexPage(props) {
|
|
69
|
+
return (
|
|
70
|
+
<>
|
|
71
|
+
<DocCategoryGeneratedIndexPageMetadata {...props} />
|
|
72
|
+
<DocCategoryGeneratedIndexPageContent {...props} />
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
}
|