@docusaurus/theme-classic 2.0.0-beta.13 → 2.0.0-beta.15
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/README.md +1 -1
- package/lib/index.js +7 -16
- package/lib/theme-classic.d.ts +111 -188
- package/lib/translations.js +13 -4
- package/lib/validateThemeConfig.js +18 -4
- package/lib-next/theme/Admonition/index.js +101 -0
- package/lib-next/theme/BackToTopButton/styles.module.css +1 -1
- package/lib-next/theme/BlogListPaginator/index.js +12 -12
- package/lib-next/theme/BlogPostAuthor/index.js +1 -1
- package/lib-next/theme/BlogPostAuthors/index.js +12 -2
- package/lib-next/theme/BlogPostAuthors/styles.module.css +10 -0
- package/lib-next/theme/BlogPostItem/index.js +12 -15
- package/lib-next/theme/BlogPostPage/index.js +10 -7
- package/lib-next/theme/BlogPostPaginator/index.js +11 -15
- package/lib-next/theme/BlogSidebar/styles.module.css +2 -0
- package/lib-next/theme/CodeBlock/index.js +51 -10
- package/lib-next/theme/CodeBlock/styles.module.css +18 -7
- package/lib-next/theme/DocCard/styles.module.css +3 -3
- package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +6 -3
- package/lib-next/theme/DocItem/index.js +9 -6
- package/lib-next/theme/DocItem/styles.module.css +2 -2
- package/lib-next/theme/DocPage/index.js +7 -3
- package/lib-next/theme/DocPage/styles.module.css +1 -0
- package/lib-next/theme/DocPaginator/index.js +11 -13
- package/lib-next/theme/DocSidebar/index.js +2 -2
- package/lib-next/theme/DocSidebar/styles.module.css +1 -0
- package/lib-next/theme/DocSidebarItem/index.js +43 -21
- package/lib-next/theme/DocSidebarItem/styles.module.css +1 -0
- package/lib-next/theme/DocSidebarItems/index.js +28 -0
- package/{lib/theme/DocSidebarItem → lib-next/theme/DocSidebarItems}/styles.module.css +1 -0
- package/lib-next/theme/DocVersionBanner/index.js +4 -1
- package/lib-next/theme/Footer/index.js +73 -35
- package/lib-next/theme/Footer/styles.module.css +2 -1
- package/lib-next/theme/Heading/index.js +39 -43
- package/lib-next/theme/Heading/styles.css +1 -1
- package/lib-next/theme/Layout/index.js +1 -2
- package/lib-next/theme/LayoutHead/index.js +5 -9
- package/lib-next/theme/LayoutProviders/index.js +6 -6
- package/lib-next/theme/MDXComponents/index.js +18 -31
- package/lib-next/theme/MDXComponents/styles.css +4 -0
- package/lib-next/theme/MDXPage/index.js +3 -10
- package/lib-next/theme/Navbar/index.js +6 -6
- package/lib-next/theme/NavbarItem/DefaultNavbarItem.js +4 -66
- package/lib-next/theme/NavbarItem/DocNavbarItem.js +5 -2
- package/lib-next/theme/NavbarItem/DocSidebarNavbarItem.js +73 -0
- package/lib-next/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +5 -3
- package/lib-next/theme/NavbarItem/DocsVersionNavbarItem.js +4 -1
- package/lib-next/theme/NavbarItem/DropdownNavbarItem.js +6 -7
- package/lib-next/theme/NavbarItem/NavbarNavLink.js +70 -0
- package/lib-next/theme/NavbarItem/index.js +1 -2
- package/lib-next/theme/{UserPreferencesContext.js → NavbarItem/utils.js} +3 -3
- package/lib-next/theme/PaginatorNavLink/index.js +20 -0
- package/lib-next/theme/SkipToContent/index.js +1 -1
- package/lib-next/theme/SkipToContent/styles.module.css +7 -0
- package/lib-next/theme/TOCCollapsible/styles.module.css +2 -2
- package/lib-next/theme/Tabs/__tests__/index.test.js +8 -6
- package/lib-next/theme/Tabs/index.js +20 -10
- package/lib-next/theme/Tag/styles.module.css +4 -4
- package/lib-next/theme/ThemedImage/index.js +2 -2
- package/lib-next/theme/Toggle/styles.module.css +16 -15
- package/lib-next/theme/prism-include-languages.js +10 -3
- package/package.json +17 -19
- package/src/index.ts +12 -26
- package/src/theme/Admonition/index.tsx +106 -0
- package/src/theme/BackToTopButton/styles.module.css +1 -1
- package/src/theme/BlogListPaginator/index.tsx +12 -12
- package/src/theme/BlogPostAuthor/index.tsx +1 -1
- package/src/theme/BlogPostAuthors/index.tsx +12 -2
- package/src/theme/BlogPostAuthors/styles.module.css +10 -0
- package/src/theme/BlogPostItem/index.tsx +13 -15
- package/src/theme/BlogPostPage/index.tsx +10 -7
- package/src/theme/BlogPostPaginator/index.tsx +11 -15
- package/src/theme/BlogSidebar/styles.module.css +2 -0
- package/src/theme/CodeBlock/index.tsx +52 -11
- package/src/theme/CodeBlock/styles.module.css +18 -7
- package/src/theme/DocCard/index.tsx +2 -2
- package/src/theme/DocCard/styles.module.css +3 -3
- package/src/theme/DocCardList/index.tsx +1 -1
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +7 -3
- package/src/theme/DocItem/index.tsx +9 -6
- package/src/theme/DocItem/styles.module.css +2 -2
- package/src/theme/DocItemFooter/index.tsx +1 -1
- package/src/theme/DocPage/index.tsx +8 -4
- package/src/theme/DocPage/styles.module.css +1 -0
- package/src/theme/DocPaginator/index.tsx +13 -15
- package/src/theme/DocSidebar/index.tsx +3 -3
- package/src/theme/DocSidebar/styles.module.css +1 -0
- package/src/theme/DocSidebarItem/index.tsx +34 -23
- package/src/theme/DocSidebarItem/styles.module.css +1 -0
- package/src/theme/DocSidebarItems/index.tsx +32 -0
- package/{lib/theme/DocItemFooter → src/theme/DocSidebarItems}/styles.module.css +10 -8
- package/src/theme/DocVersionBanner/index.tsx +3 -3
- package/src/theme/Footer/index.tsx +84 -38
- package/src/theme/Footer/styles.module.css +2 -1
- package/src/theme/Heading/index.tsx +39 -47
- package/src/theme/Heading/styles.css +1 -1
- package/src/theme/Layout/index.tsx +1 -2
- package/src/theme/LayoutHead/index.tsx +4 -8
- package/src/theme/LayoutProviders/index.tsx +6 -6
- package/src/theme/MDXComponents/index.tsx +26 -37
- package/src/theme/MDXComponents/styles.css +4 -0
- package/src/theme/MDXPage/index.tsx +3 -11
- package/src/theme/Navbar/index.tsx +7 -7
- package/src/theme/NavbarItem/DefaultNavbarItem.tsx +6 -62
- package/src/theme/NavbarItem/DocNavbarItem.tsx +8 -5
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +84 -0
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +9 -6
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +2 -2
- package/src/theme/NavbarItem/DropdownNavbarItem.tsx +6 -7
- package/src/theme/NavbarItem/NavbarNavLink.tsx +68 -0
- package/src/theme/NavbarItem/index.tsx +3 -5
- package/{lib-next/theme/hooks/styles.css → src/theme/NavbarItem/utils.ts} +3 -3
- package/src/theme/PaginatorNavLink/index.tsx +22 -0
- package/src/theme/SkipToContent/index.tsx +1 -1
- package/src/theme/SkipToContent/styles.module.css +7 -0
- package/src/theme/TOCCollapsible/styles.module.css +2 -2
- package/src/theme/TOCItems/index.tsx +2 -2
- package/src/theme/Tabs/index.tsx +25 -10
- package/src/theme/Tag/styles.module.css +4 -4
- package/src/theme/TagsListByLetter/index.tsx +1 -1
- package/src/theme/ThemedImage/index.tsx +2 -2
- package/src/theme/Toggle/index.tsx +1 -1
- package/src/theme/Toggle/styles.module.css +16 -15
- package/src/theme/prism-include-languages.ts +10 -3
- package/src/theme-classic.d.ts +111 -188
- package/src/translations.ts +36 -16
- package/src/validateThemeConfig.ts +25 -4
- package/babel.config.js +0 -35
- package/lib/__tests__/__snapshots__/translations.test.ts.snap +0 -116
- package/lib/__tests__/translations.test.js +0 -112
- package/lib/__tests__/validateThemeConfig.test.js +0 -607
- package/lib/theme/AnnouncementBar/index.js +0 -68
- package/lib/theme/AnnouncementBar/styles.module.css +0 -63
- package/lib/theme/BackToTopButton/index.js +0 -140
- package/lib/theme/BackToTopButton/styles.module.css +0 -42
- package/lib/theme/BlogArchivePage/index.js +0 -89
- package/lib/theme/BlogLayout/index.js +0 -51
- package/lib/theme/BlogListPage/index.js +0 -60
- package/lib/theme/BlogListPaginator/index.js +0 -63
- package/lib/theme/BlogPostAuthor/index.js +0 -51
- package/lib/theme/BlogPostAuthor/styles.module.css +0 -12
- package/lib/theme/BlogPostAuthors/index.js +0 -47
- package/lib/theme/BlogPostAuthors/styles.module.css +0 -11
- package/lib/theme/BlogPostItem/index.js +0 -152
- package/lib/theme/BlogPostItem/styles.module.css +0 -18
- package/lib/theme/BlogPostPage/index.js +0 -82
- package/lib/theme/BlogPostPaginator/index.js +0 -64
- package/lib/theme/BlogSidebar/index.js +0 -49
- package/lib/theme/BlogSidebar/styles.module.css +0 -44
- package/lib/theme/BlogTagsListPage/index.js +0 -40
- package/lib/theme/BlogTagsPostsPage/index.js +0 -86
- package/lib/theme/CodeBlock/index.js +0 -133
- package/lib/theme/CodeBlock/styles.module.css +0 -65
- package/lib/theme/Details/index.js +0 -30
- package/lib/theme/Details/styles.module.css +0 -13
- package/lib/theme/DocCard/index.js +0 -84
- package/lib/theme/DocCard/styles.module.css +0 -43
- package/lib/theme/DocCardList/index.js +0 -28
- package/lib/theme/DocCategoryGeneratedIndexPage/index.js +0 -57
- package/lib/theme/DocCategoryGeneratedIndexPage/styles.module.css +0 -18
- package/lib/theme/DocItem/index.js +0 -112
- package/lib/theme/DocItem/styles.module.css +0 -22
- package/lib/theme/DocItemFooter/index.js +0 -79
- package/lib/theme/DocPage/index.js +0 -154
- package/lib/theme/DocPage/styles.module.css +0 -85
- package/lib/theme/DocPaginator/index.js +0 -62
- package/lib/theme/DocSidebar/index.js +0 -134
- package/lib/theme/DocSidebar/styles.module.css +0 -106
- package/lib/theme/DocSidebarItem/index.js +0 -209
- package/lib/theme/DocTagDocListPage/index.js +0 -89
- package/lib/theme/DocTagsListPage/index.js +0 -44
- package/lib/theme/DocVersionBadge/index.js +0 -34
- package/lib/theme/DocVersionBanner/index.js +0 -130
- package/lib/theme/EditThisPage/index.js +0 -33
- package/lib/theme/ErrorPageContent.js +0 -43
- package/lib/theme/Footer/index.js +0 -119
- package/lib/theme/Footer/styles.module.css +0 -15
- package/lib/theme/Heading/index.js +0 -71
- package/lib/theme/Heading/styles.css +0 -22
- package/lib/theme/Heading/styles.module.css +0 -19
- package/lib/theme/IconArrow/index.js +0 -28
- package/lib/theme/IconClose/index.js +0 -31
- package/lib/theme/IconEdit/index.js +0 -34
- package/lib/theme/IconEdit/styles.module.css +0 -11
- package/lib/theme/IconExternalLink/index.js +0 -30
- package/lib/theme/IconExternalLink/styles.module.css +0 -12
- package/lib/theme/IconLanguage/index.js +0 -29
- package/lib/theme/IconMenu/index.js +0 -30
- package/lib/theme/LastUpdated/index.js +0 -63
- package/lib/theme/Layout/index.js +0 -68
- package/lib/theme/Layout/styles.css +0 -27
- package/lib/theme/LayoutHead/index.js +0 -149
- package/lib/theme/LayoutProviders/index.js +0 -40
- package/lib/theme/Logo/index.js +0 -62
- package/lib/theme/MDXComponents/index.js +0 -106
- package/lib/theme/MDXComponents/styles.css +0 -11
- package/lib/theme/MDXPage/index.js +0 -67
- package/lib/theme/MDXPage/styles.module.css +0 -10
- package/lib/theme/Navbar/index.js +0 -267
- package/lib/theme/Navbar/styles.module.css +0 -27
- package/lib/theme/NavbarItem/DefaultNavbarItem.js +0 -113
- package/lib/theme/NavbarItem/DocNavbarItem.js +0 -62
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +0 -83
- package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +0 -43
- package/lib/theme/NavbarItem/DropdownNavbarItem.js +0 -155
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +0 -68
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +0 -11
- package/lib/theme/NavbarItem/SearchNavbarItem.js +0 -28
- package/lib/theme/NavbarItem/index.js +0 -74
- package/lib/theme/NotFound.js +0 -57
- package/lib/theme/SearchBar.js +0 -15
- package/lib/theme/SearchMetadata/index.js +0 -33
- package/lib/theme/Seo/index.js +0 -52
- package/lib/theme/SkipToContent/index.js +0 -71
- package/lib/theme/SkipToContent/styles.module.css +0 -14
- package/lib/theme/TOC/index.js +0 -39
- package/lib/theme/TOC/styles.module.css +0 -23
- package/lib/theme/TOCCollapsible/index.js +0 -53
- package/lib/theme/TOCCollapsible/styles.module.css +0 -50
- package/lib/theme/TOCInline/index.js +0 -33
- package/lib/theme/TOCInline/styles.module.css +0 -12
- package/lib/theme/TOCItems/index.js +0 -78
- package/lib/theme/TabItem/index.js +0 -32
- package/lib/theme/Tabs/__tests__/index.test.js +0 -123
- package/lib/theme/Tabs/index.js +0 -173
- package/lib/theme/Tabs/styles.module.css +0 -10
- package/lib/theme/Tag/index.js +0 -40
- package/lib/theme/Tag/styles.module.css +0 -70
- package/lib/theme/TagsListByLetter/index.js +0 -48
- package/lib/theme/TagsListByLetter/styles.module.css +0 -11
- package/lib/theme/TagsListInline/index.js +0 -44
- package/lib/theme/TagsListInline/styles.module.css +0 -15
- package/lib/theme/ThemeContext.js +0 -21
- package/lib/theme/ThemeProvider/index.js +0 -43
- package/lib/theme/ThemedImage/index.js +0 -47
- package/lib/theme/ThemedImage/styles.module.css +0 -18
- package/lib/theme/Toggle/index.js +0 -91
- package/lib/theme/Toggle/styles.module.css +0 -105
- package/lib/theme/UserPreferencesContext.js +0 -18
- package/lib/theme/UserPreferencesProvider/index.js +0 -41
- package/lib/theme/hooks/styles.css +0 -10
- package/lib/theme/hooks/useDocs.js +0 -18
- package/lib/theme/hooks/useHideableNavbar.js +0 -74
- package/lib/theme/hooks/useKeyboardNavigation.js +0 -45
- package/lib/theme/hooks/useLocationHash.js +0 -28
- package/lib/theme/hooks/useLockBodyScroll.js +0 -26
- package/lib/theme/hooks/usePrismTheme.js +0 -36
- package/lib/theme/hooks/useTabGroupChoice.js +0 -51
- package/lib/theme/hooks/useTheme.js +0 -97
- package/lib/theme/hooks/useThemeContext.js +0 -31
- package/lib/theme/hooks/useUserPreferencesContext.js +0 -31
- package/lib/theme/hooks/useWindowSize.js +0 -68
- package/lib/theme/prism-include-languages.js +0 -40
- package/lib-next/__tests__/__snapshots__/translations.test.ts.snap +0 -116
- package/lib-next/__tests__/translations.test.js +0 -128
- package/lib-next/__tests__/validateThemeConfig.test.js +0 -607
- package/lib-next/admonitions.css +0 -35
- package/lib-next/deps.d.ts +0 -13
- package/lib-next/index.js +0 -227
- package/lib-next/prism-include-languages.js +0 -9
- package/lib-next/theme/ThemeContext.js +0 -9
- package/lib-next/theme/ThemeProvider/index.js +0 -28
- package/lib-next/theme/UserPreferencesProvider/index.js +0 -27
- package/lib-next/theme/hooks/useDocs.js +0 -10
- package/lib-next/theme/hooks/useHideableNavbar.js +0 -66
- package/lib-next/theme/hooks/useKeyboardNavigation.js +0 -35
- package/lib-next/theme/hooks/useLocationHash.js +0 -20
- package/lib-next/theme/hooks/useLockBodyScroll.js +0 -18
- package/lib-next/theme/hooks/usePrismTheme.js +0 -20
- package/lib-next/theme/hooks/useTabGroupChoice.js +0 -39
- package/lib-next/theme/hooks/useTheme.js +0 -81
- package/lib-next/theme/hooks/useThemeContext.js +0 -22
- package/lib-next/theme/hooks/useUserPreferencesContext.js +0 -22
- package/lib-next/theme/hooks/useWindowSize.js +0 -59
- package/lib-next/theme-classic.d.ts +0 -806
- package/lib-next/translations.js +0 -141
- package/lib-next/types.d.ts +0 -11
- package/lib-next/validateThemeConfig.js +0 -344
- package/src/__tests__/__snapshots__/translations.test.ts.snap +0 -116
- package/src/__tests__/translations.test.ts +0 -116
- package/src/__tests__/validateThemeConfig.test.js +0 -607
- package/src/theme/Tabs/__tests__/index.test.tsx +0 -129
- package/src/theme/ThemeContext.ts +0 -15
- package/src/theme/ThemeProvider/index.tsx +0 -28
- package/src/theme/UserPreferencesContext.ts +0 -12
- package/src/theme/UserPreferencesProvider/index.tsx +0 -30
- package/src/theme/hooks/styles.css +0 -10
- package/src/theme/hooks/useDocs.ts +0 -11
- package/src/theme/hooks/useHideableNavbar.ts +0 -72
- package/src/theme/hooks/useKeyboardNavigation.ts +0 -39
- package/src/theme/hooks/useLocationHash.ts +0 -25
- package/src/theme/hooks/useLockBodyScroll.ts +0 -20
- package/src/theme/hooks/usePrismTheme.ts +0 -22
- package/src/theme/hooks/useTabGroupChoice.ts +0 -46
- package/src/theme/hooks/useTheme.ts +0 -91
- package/src/theme/hooks/useThemeContext.ts +0 -23
- package/src/theme/hooks/useUserPreferencesContext.ts +0 -25
- package/src/theme/hooks/useWindowSize.ts +0 -69
- package/tsconfig.json +0 -11
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
const icons = {
|
|
10
|
+
note: (
|
|
11
|
+
<svg
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
width="14"
|
|
14
|
+
height="16"
|
|
15
|
+
viewBox="0 0 14 16">
|
|
16
|
+
<path
|
|
17
|
+
fillRule="evenodd"
|
|
18
|
+
d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
),
|
|
22
|
+
tip: (
|
|
23
|
+
<svg
|
|
24
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
25
|
+
width="12"
|
|
26
|
+
height="16"
|
|
27
|
+
viewBox="0 0 12 16">
|
|
28
|
+
<path
|
|
29
|
+
fillRule="evenodd"
|
|
30
|
+
d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
33
|
+
),
|
|
34
|
+
danger: (
|
|
35
|
+
<svg
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
width="12"
|
|
38
|
+
height="16"
|
|
39
|
+
viewBox="0 0 12 16">
|
|
40
|
+
<path
|
|
41
|
+
fillRule="evenodd"
|
|
42
|
+
d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"
|
|
43
|
+
/>
|
|
44
|
+
</svg>
|
|
45
|
+
),
|
|
46
|
+
info: (
|
|
47
|
+
<svg
|
|
48
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
49
|
+
width="14"
|
|
50
|
+
height="16"
|
|
51
|
+
viewBox="0 0 14 16">
|
|
52
|
+
<path
|
|
53
|
+
fillRule="evenodd"
|
|
54
|
+
d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"
|
|
55
|
+
/>
|
|
56
|
+
</svg>
|
|
57
|
+
),
|
|
58
|
+
caution: (
|
|
59
|
+
<svg
|
|
60
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
61
|
+
width="16"
|
|
62
|
+
height="16"
|
|
63
|
+
viewBox="0 0 16 16">
|
|
64
|
+
<path
|
|
65
|
+
fillRule="evenodd"
|
|
66
|
+
d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"
|
|
67
|
+
/>
|
|
68
|
+
</svg>
|
|
69
|
+
),
|
|
70
|
+
};
|
|
71
|
+
const ifmClassNames = {
|
|
72
|
+
note: 'secondary',
|
|
73
|
+
tip: 'success',
|
|
74
|
+
danger: 'danger',
|
|
75
|
+
info: 'info',
|
|
76
|
+
caution: 'warning',
|
|
77
|
+
};
|
|
78
|
+
export default function Admonition({
|
|
79
|
+
children,
|
|
80
|
+
type,
|
|
81
|
+
title = type,
|
|
82
|
+
icon = icons[type],
|
|
83
|
+
}) {
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
className={clsx(
|
|
87
|
+
'admonition',
|
|
88
|
+
`admonition-${type}`,
|
|
89
|
+
'alert',
|
|
90
|
+
`alert--${ifmClassNames[type]}`,
|
|
91
|
+
)}>
|
|
92
|
+
<div className="admonition-heading">
|
|
93
|
+
<h5>
|
|
94
|
+
<span className="admonition-icon">{icon}</span>
|
|
95
|
+
{title}
|
|
96
|
+
</h5>
|
|
97
|
+
</div>
|
|
98
|
+
<div className="admonition-content">{children}</div>
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import Link from '@docusaurus/Link';
|
|
9
8
|
import Translate, {translate} from '@docusaurus/Translate';
|
|
9
|
+
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
|
10
10
|
|
|
11
11
|
function BlogListPaginator(props) {
|
|
12
12
|
const {metadata} = props;
|
|
@@ -21,30 +21,30 @@ function BlogListPaginator(props) {
|
|
|
21
21
|
})}>
|
|
22
22
|
<div className="pagination-nav__item">
|
|
23
23
|
{previousPage && (
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
<PaginatorNavLink
|
|
25
|
+
permalink={previousPage}
|
|
26
|
+
title={
|
|
27
27
|
<Translate
|
|
28
28
|
id="theme.blog.paginator.newerEntries"
|
|
29
29
|
description="The label used to navigate to the newer blog posts page (previous page)">
|
|
30
30
|
Newer Entries
|
|
31
31
|
</Translate>
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
}
|
|
33
|
+
/>
|
|
34
34
|
)}
|
|
35
35
|
</div>
|
|
36
36
|
<div className="pagination-nav__item pagination-nav__item--next">
|
|
37
37
|
{nextPage && (
|
|
38
|
-
<
|
|
39
|
-
|
|
38
|
+
<PaginatorNavLink
|
|
39
|
+
permalink={nextPage}
|
|
40
|
+
title={
|
|
40
41
|
<Translate
|
|
41
42
|
id="theme.blog.paginator.olderEntries"
|
|
42
43
|
description="The label used to navigate to the older blog posts page (next page)">
|
|
43
44
|
Older Entries
|
|
44
|
-
</Translate>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</Link>
|
|
45
|
+
</Translate>
|
|
46
|
+
}
|
|
47
|
+
/>
|
|
48
48
|
)}
|
|
49
49
|
</div>
|
|
50
50
|
</nav>
|
|
@@ -19,7 +19,7 @@ function BlogPostAuthor({author}) {
|
|
|
19
19
|
)}
|
|
20
20
|
|
|
21
21
|
{
|
|
22
|
-
// Note: only legacy author
|
|
22
|
+
// Note: only legacy author front matter allow empty name (not frontMatter.authors)
|
|
23
23
|
name && (
|
|
24
24
|
<div
|
|
25
25
|
className="avatar__intro"
|
|
@@ -16,10 +16,20 @@ export default function BlogPostAuthors({authors, assets}) {
|
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
const imageOnly = authors.every(({name}) => !name);
|
|
19
20
|
return (
|
|
20
|
-
<div
|
|
21
|
+
<div
|
|
22
|
+
className={clsx(
|
|
23
|
+
'margin-top--md margin-bottom--sm',
|
|
24
|
+
imageOnly ? styles.imageOnlyAuthorRow : 'row',
|
|
25
|
+
)}>
|
|
21
26
|
{authors.map((author, idx) => (
|
|
22
|
-
<div
|
|
27
|
+
<div
|
|
28
|
+
className={clsx(
|
|
29
|
+
!imageOnly && 'col col--6',
|
|
30
|
+
imageOnly ? styles.imageOnlyAuthorCol : styles.authorCol,
|
|
31
|
+
)}
|
|
32
|
+
key={idx}>
|
|
23
33
|
<BlogPostAuthor
|
|
24
34
|
author={{
|
|
25
35
|
...author,
|
|
@@ -11,6 +11,7 @@ import Translate, {translate} from '@docusaurus/Translate';
|
|
|
11
11
|
import Link from '@docusaurus/Link';
|
|
12
12
|
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
13
13
|
import {usePluralForm} from '@docusaurus/theme-common';
|
|
14
|
+
import {blogPostContainerID} from '@docusaurus/utils-common';
|
|
14
15
|
import MDXComponents from '@theme/MDXComponents';
|
|
15
16
|
import EditThisPage from '@theme/EditThisPage';
|
|
16
17
|
import styles from './styles.module.css';
|
|
@@ -62,10 +63,13 @@ function BlogPostItem(props) {
|
|
|
62
63
|
const image = assets.image ?? frontMatter.image;
|
|
63
64
|
const truncatedPost = !isBlogPostPage && truncated;
|
|
64
65
|
const tagsExists = tags.length > 0;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
const TitleHeading = isBlogPostPage ? 'h1' : 'h2';
|
|
67
|
+
return (
|
|
68
|
+
<article
|
|
69
|
+
className={!isBlogPostPage ? 'margin-bottom--xl' : undefined}
|
|
70
|
+
itemProp="blogPost"
|
|
71
|
+
itemScope
|
|
72
|
+
itemType="http://schema.org/BlogPosting">
|
|
69
73
|
<header>
|
|
70
74
|
<TitleHeading className={styles.blogPostTitle} itemProp="headline">
|
|
71
75
|
{isBlogPostPage ? (
|
|
@@ -90,16 +94,6 @@ function BlogPostItem(props) {
|
|
|
90
94
|
</div>
|
|
91
95
|
<BlogPostAuthors authors={authors} assets={assets} />
|
|
92
96
|
</header>
|
|
93
|
-
);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<article
|
|
98
|
-
className={!isBlogPostPage ? 'margin-bottom--xl' : undefined}
|
|
99
|
-
itemProp="blogPost"
|
|
100
|
-
itemScope
|
|
101
|
-
itemType="http://schema.org/BlogPosting">
|
|
102
|
-
{renderPostHeader()}
|
|
103
97
|
|
|
104
98
|
{image && (
|
|
105
99
|
<meta
|
|
@@ -110,7 +104,10 @@ function BlogPostItem(props) {
|
|
|
110
104
|
/>
|
|
111
105
|
)}
|
|
112
106
|
|
|
113
|
-
<div
|
|
107
|
+
<div // This ID is used for the feed generation to locate the main content
|
|
108
|
+
id={isBlogPostPage ? blogPostContainerID : undefined}
|
|
109
|
+
className="markdown"
|
|
110
|
+
itemProp="articleBody">
|
|
114
111
|
<MDXProvider components={MDXComponents}>{children}</MDXProvider>
|
|
115
112
|
</div>
|
|
116
113
|
|
|
@@ -14,14 +14,17 @@ import TOC from '@theme/TOC';
|
|
|
14
14
|
|
|
15
15
|
function BlogPostPage(props) {
|
|
16
16
|
const {content: BlogPostContents, sidebar} = props;
|
|
17
|
+
const {assets, metadata} = BlogPostContents;
|
|
17
18
|
const {
|
|
18
|
-
|
|
19
|
+
title,
|
|
20
|
+
description,
|
|
21
|
+
nextItem,
|
|
22
|
+
prevItem,
|
|
23
|
+
date,
|
|
24
|
+
tags,
|
|
25
|
+
authors,
|
|
19
26
|
frontMatter,
|
|
20
|
-
|
|
21
|
-
metadata,
|
|
22
|
-
} = BlogPostContents;
|
|
23
|
-
const {title, description, nextItem, prevItem, date, tags, authors} =
|
|
24
|
-
metadata;
|
|
27
|
+
} = metadata;
|
|
25
28
|
const {
|
|
26
29
|
hide_table_of_contents: hideTableOfContents,
|
|
27
30
|
keywords,
|
|
@@ -54,7 +57,7 @@ function BlogPostPage(props) {
|
|
|
54
57
|
<meta property="og:type" content="article" />
|
|
55
58
|
<meta property="article:published_time" content={date} />
|
|
56
59
|
|
|
57
|
-
{/* TODO double check those article
|
|
60
|
+
{/* TODO double check those article meta array syntaxes, see https://ogp.me/#array */}
|
|
58
61
|
{authors.some((author) => author.url) && (
|
|
59
62
|
<meta
|
|
60
63
|
property="article:author"
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import Translate, {translate} from '@docusaurus/Translate';
|
|
9
|
-
import
|
|
9
|
+
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
|
10
10
|
|
|
11
11
|
function BlogPostPaginator(props) {
|
|
12
12
|
const {nextItem, prevItem} = props;
|
|
@@ -20,34 +20,30 @@ function BlogPostPaginator(props) {
|
|
|
20
20
|
})}>
|
|
21
21
|
<div className="pagination-nav__item">
|
|
22
22
|
{prevItem && (
|
|
23
|
-
<
|
|
24
|
-
|
|
23
|
+
<PaginatorNavLink
|
|
24
|
+
{...prevItem}
|
|
25
|
+
subLabel={
|
|
25
26
|
<Translate
|
|
26
27
|
id="theme.blog.post.paginator.newerPost"
|
|
27
28
|
description="The blog post button label to navigate to the newer/previous post">
|
|
28
29
|
Newer Post
|
|
29
30
|
</Translate>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
« {prevItem.title}
|
|
33
|
-
</div>
|
|
34
|
-
</Link>
|
|
31
|
+
}
|
|
32
|
+
/>
|
|
35
33
|
)}
|
|
36
34
|
</div>
|
|
37
35
|
<div className="pagination-nav__item pagination-nav__item--next">
|
|
38
36
|
{nextItem && (
|
|
39
|
-
<
|
|
40
|
-
|
|
37
|
+
<PaginatorNavLink
|
|
38
|
+
{...nextItem}
|
|
39
|
+
subLabel={
|
|
41
40
|
<Translate
|
|
42
41
|
id="theme.blog.post.paginator.olderPost"
|
|
43
42
|
description="The blog post button label to navigate to the older/next post">
|
|
44
43
|
Older Post
|
|
45
44
|
</Translate>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{nextItem.title} »
|
|
49
|
-
</div>
|
|
50
|
-
</Link>
|
|
45
|
+
}
|
|
46
|
+
/>
|
|
51
47
|
)}
|
|
52
48
|
</div>
|
|
53
49
|
</nav>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React, {useEffect, useState} from 'react';
|
|
7
|
+
import React, {isValidElement, useEffect, useState} from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import Highlight, {defaultProps} from 'prism-react-renderer';
|
|
10
10
|
import copy from 'copy-text-to-clipboard';
|
|
@@ -14,14 +14,16 @@ import {
|
|
|
14
14
|
parseCodeBlockTitle,
|
|
15
15
|
parseLanguage,
|
|
16
16
|
parseLines,
|
|
17
|
+
ThemeClassNames,
|
|
18
|
+
usePrismTheme,
|
|
17
19
|
} from '@docusaurus/theme-common';
|
|
18
|
-
import usePrismTheme from '@theme/hooks/usePrismTheme';
|
|
19
20
|
import styles from './styles.module.css';
|
|
20
21
|
export default function CodeBlock({
|
|
21
22
|
children,
|
|
22
|
-
className: blockClassName,
|
|
23
|
+
className: blockClassName = '',
|
|
23
24
|
metastring,
|
|
24
25
|
title,
|
|
26
|
+
language: languageProp,
|
|
25
27
|
}) {
|
|
26
28
|
const {prism} = useThemeConfig();
|
|
27
29
|
const [showCopied, setShowCopied] = useState(false);
|
|
@@ -35,15 +37,45 @@ export default function CodeBlock({
|
|
|
35
37
|
|
|
36
38
|
useEffect(() => {
|
|
37
39
|
setMounted(true);
|
|
38
|
-
}, []); //
|
|
39
|
-
//
|
|
40
|
-
//
|
|
40
|
+
}, []); // We still parse the metastring in case we want to support more syntax in the
|
|
41
|
+
// future. Note that MDX doesn't strip quotes when parsing metastring:
|
|
42
|
+
// "title=\"xyz\"" => title: "\"xyz\""
|
|
41
43
|
|
|
42
44
|
const codeBlockTitle = parseCodeBlockTitle(metastring) || title;
|
|
43
|
-
const prismTheme = usePrismTheme(); //
|
|
45
|
+
const prismTheme = usePrismTheme(); // <pre> tags in markdown map to CodeBlocks and they may contain JSX children.
|
|
46
|
+
// When the children is not a simple string, we just return a styled block without actually highlighting.
|
|
47
|
+
|
|
48
|
+
if (React.Children.toArray(children).some((el) => isValidElement(el))) {
|
|
49
|
+
return (
|
|
50
|
+
<Highlight
|
|
51
|
+
{...defaultProps}
|
|
52
|
+
key={String(mounted)}
|
|
53
|
+
theme={prismTheme}
|
|
54
|
+
code=""
|
|
55
|
+
language={'text'}>
|
|
56
|
+
{({className, style}) => (
|
|
57
|
+
<pre
|
|
58
|
+
/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */
|
|
59
|
+
tabIndex={0}
|
|
60
|
+
className={clsx(
|
|
61
|
+
className,
|
|
62
|
+
styles.codeBlockStandalone,
|
|
63
|
+
'thin-scrollbar',
|
|
64
|
+
styles.codeBlockContainer,
|
|
65
|
+
blockClassName,
|
|
66
|
+
ThemeClassNames.common.codeBlock,
|
|
67
|
+
)}
|
|
68
|
+
style={style}>
|
|
69
|
+
<code className={styles.codeBlockLines}>{children}</code>
|
|
70
|
+
</pre>
|
|
71
|
+
)}
|
|
72
|
+
</Highlight>
|
|
73
|
+
);
|
|
74
|
+
} // The children is now guaranteed to be one/more plain strings
|
|
44
75
|
|
|
45
76
|
const content = Array.isArray(children) ? children.join('') : children;
|
|
46
|
-
const language =
|
|
77
|
+
const language =
|
|
78
|
+
languageProp ?? parseLanguage(blockClassName) ?? prism.defaultLanguage;
|
|
47
79
|
const {highlightLines, code} = parseLines(content, metastring, language);
|
|
48
80
|
|
|
49
81
|
const handleCopyCode = () => {
|
|
@@ -58,9 +90,18 @@ export default function CodeBlock({
|
|
|
58
90
|
key={String(mounted)}
|
|
59
91
|
theme={prismTheme}
|
|
60
92
|
code={code}
|
|
61
|
-
language={language}>
|
|
93
|
+
language={language ?? 'text'}>
|
|
62
94
|
{({className, style, tokens, getLineProps, getTokenProps}) => (
|
|
63
|
-
<div
|
|
95
|
+
<div
|
|
96
|
+
className={clsx(
|
|
97
|
+
styles.codeBlockContainer,
|
|
98
|
+
blockClassName,
|
|
99
|
+
{
|
|
100
|
+
[`language-${language}`]:
|
|
101
|
+
language && !blockClassName.includes(`language-${language}`),
|
|
102
|
+
},
|
|
103
|
+
ThemeClassNames.common.codeBlock,
|
|
104
|
+
)}>
|
|
64
105
|
{codeBlockTitle && (
|
|
65
106
|
<div style={style} className={styles.codeBlockTitle}>
|
|
66
107
|
{codeBlockTitle}
|
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
margin-bottom: var(--ifm-leading);
|
|
10
10
|
border-radius: var(--ifm-global-radius);
|
|
11
11
|
box-shadow: var(--ifm-global-shadow-lw);
|
|
12
|
-
overflow: hidden;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
.codeBlockContent {
|
|
16
15
|
position: relative;
|
|
17
|
-
/*rtl:ignore*/
|
|
16
|
+
/* rtl:ignore */
|
|
18
17
|
direction: ltr;
|
|
19
18
|
}
|
|
20
19
|
|
|
@@ -23,16 +22,28 @@
|
|
|
23
22
|
font-size: var(--ifm-code-font-size);
|
|
24
23
|
font-weight: 500;
|
|
25
24
|
padding: 0.75rem var(--ifm-pre-padding);
|
|
25
|
+
border-top-left-radius: var(--ifm-global-radius);
|
|
26
|
+
border-top-right-radius: var(--ifm-global-radius);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
.codeBlock {
|
|
29
30
|
margin: 0;
|
|
30
31
|
padding: 0;
|
|
31
|
-
border-radius:
|
|
32
|
+
border-radius: var(--ifm-global-radius);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.codeBlockTitle + .codeBlockContent .codeBlock {
|
|
36
|
+
border-top-left-radius: 0;
|
|
37
|
+
border-top-right-radius: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.codeBlockStandalone {
|
|
41
|
+
padding: 0;
|
|
42
|
+
border-radius: var(--ifm-global-radius);
|
|
32
43
|
}
|
|
33
44
|
|
|
34
45
|
.copyButton {
|
|
35
|
-
background:
|
|
46
|
+
background: rgb(0 0 0 / 30%);
|
|
36
47
|
border-radius: var(--ifm-global-radius);
|
|
37
48
|
color: var(--ifm-color-white);
|
|
38
49
|
opacity: 0;
|
|
@@ -44,15 +55,15 @@
|
|
|
44
55
|
transition: opacity 200ms ease-in-out;
|
|
45
56
|
}
|
|
46
57
|
|
|
47
|
-
.
|
|
58
|
+
.copyButton:focus,
|
|
48
59
|
.codeBlockContent:hover > .copyButton,
|
|
49
|
-
.
|
|
60
|
+
.codeBlockTitle:hover + .codeBlockContent .copyButton {
|
|
50
61
|
opacity: 1;
|
|
51
62
|
}
|
|
52
63
|
|
|
53
64
|
.codeBlockLines {
|
|
54
65
|
font: inherit;
|
|
55
|
-
/*rtl:ignore*/
|
|
66
|
+
/* rtl:ignore */
|
|
56
67
|
float: left;
|
|
57
68
|
min-width: 100%;
|
|
58
69
|
padding: var(--ifm-pre-padding);
|
|
@@ -7,14 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
.cardContainer {
|
|
9
9
|
height: 8rem;
|
|
10
|
-
|
|
11
10
|
color: var(--ifm-color-emphasis-800);
|
|
12
11
|
--ifm-link-color: var(--ifm-color-emphasis-800);
|
|
13
12
|
--ifm-link-hover-color: var(--ifm-color-emphasis-800);
|
|
14
13
|
--ifm-link-hover-decoration: none;
|
|
15
14
|
|
|
16
15
|
/* box-shadow: var(--ifm-global-shadow-lw); */
|
|
17
|
-
box-shadow: 0 1.5px 3px 0
|
|
16
|
+
box-shadow: 0 1.5px 3px 0 rgb(0 0 0 / 15%);
|
|
18
17
|
border: 1px solid var(--ifm-color-emphasis-200);
|
|
19
18
|
transition: box-shadow var(--ifm-transition-fast) ease,
|
|
20
19
|
background-color var(--ifm-transition-fast) ease;
|
|
@@ -22,8 +21,9 @@
|
|
|
22
21
|
|
|
23
22
|
.cardContainer.cardContainerLink:hover {
|
|
24
23
|
/* box-shadow: var(--ifm-global-shadow-md); */
|
|
25
|
-
box-shadow: 0 4px 8px 0
|
|
24
|
+
box-shadow: 0 4px 8px 0 rgb(0 0 0 / 20%);
|
|
26
25
|
}
|
|
26
|
+
|
|
27
27
|
html[data-theme='dark'] .cardContainer.cardContainerLink:hover {
|
|
28
28
|
--ifm-card-background-color: #2d2d2d; /* original, non-hovered color is #242526 */
|
|
29
29
|
}
|
|
@@ -11,7 +11,8 @@ import DocPaginator from '@theme/DocPaginator';
|
|
|
11
11
|
import Seo from '@theme/Seo';
|
|
12
12
|
import DocVersionBanner from '@theme/DocVersionBanner';
|
|
13
13
|
import DocVersionBadge from '@theme/DocVersionBadge';
|
|
14
|
-
import
|
|
14
|
+
import Heading from '@theme/Heading';
|
|
15
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
15
16
|
import styles from './styles.module.css';
|
|
16
17
|
export default function DocCategoryGeneratedIndexPage({
|
|
17
18
|
categoryGeneratedIndex,
|
|
@@ -22,14 +23,16 @@ export default function DocCategoryGeneratedIndexPage({
|
|
|
22
23
|
<Seo
|
|
23
24
|
title={categoryGeneratedIndex.title}
|
|
24
25
|
description={categoryGeneratedIndex.description}
|
|
26
|
+
keywords={categoryGeneratedIndex.keywords} // TODO `require` this?
|
|
27
|
+
image={useBaseUrl(categoryGeneratedIndex.image)}
|
|
25
28
|
/>
|
|
26
29
|
<div className={styles.generatedIndexPage}>
|
|
27
30
|
<DocVersionBanner />
|
|
28
31
|
<DocVersionBadge />
|
|
29
32
|
<header>
|
|
30
|
-
<
|
|
33
|
+
<Heading as="h1" className={styles.title}>
|
|
31
34
|
{categoryGeneratedIndex.title}
|
|
32
|
-
</
|
|
35
|
+
</Heading>
|
|
33
36
|
{categoryGeneratedIndex.description && (
|
|
34
37
|
<p>{categoryGeneratedIndex.description}</p>
|
|
35
38
|
)}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import useWindowSize from '@theme/hooks/useWindowSize';
|
|
10
9
|
import DocPaginator from '@theme/DocPaginator';
|
|
11
10
|
import DocVersionBanner from '@theme/DocVersionBanner';
|
|
12
11
|
import DocVersionBadge from '@theme/DocVersionBadge';
|
|
@@ -14,9 +13,9 @@ import Seo from '@theme/Seo';
|
|
|
14
13
|
import DocItemFooter from '@theme/DocItemFooter';
|
|
15
14
|
import TOC from '@theme/TOC';
|
|
16
15
|
import TOCCollapsible from '@theme/TOCCollapsible';
|
|
17
|
-
import
|
|
16
|
+
import Heading from '@theme/Heading';
|
|
18
17
|
import styles from './styles.module.css';
|
|
19
|
-
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
18
|
+
import {ThemeClassNames, useWindowSize} from '@docusaurus/theme-common';
|
|
20
19
|
export default function DocItem(props) {
|
|
21
20
|
const {content: DocContent} = props;
|
|
22
21
|
const {metadata, frontMatter} = DocContent;
|
|
@@ -29,7 +28,7 @@ export default function DocItem(props) {
|
|
|
29
28
|
toc_max_heading_level: tocMaxHeadingLevel,
|
|
30
29
|
} = frontMatter;
|
|
31
30
|
const {description, title} = metadata; // We only add a title if:
|
|
32
|
-
// - user asks to hide it with
|
|
31
|
+
// - user asks to hide it with front matter
|
|
33
32
|
// - the markdown content does not already contain a top-level h1 heading
|
|
34
33
|
|
|
35
34
|
const shouldAddTitle =
|
|
@@ -75,11 +74,15 @@ export default function DocItem(props) {
|
|
|
75
74
|
<div
|
|
76
75
|
className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
|
|
77
76
|
{/*
|
|
78
|
-
Title can be declared inside md content or declared through
|
|
77
|
+
Title can be declared inside md content or declared through front matter and added manually
|
|
79
78
|
To make both cases consistent, the added title is added under the same div.markdown block
|
|
80
79
|
See https://github.com/facebook/docusaurus/pull/4882#issuecomment-853021120
|
|
81
80
|
*/}
|
|
82
|
-
{shouldAddTitle &&
|
|
81
|
+
{shouldAddTitle && (
|
|
82
|
+
<header>
|
|
83
|
+
<Heading as="h1">{title}</Heading>
|
|
84
|
+
</header>
|
|
85
|
+
)}
|
|
83
86
|
|
|
84
87
|
<DocContent />
|
|
85
88
|
</div>
|
|
@@ -56,9 +56,13 @@ function DocPageContent({
|
|
|
56
56
|
|
|
57
57
|
{sidebar && (
|
|
58
58
|
<aside
|
|
59
|
-
className={clsx(
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
className={clsx(
|
|
60
|
+
ThemeClassNames.docs.docSidebarContainer,
|
|
61
|
+
styles.docSidebarContainer,
|
|
62
|
+
{
|
|
63
|
+
[styles.docSidebarContainerHidden]: hiddenSidebarContainer,
|
|
64
|
+
},
|
|
65
|
+
)}
|
|
62
66
|
onTransitionEnd={(e) => {
|
|
63
67
|
if (
|
|
64
68
|
!e.currentTarget.classList.contains(styles.docSidebarContainer)
|