@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.
Files changed (65) hide show
  1. package/lib/theme-classic.d.ts +63 -33
  2. package/lib-next/theme/BlogArchivePage/index.js +13 -9
  3. package/lib-next/theme/BlogListPage/index.js +34 -13
  4. package/lib-next/theme/BlogPostPage/index.js +56 -45
  5. package/lib-next/theme/BlogTagsListPage/index.js +16 -12
  6. package/lib-next/theme/BlogTagsPostsPage/index.js +40 -33
  7. package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +27 -6
  8. package/lib-next/theme/DocItem/index.js +78 -63
  9. package/lib-next/theme/DocPage/index.js +85 -77
  10. package/lib-next/theme/DocPage/styles.module.css +0 -4
  11. package/lib-next/theme/DocSidebar/Mobile/index.js +24 -20
  12. package/lib-next/theme/DocTagDocListPage/index.js +38 -31
  13. package/lib-next/theme/DocTagsListPage/index.js +21 -16
  14. package/lib-next/theme/Layout/index.js +15 -10
  15. package/lib-next/theme/LayoutProviders/index.js +4 -6
  16. package/lib-next/theme/MDXPage/index.js +32 -26
  17. package/lib-next/theme/Navbar/ColorModeToggle/index.js +25 -0
  18. package/lib-next/theme/Navbar/Content/index.js +70 -0
  19. package/lib-next/theme/Navbar/Content/styles.module.css +15 -0
  20. package/lib-next/theme/Navbar/Layout/index.js +54 -0
  21. package/{src/theme/Navbar → lib-next/theme/Navbar/Layout}/styles.module.css +0 -13
  22. package/lib-next/theme/Navbar/Logo/index.js +17 -0
  23. package/lib-next/theme/Navbar/MobileSidebar/Header/index.js +33 -0
  24. package/lib-next/theme/Navbar/MobileSidebar/Layout/index.js +28 -0
  25. package/lib-next/theme/Navbar/MobileSidebar/PrimaryMenu/index.js +33 -0
  26. package/lib-next/theme/Navbar/MobileSidebar/SecondaryMenu/index.js +36 -0
  27. package/lib-next/theme/Navbar/MobileSidebar/Toggle/index.js +23 -0
  28. package/lib-next/theme/Navbar/MobileSidebar/index.js +31 -0
  29. package/lib-next/theme/Navbar/index.js +6 -273
  30. package/lib-next/theme/NotFound.js +38 -33
  31. package/lib-next/theme/{LayoutHead → SiteMetadata}/index.js +11 -26
  32. package/package.json +13 -13
  33. package/src/theme/BlogArchivePage/index.tsx +13 -9
  34. package/src/theme/BlogListPage/index.tsx +32 -13
  35. package/src/theme/BlogPostPage/index.tsx +55 -48
  36. package/src/theme/BlogTagsListPage/index.tsx +16 -12
  37. package/src/theme/BlogTagsPostsPage/index.tsx +39 -32
  38. package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +31 -4
  39. package/src/theme/DocItem/index.tsx +65 -52
  40. package/src/theme/DocPage/index.tsx +85 -77
  41. package/src/theme/DocPage/styles.module.css +0 -4
  42. package/src/theme/DocSidebar/Mobile/index.tsx +26 -23
  43. package/src/theme/DocTagDocListPage/index.tsx +38 -30
  44. package/src/theme/DocTagsListPage/index.tsx +21 -16
  45. package/src/theme/Layout/index.tsx +15 -10
  46. package/src/theme/LayoutProviders/index.tsx +4 -6
  47. package/src/theme/MDXPage/index.tsx +32 -26
  48. package/src/theme/Navbar/ColorModeToggle/index.tsx +30 -0
  49. package/src/theme/Navbar/Content/index.tsx +81 -0
  50. package/src/theme/Navbar/Content/styles.module.css +15 -0
  51. package/src/theme/Navbar/Layout/index.tsx +57 -0
  52. package/{lib-next/theme/Navbar → src/theme/Navbar/Layout}/styles.module.css +0 -13
  53. package/src/theme/Navbar/Logo/index.tsx +19 -0
  54. package/src/theme/Navbar/MobileSidebar/Header/index.tsx +34 -0
  55. package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +31 -0
  56. package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +38 -0
  57. package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +38 -0
  58. package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +25 -0
  59. package/src/theme/Navbar/MobileSidebar/index.tsx +33 -0
  60. package/src/theme/Navbar/index.tsx +6 -292
  61. package/src/theme/NotFound.tsx +38 -33
  62. package/src/theme/{LayoutHead → SiteMetadata}/index.tsx +11 -25
  63. package/src/theme-classic.d.ts +63 -33
  64. package/lib-next/theme/Seo/index.js +0 -40
  65. package/src/theme/Seo/index.tsx +0 -49
@@ -9,31 +9,48 @@ import clsx from 'clsx';
9
9
  import DocPaginator from '@theme/DocPaginator';
10
10
  import DocVersionBanner from '@theme/DocVersionBanner';
11
11
  import DocVersionBadge from '@theme/DocVersionBadge';
12
- import Seo from '@theme/Seo';
13
12
  import DocItemFooter from '@theme/DocItemFooter';
14
13
  import TOC from '@theme/TOC';
15
14
  import TOCCollapsible from '@theme/TOCCollapsible';
16
15
  import Heading from '@theme/Heading';
17
16
  import styles from './styles.module.css';
18
17
  import {
18
+ PageMetadata,
19
19
  HtmlClassNameProvider,
20
20
  ThemeClassNames,
21
21
  useWindowSize,
22
22
  } from '@docusaurus/theme-common';
23
23
  import DocBreadcrumbs from '@theme/DocBreadcrumbs';
24
24
  import MDXContent from '@theme/MDXContent';
25
- export default function DocItem(props) {
25
+
26
+ function DocItemMetadata(props) {
26
27
  const {content: DocContent} = props;
27
28
  const {metadata, frontMatter, assets} = DocContent;
29
+ const {keywords} = frontMatter;
30
+ const {description, title} = metadata;
31
+ const image = assets.image ?? frontMatter.image;
32
+ return (
33
+ <PageMetadata
34
+ {...{
35
+ title,
36
+ description,
37
+ keywords,
38
+ image,
39
+ }}
40
+ />
41
+ );
42
+ }
43
+
44
+ function DocItemContent(props) {
45
+ const {content: DocContent} = props;
46
+ const {metadata, frontMatter} = DocContent;
28
47
  const {
29
- keywords,
30
48
  hide_title: hideTitle,
31
49
  hide_table_of_contents: hideTableOfContents,
32
50
  toc_min_heading_level: tocMinHeadingLevel,
33
51
  toc_max_heading_level: tocMaxHeadingLevel,
34
52
  } = frontMatter;
35
- const {description, title} = metadata;
36
- const image = assets.image ?? frontMatter.image; // We only add a title if:
53
+ const {title} = metadata; // We only add a title if:
37
54
  // - user asks to hide it with front matter
38
55
  // - the markdown content does not already contain a top-level h1 heading
39
56
 
@@ -45,71 +62,69 @@ export default function DocItem(props) {
45
62
  const renderTocDesktop =
46
63
  canRenderTOC && (windowSize === 'desktop' || windowSize === 'ssr');
47
64
  return (
48
- <HtmlClassNameProvider className={`docs-doc-id-${metadata.unversionedId}`}>
49
- <Seo
50
- {...{
51
- title,
52
- description,
53
- keywords,
54
- image,
55
- }}
56
- />
65
+ <div className="row">
66
+ <div className={clsx('col', !hideTableOfContents && styles.docItemCol)}>
67
+ <DocVersionBanner />
68
+ <div className={styles.docItemContainer}>
69
+ <article>
70
+ <DocBreadcrumbs />
71
+ <DocVersionBadge />
57
72
 
58
- <div className="row">
59
- <div className={clsx('col', !hideTableOfContents && styles.docItemCol)}>
60
- <DocVersionBanner />
61
- <div className={styles.docItemContainer}>
62
- <article>
63
- <DocBreadcrumbs />
64
- <DocVersionBadge />
73
+ {canRenderTOC && (
74
+ <TOCCollapsible
75
+ toc={DocContent.toc}
76
+ minHeadingLevel={tocMinHeadingLevel}
77
+ maxHeadingLevel={tocMaxHeadingLevel}
78
+ className={clsx(
79
+ ThemeClassNames.docs.docTocMobile,
80
+ styles.tocMobile,
81
+ )}
82
+ />
83
+ )}
65
84
 
66
- {canRenderTOC && (
67
- <TOCCollapsible
68
- toc={DocContent.toc}
69
- minHeadingLevel={tocMinHeadingLevel}
70
- maxHeadingLevel={tocMaxHeadingLevel}
71
- className={clsx(
72
- ThemeClassNames.docs.docTocMobile,
73
- styles.tocMobile,
74
- )}
75
- />
85
+ <div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
86
+ {/*
87
+ Title can be declared inside md content or declared through
88
+ front matter and added manually. To make both cases consistent,
89
+ the added title is added under the same div.markdown block
90
+ See https://github.com/facebook/docusaurus/pull/4882#issuecomment-853021120
91
+ */}
92
+ {shouldAddTitle && (
93
+ <header>
94
+ <Heading as="h1">{title}</Heading>
95
+ </header>
76
96
  )}
97
+ <MDXContent>
98
+ <DocContent />
99
+ </MDXContent>
100
+ </div>
77
101
 
78
- <div
79
- className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
80
- {/*
81
- Title can be declared inside md content or declared through
82
- front matter and added manually. To make both cases consistent,
83
- the added title is added under the same div.markdown block
84
- See https://github.com/facebook/docusaurus/pull/4882#issuecomment-853021120
85
- */}
86
- {shouldAddTitle && (
87
- <header>
88
- <Heading as="h1">{title}</Heading>
89
- </header>
90
- )}
91
- <MDXContent>
92
- <DocContent />
93
- </MDXContent>
94
- </div>
95
-
96
- <DocItemFooter {...props} />
97
- </article>
102
+ <DocItemFooter {...props} />
103
+ </article>
98
104
 
99
- <DocPaginator previous={metadata.previous} next={metadata.next} />
100
- </div>
105
+ <DocPaginator previous={metadata.previous} next={metadata.next} />
101
106
  </div>
102
- {renderTocDesktop && (
103
- <div className="col col--3">
104
- <TOC
105
- toc={DocContent.toc}
106
- minHeadingLevel={tocMinHeadingLevel}
107
- maxHeadingLevel={tocMaxHeadingLevel}
108
- className={ThemeClassNames.docs.docTocDesktop}
109
- />
110
- </div>
111
- )}
112
107
  </div>
108
+ {renderTocDesktop && (
109
+ <div className="col col--3">
110
+ <TOC
111
+ toc={DocContent.toc}
112
+ minHeadingLevel={tocMinHeadingLevel}
113
+ maxHeadingLevel={tocMaxHeadingLevel}
114
+ className={ThemeClassNames.docs.docTocDesktop}
115
+ />
116
+ </div>
117
+ )}
118
+ </div>
119
+ );
120
+ }
121
+
122
+ export default function DocItem(props) {
123
+ const docHtmlClassName = `docs-doc-id-${props.content.metadata.unversionedId}`;
124
+ return (
125
+ <HtmlClassNameProvider className={docHtmlClassName}>
126
+ <DocItemMetadata {...props} />
127
+ <DocItemContent {...props} />
113
128
  </HtmlClassNameProvider>
114
129
  );
115
130
  }
@@ -23,6 +23,7 @@ import {
23
23
  useDocsSidebar,
24
24
  DocsVersionProvider,
25
25
  } from '@docusaurus/theme-common';
26
+ import SearchMetadata from '@theme/SearchMetadata';
26
27
 
27
28
  function DocPageContent({
28
29
  currentDocRoute,
@@ -42,87 +43,89 @@ function DocPageContent({
42
43
  setHiddenSidebarContainer((value) => !value);
43
44
  }, [hiddenSidebar]);
44
45
  return (
45
- <Layout
46
- wrapperClassName={ThemeClassNames.wrapper.docsPages}
47
- pageClassName={ThemeClassNames.page.docsDocPage}
48
- searchMetadata={{
49
- version,
50
- tag: docVersionSearchTag(pluginId, version),
51
- }}>
52
- <div className={styles.docPage}>
53
- <BackToTopButton />
46
+ <>
47
+ <SearchMetadata
48
+ version={version}
49
+ tag={docVersionSearchTag(pluginId, version)}
50
+ />
51
+ <Layout>
52
+ <div className={styles.docPage}>
53
+ <BackToTopButton />
54
54
 
55
- {sidebar && (
56
- <aside
57
- className={clsx(
58
- ThemeClassNames.docs.docSidebarContainer,
59
- styles.docSidebarContainer,
60
- hiddenSidebarContainer && styles.docSidebarContainerHidden,
61
- )}
62
- onTransitionEnd={(e) => {
63
- if (
64
- !e.currentTarget.classList.contains(styles.docSidebarContainer)
65
- ) {
66
- return;
67
- }
55
+ {sidebar && (
56
+ <aside
57
+ className={clsx(
58
+ ThemeClassNames.docs.docSidebarContainer,
59
+ styles.docSidebarContainer,
60
+ hiddenSidebarContainer && styles.docSidebarContainerHidden,
61
+ )}
62
+ onTransitionEnd={(e) => {
63
+ if (
64
+ !e.currentTarget.classList.contains(
65
+ styles.docSidebarContainer,
66
+ )
67
+ ) {
68
+ return;
69
+ }
68
70
 
69
- if (hiddenSidebarContainer) {
70
- setHiddenSidebar(true);
71
- }
72
- }}>
73
- <DocSidebar
74
- key={
75
- // Reset sidebar state on sidebar changes
76
- // See https://github.com/facebook/docusaurus/issues/3414
77
- sidebarName
78
- }
79
- sidebar={sidebar}
80
- path={currentDocRoute.path}
81
- onCollapse={toggleSidebar}
82
- isHidden={hiddenSidebar}
83
- />
71
+ if (hiddenSidebarContainer) {
72
+ setHiddenSidebar(true);
73
+ }
74
+ }}>
75
+ <DocSidebar
76
+ key={
77
+ // Reset sidebar state on sidebar changes
78
+ // See https://github.com/facebook/docusaurus/issues/3414
79
+ sidebarName
80
+ }
81
+ sidebar={sidebar}
82
+ path={currentDocRoute.path}
83
+ onCollapse={toggleSidebar}
84
+ isHidden={hiddenSidebar}
85
+ />
84
86
 
85
- {hiddenSidebar && (
86
- <div
87
- className={styles.collapsedDocSidebar}
88
- title={translate({
89
- id: 'theme.docs.sidebar.expandButtonTitle',
90
- message: 'Expand sidebar',
91
- description:
92
- 'The ARIA label and title attribute for expand button of doc sidebar',
93
- })}
94
- aria-label={translate({
95
- id: 'theme.docs.sidebar.expandButtonAriaLabel',
96
- message: 'Expand sidebar',
97
- description:
98
- 'The ARIA label and title attribute for expand button of doc sidebar',
99
- })}
100
- tabIndex={0}
101
- role="button"
102
- onKeyDown={toggleSidebar}
103
- onClick={toggleSidebar}>
104
- <IconArrow className={styles.expandSidebarButtonIcon} />
105
- </div>
106
- )}
107
- </aside>
108
- )}
109
- <main
110
- className={clsx(
111
- styles.docMainContainer,
112
- (hiddenSidebarContainer || !sidebar) &&
113
- styles.docMainContainerEnhanced,
114
- )}>
115
- <div
87
+ {hiddenSidebar && (
88
+ <div
89
+ className={styles.collapsedDocSidebar}
90
+ title={translate({
91
+ id: 'theme.docs.sidebar.expandButtonTitle',
92
+ message: 'Expand sidebar',
93
+ description:
94
+ 'The ARIA label and title attribute for expand button of doc sidebar',
95
+ })}
96
+ aria-label={translate({
97
+ id: 'theme.docs.sidebar.expandButtonAriaLabel',
98
+ message: 'Expand sidebar',
99
+ description:
100
+ 'The ARIA label and title attribute for expand button of doc sidebar',
101
+ })}
102
+ tabIndex={0}
103
+ role="button"
104
+ onKeyDown={toggleSidebar}
105
+ onClick={toggleSidebar}>
106
+ <IconArrow className={styles.expandSidebarButtonIcon} />
107
+ </div>
108
+ )}
109
+ </aside>
110
+ )}
111
+ <main
116
112
  className={clsx(
117
- 'container padding-top--md padding-bottom--lg',
118
- styles.docItemWrapper,
119
- hiddenSidebarContainer && styles.docItemWrapperEnhanced,
113
+ styles.docMainContainer,
114
+ (hiddenSidebarContainer || !sidebar) &&
115
+ styles.docMainContainerEnhanced,
120
116
  )}>
121
- {children}
122
- </div>
123
- </main>
124
- </div>
125
- </Layout>
117
+ <div
118
+ className={clsx(
119
+ 'container padding-top--md padding-bottom--lg',
120
+ styles.docItemWrapper,
121
+ hiddenSidebarContainer && styles.docItemWrapperEnhanced,
122
+ )}>
123
+ {children}
124
+ </div>
125
+ </main>
126
+ </div>
127
+ </Layout>
128
+ </>
126
129
  );
127
130
  }
128
131
 
@@ -145,7 +148,12 @@ export default function DocPage(props) {
145
148
  ? versionMetadata.docsSidebars[sidebarName]
146
149
  : null;
147
150
  return (
148
- <HtmlClassNameProvider className={versionMetadata.className}>
151
+ <HtmlClassNameProvider
152
+ className={clsx(
153
+ ThemeClassNames.wrapper.docsPages,
154
+ ThemeClassNames.page.docsDocPage,
155
+ versionMetadata.className,
156
+ )}>
149
157
  <DocsVersionProvider version={versionMetadata}>
150
158
  <DocsSidebarProvider sidebar={sidebar ?? null}>
151
159
  <DocPageContent
@@ -10,10 +10,6 @@
10
10
  --doc-sidebar-hidden-width: 30px;
11
11
  }
12
12
 
13
- :global(.docs-wrapper) {
14
- display: flex;
15
- }
16
-
17
13
  .docPage,
18
14
  .docMainContainer {
19
15
  display: flex;
@@ -7,35 +7,39 @@
7
7
  import React from 'react';
8
8
  import clsx from 'clsx';
9
9
  import {
10
- MobileSecondaryMenuFiller,
10
+ NavbarSecondaryMenuFiller,
11
11
  ThemeClassNames,
12
+ useNavbarMobileSidebar,
12
13
  } from '@docusaurus/theme-common';
13
14
  import DocSidebarItems from '@theme/DocSidebarItems';
14
15
 
15
16
  // eslint-disable-next-line react/function-component-definition
16
- const DocSidebarMobileSecondaryMenu = ({toggleSidebar, sidebar, path}) => (
17
- <ul className={clsx(ThemeClassNames.docs.docSidebarMenu, 'menu__list')}>
18
- <DocSidebarItems
19
- items={sidebar}
20
- activePath={path}
21
- onItemClick={(item) => {
22
- // Mobile sidebar should only be closed if the category has a link
23
- if (item.type === 'category' && item.href) {
24
- toggleSidebar();
25
- }
17
+ const DocSidebarMobileSecondaryMenu = ({sidebar, path}) => {
18
+ const mobileSidebar = useNavbarMobileSidebar();
19
+ return (
20
+ <ul className={clsx(ThemeClassNames.docs.docSidebarMenu, 'menu__list')}>
21
+ <DocSidebarItems
22
+ items={sidebar}
23
+ activePath={path}
24
+ onItemClick={(item) => {
25
+ // Mobile sidebar should only be closed if the category has a link
26
+ if (item.type === 'category' && item.href) {
27
+ mobileSidebar.toggle();
28
+ }
26
29
 
27
- if (item.type === 'link') {
28
- toggleSidebar();
29
- }
30
- }}
31
- level={1}
32
- />
33
- </ul>
34
- );
30
+ if (item.type === 'link') {
31
+ mobileSidebar.toggle();
32
+ }
33
+ }}
34
+ level={1}
35
+ />
36
+ </ul>
37
+ );
38
+ };
35
39
 
36
40
  function DocSidebarMobile(props) {
37
41
  return (
38
- <MobileSecondaryMenuFiller
42
+ <NavbarSecondaryMenuFiller
39
43
  component={DocSidebarMobileSecondaryMenu}
40
44
  props={props}
41
45
  />
@@ -7,10 +7,16 @@
7
7
  import React from 'react';
8
8
  import Layout from '@theme/Layout';
9
9
  import Link from '@docusaurus/Link';
10
- import {ThemeClassNames, usePluralForm} from '@docusaurus/theme-common';
10
+ import {
11
+ PageMetadata,
12
+ HtmlClassNameProvider,
13
+ ThemeClassNames,
14
+ usePluralForm,
15
+ } from '@docusaurus/theme-common';
11
16
  import Translate, {translate} from '@docusaurus/Translate';
17
+ import SearchMetadata from '@theme/SearchMetadata';
18
+ import clsx from 'clsx'; // Very simple pluralization: probably good enough for now
12
19
 
13
- // Very simple pluralization: probably good enough for now
14
20
  function useNDocsTaggedPlural() {
15
21
  const {selectMessage} = usePluralForm();
16
22
  return (count) =>
@@ -55,35 +61,36 @@ export default function DocTagDocListPage({tag}) {
55
61
  },
56
62
  );
57
63
  return (
58
- <Layout
59
- title={title}
60
- wrapperClassName={ThemeClassNames.wrapper.docsPages}
61
- pageClassName={ThemeClassNames.page.docsTagDocListPage}
62
- searchMetadata={{
63
- // assign unique search tag to exclude this page from search results!
64
- tag: 'doc_tag_doc_list',
65
- }}>
66
- <div className="container margin-vert--lg">
67
- <div className="row">
68
- <main className="col col--8 col--offset-2">
69
- <header className="margin-bottom--xl">
70
- <h1>{title}</h1>
71
- <Link href={tag.allTagsPath}>
72
- <Translate
73
- id="theme.tags.tagsPageLink"
74
- description="The label of the link targeting the tag list page">
75
- View All Tags
76
- </Translate>
77
- </Link>
78
- </header>
79
- <section className="margin-vert--lg">
80
- {tag.docs.map((doc) => (
81
- <DocItem key={doc.id} doc={doc} />
82
- ))}
83
- </section>
84
- </main>
64
+ <HtmlClassNameProvider
65
+ className={clsx(
66
+ ThemeClassNames.wrapper.docsPages,
67
+ ThemeClassNames.page.docsTagDocListPage,
68
+ )}>
69
+ <PageMetadata title={title} />
70
+ <SearchMetadata tag="doc_tag_doc_list" />
71
+ <Layout>
72
+ <div className="container margin-vert--lg">
73
+ <div className="row">
74
+ <main className="col col--8 col--offset-2">
75
+ <header className="margin-bottom--xl">
76
+ <h1>{title}</h1>
77
+ <Link href={tag.allTagsPath}>
78
+ <Translate
79
+ id="theme.tags.tagsPageLink"
80
+ description="The label of the link targeting the tag list page">
81
+ View All Tags
82
+ </Translate>
83
+ </Link>
84
+ </header>
85
+ <section className="margin-vert--lg">
86
+ {tag.docs.map((doc) => (
87
+ <DocItem key={doc.id} doc={doc} />
88
+ ))}
89
+ </section>
90
+ </main>
91
+ </div>
85
92
  </div>
86
- </div>
87
- </Layout>
93
+ </Layout>
94
+ </HtmlClassNameProvider>
88
95
  );
89
96
  }
@@ -7,29 +7,34 @@
7
7
  import React from 'react';
8
8
  import Layout from '@theme/Layout';
9
9
  import {
10
+ PageMetadata,
11
+ HtmlClassNameProvider,
10
12
  ThemeClassNames,
11
13
  translateTagsPageTitle,
12
14
  } from '@docusaurus/theme-common';
13
15
  import TagsListByLetter from '@theme/TagsListByLetter';
16
+ import SearchMetadata from '@theme/SearchMetadata';
17
+ import clsx from 'clsx';
14
18
  export default function DocTagsListPage({tags}) {
15
19
  const title = translateTagsPageTitle();
16
20
  return (
17
- <Layout
18
- title={title}
19
- wrapperClassName={ThemeClassNames.wrapper.docsPages}
20
- pageClassName={ThemeClassNames.page.docsTagsListPage}
21
- searchMetadata={{
22
- // assign unique search tag to exclude this page from search results!
23
- tag: 'doc_tags_list',
24
- }}>
25
- <div className="container margin-vert--lg">
26
- <div className="row">
27
- <main className="col col--8 col--offset-2">
28
- <h1>{title}</h1>
29
- <TagsListByLetter tags={tags} />
30
- </main>
21
+ <HtmlClassNameProvider
22
+ className={clsx(
23
+ ThemeClassNames.wrapper.docsPages,
24
+ ThemeClassNames.page.docsTagsListPage,
25
+ )}>
26
+ <PageMetadata title={title} />
27
+ <SearchMetadata tag="doc_tags_list" />
28
+ <Layout>
29
+ <div className="container margin-vert--lg">
30
+ <div className="row">
31
+ <main className="col col--8 col--offset-2">
32
+ <h1>{title}</h1>
33
+ <TagsListByLetter tags={tags} />
34
+ </main>
35
+ </div>
31
36
  </div>
32
- </div>
33
- </Layout>
37
+ </Layout>
38
+ </HtmlClassNameProvider>
34
39
  );
35
40
  }
@@ -12,16 +12,26 @@ import AnnouncementBar from '@theme/AnnouncementBar';
12
12
  import Navbar from '@theme/Navbar';
13
13
  import Footer from '@theme/Footer';
14
14
  import LayoutProviders from '@theme/LayoutProviders';
15
- import LayoutHead from '@theme/LayoutHead';
16
- import {ThemeClassNames, useKeyboardNavigation} from '@docusaurus/theme-common';
15
+ import {
16
+ PageMetadata,
17
+ ThemeClassNames,
18
+ useKeyboardNavigation,
19
+ } from '@docusaurus/theme-common';
17
20
  import ErrorPageContent from '@theme/ErrorPageContent';
18
21
  import './styles.css';
19
22
  export default function Layout(props) {
20
- const {children, noFooter, wrapperClassName, pageClassName} = props;
23
+ const {
24
+ children,
25
+ noFooter,
26
+ wrapperClassName,
27
+ // not really layout-related, but kept for convenience/retro-compatibility
28
+ title,
29
+ description,
30
+ } = props;
21
31
  useKeyboardNavigation();
22
32
  return (
23
33
  <LayoutProviders>
24
- <LayoutHead {...props} />
34
+ <PageMetadata title={title} description={description} />
25
35
 
26
36
  <SkipToContent />
27
37
 
@@ -29,12 +39,7 @@ export default function Layout(props) {
29
39
 
30
40
  <Navbar />
31
41
 
32
- <div
33
- className={clsx(
34
- ThemeClassNames.wrapper.main,
35
- wrapperClassName,
36
- pageClassName,
37
- )}>
42
+ <div className={clsx(ThemeClassNames.wrapper.main, wrapperClassName)}>
38
43
  <ErrorBoundary fallback={ErrorPageContent}>{children}</ErrorBoundary>
39
44
  </div>
40
45
 
@@ -10,8 +10,8 @@ import {
10
10
  TabGroupChoiceProvider,
11
11
  AnnouncementBarProvider,
12
12
  DocsPreferredVersionContextProvider,
13
- MobileSecondaryMenuProvider,
14
13
  ScrollControllerProvider,
14
+ NavbarProvider,
15
15
  PluginHtmlClassNameProvider,
16
16
  } from '@docusaurus/theme-common';
17
17
  export default function LayoutProviders({children}) {
@@ -21,11 +21,9 @@ export default function LayoutProviders({children}) {
21
21
  <TabGroupChoiceProvider>
22
22
  <ScrollControllerProvider>
23
23
  <DocsPreferredVersionContextProvider>
24
- <MobileSecondaryMenuProvider>
25
- <PluginHtmlClassNameProvider>
26
- {children}
27
- </PluginHtmlClassNameProvider>
28
- </MobileSecondaryMenuProvider>
24
+ <PluginHtmlClassNameProvider>
25
+ <NavbarProvider>{children}</NavbarProvider>
26
+ </PluginHtmlClassNameProvider>
29
27
  </DocsPreferredVersionContextProvider>
30
28
  </ScrollControllerProvider>
31
29
  </TabGroupChoiceProvider>