@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
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
position: absolute;
|
|
40
40
|
width: 14px;
|
|
41
41
|
height: 10px;
|
|
42
|
-
top:
|
|
43
|
-
bottom:
|
|
42
|
+
top: 0;
|
|
43
|
+
bottom: 0;
|
|
44
44
|
margin: auto 0;
|
|
45
45
|
left: 8px;
|
|
46
46
|
opacity: 0;
|
|
47
47
|
transition: opacity 0.25s ease;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
.
|
|
50
|
+
.toggleChecked .toggleTrackCheck,
|
|
51
|
+
[data-theme='dark'] .toggle .toggleTrackCheck {
|
|
52
52
|
opacity: 1;
|
|
53
53
|
transition: opacity 0.25s ease;
|
|
54
54
|
}
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
position: absolute;
|
|
58
58
|
width: 10px;
|
|
59
59
|
height: 10px;
|
|
60
|
-
top:
|
|
61
|
-
bottom:
|
|
60
|
+
top: 0;
|
|
61
|
+
bottom: 0;
|
|
62
62
|
margin: auto 0;
|
|
63
63
|
right: 10px;
|
|
64
64
|
opacity: 1;
|
|
65
65
|
transition: opacity 0.25s ease;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
.
|
|
68
|
+
.toggleChecked .toggleTrackX,
|
|
69
|
+
[data-theme='dark'] .toggle .toggleTrackX {
|
|
70
70
|
opacity: 0;
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -82,18 +82,19 @@
|
|
|
82
82
|
transition: all 0.25s ease;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
[data-theme='dark'] .toggle .toggleTrackThumb,
|
|
86
|
-
.toggleChecked .toggleTrackThumb {
|
|
87
|
-
left: 27px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
85
|
.toggleFocused .toggleTrackThumb,
|
|
91
86
|
.toggle:hover .toggleTrackThumb {
|
|
92
|
-
box-shadow:
|
|
87
|
+
box-shadow: 0 0 2px 3px var(--ifm-color-primary);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* stylelint-disable-next-line no-descending-specificity */
|
|
91
|
+
.toggleChecked .toggleTrackThumb,
|
|
92
|
+
[data-theme='dark'] .toggle .toggleTrackThumb {
|
|
93
|
+
left: 27px;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
.toggle:active:not(.toggleDisabled) .toggleTrackThumb {
|
|
96
|
-
box-shadow:
|
|
97
|
+
box-shadow: 0 0 5px 5px var(--ifm-color-primary);
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
.toggleIcon {
|
|
@@ -10,12 +10,19 @@ import siteConfig from '@generated/docusaurus.config';
|
|
|
10
10
|
const prismIncludeLanguages = (PrismObject) => {
|
|
11
11
|
if (ExecutionEnvironment.canUseDOM) {
|
|
12
12
|
const {
|
|
13
|
-
themeConfig: {prism
|
|
13
|
+
themeConfig: {prism},
|
|
14
14
|
} = siteConfig;
|
|
15
|
-
const {additionalLanguages
|
|
15
|
+
const {additionalLanguages} = prism; // Prism components work on the Prism instance on the window, while
|
|
16
|
+
// prism-react-renderer uses its own Prism instance. We temporarily mount
|
|
17
|
+
// the instance onto window, import components to enhance it, then remove it
|
|
18
|
+
// to avoid polluting global namespace.
|
|
19
|
+
// You can mutate this object: registering plugins, deleting languages... As
|
|
20
|
+
// long as you don't re-assign it
|
|
21
|
+
|
|
16
22
|
window.Prism = PrismObject;
|
|
17
23
|
additionalLanguages.forEach((lang) => {
|
|
18
|
-
|
|
24
|
+
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
25
|
+
require(`prismjs/components/prism-${lang}`);
|
|
19
26
|
});
|
|
20
27
|
delete window.Prism;
|
|
21
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.15",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -18,25 +18,22 @@
|
|
|
18
18
|
"watch": "concurrently --names \"lib,lib-next,tsc\" --kill-others \"yarn babel:lib --watch\" \"yarn babel:lib-next --watch\" \"yarn tsc --watch\"",
|
|
19
19
|
"babel:lib": "cross-env BABEL_ENV=lib babel src -d lib --extensions \".tsx,.ts\" --ignore \"**/*.d.ts\" --copy-files",
|
|
20
20
|
"babel:lib-next": "cross-env BABEL_ENV=lib-next babel src -d lib-next --extensions \".tsx,.ts\" --ignore \"**/*.d.ts\" --copy-files",
|
|
21
|
-
"format": "prettier --config ../../.prettierrc --
|
|
22
|
-
"format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\"",
|
|
23
|
-
"update-code-translations": "node -e 'require(\"./update-code-translations.js\").run()'"
|
|
21
|
+
"format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
|
|
24
22
|
},
|
|
25
23
|
"dependencies": {
|
|
26
|
-
"@docusaurus/
|
|
27
|
-
"@docusaurus/plugin-content-
|
|
28
|
-
"@docusaurus/plugin-content-
|
|
29
|
-
"@docusaurus/
|
|
30
|
-
"@docusaurus/theme-
|
|
31
|
-
"@docusaurus/
|
|
32
|
-
"@docusaurus/utils
|
|
33
|
-
"@
|
|
24
|
+
"@docusaurus/core": "2.0.0-beta.15",
|
|
25
|
+
"@docusaurus/plugin-content-blog": "2.0.0-beta.15",
|
|
26
|
+
"@docusaurus/plugin-content-docs": "2.0.0-beta.15",
|
|
27
|
+
"@docusaurus/plugin-content-pages": "2.0.0-beta.15",
|
|
28
|
+
"@docusaurus/theme-common": "2.0.0-beta.15",
|
|
29
|
+
"@docusaurus/theme-translations": "2.0.0-beta.15",
|
|
30
|
+
"@docusaurus/utils": "2.0.0-beta.15",
|
|
31
|
+
"@docusaurus/utils-common": "2.0.0-beta.15",
|
|
32
|
+
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
|
34
33
|
"@mdx-js/react": "^1.6.21",
|
|
35
|
-
"chalk": "^4.1.2",
|
|
36
34
|
"clsx": "^1.1.1",
|
|
37
35
|
"copy-text-to-clipboard": "^3.0.1",
|
|
38
|
-
"
|
|
39
|
-
"infima": "0.2.0-alpha.36",
|
|
36
|
+
"infima": "0.2.0-alpha.37",
|
|
40
37
|
"lodash": "^4.17.20",
|
|
41
38
|
"postcss": "^8.3.7",
|
|
42
39
|
"prism-react-renderer": "^1.2.1",
|
|
@@ -45,12 +42,13 @@
|
|
|
45
42
|
"rtlcss": "^3.3.0"
|
|
46
43
|
},
|
|
47
44
|
"devDependencies": {
|
|
48
|
-
"@docusaurus/
|
|
49
|
-
"@docusaurus/
|
|
50
|
-
"@docusaurus/types": "2.0.0-beta.13",
|
|
45
|
+
"@docusaurus/module-type-aliases": "2.0.0-beta.15",
|
|
46
|
+
"@docusaurus/types": "2.0.0-beta.15",
|
|
51
47
|
"@types/mdx-js__react": "^1.5.4",
|
|
52
48
|
"@types/parse-numeric-range": "^0.0.1",
|
|
49
|
+
"@types/prismjs": "^1.16.2",
|
|
53
50
|
"@types/rtlcss": "^3.1.1",
|
|
51
|
+
"cross-env": "^7.0.3",
|
|
54
52
|
"fs-extra": "^10.0.0",
|
|
55
53
|
"react-test-renderer": "^17.0.2",
|
|
56
54
|
"utility-types": "^3.10.0"
|
|
@@ -62,5 +60,5 @@
|
|
|
62
60
|
"engines": {
|
|
63
61
|
"node": ">=14"
|
|
64
62
|
},
|
|
65
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "6cfad16436c07d8d11e5c2e1486dc59afd483e33"
|
|
66
64
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import type {LoadContext, Plugin, PostCssOptions} from '@docusaurus/types';
|
|
9
9
|
import type {ThemeConfig} from '@docusaurus/theme-common';
|
|
10
10
|
import {getTranslationFiles, translateThemeConfig} from './translations';
|
|
11
11
|
import path from 'path';
|
|
@@ -13,13 +13,14 @@ import {createRequire} from 'module';
|
|
|
13
13
|
import type {Plugin as PostCssPlugin} from 'postcss';
|
|
14
14
|
import rtlcss from 'rtlcss';
|
|
15
15
|
import {readDefaultCodeTranslationMessages} from '@docusaurus/theme-translations';
|
|
16
|
+
import type {Options} from '@docusaurus/theme-classic';
|
|
17
|
+
import type webpack from 'webpack';
|
|
16
18
|
|
|
17
19
|
const requireFromDocusaurusCore = createRequire(
|
|
18
20
|
require.resolve('@docusaurus/core/package.json'),
|
|
19
21
|
);
|
|
20
|
-
const ContextReplacementPlugin =
|
|
21
|
-
'webpack/lib/ContextReplacementPlugin'
|
|
22
|
-
);
|
|
22
|
+
const ContextReplacementPlugin: typeof webpack.ContextReplacementPlugin =
|
|
23
|
+
requireFromDocusaurusCore('webpack/lib/ContextReplacementPlugin');
|
|
23
24
|
|
|
24
25
|
// Need to be inlined to prevent dark mode FOUC
|
|
25
26
|
// Make sure that the 'storageKey' is the same as the one in `/theme/hooks/useTheme.js`
|
|
@@ -89,13 +90,9 @@ function getInfimaCSSFile(direction: string) {
|
|
|
89
90
|
}.css`;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
export type PluginOptions = {
|
|
93
|
-
customCss?: string | string[];
|
|
94
|
-
};
|
|
95
|
-
|
|
96
93
|
export default function docusaurusThemeClassic(
|
|
97
|
-
context:
|
|
98
|
-
options:
|
|
94
|
+
context: LoadContext,
|
|
95
|
+
options: Options,
|
|
99
96
|
): Plugin<void> {
|
|
100
97
|
const {
|
|
101
98
|
siteConfig: {themeConfig: roughlyTypedThemeConfig},
|
|
@@ -113,22 +110,12 @@ export default function docusaurusThemeClassic(
|
|
|
113
110
|
return {
|
|
114
111
|
name: 'docusaurus-theme-classic',
|
|
115
112
|
|
|
116
|
-
/*
|
|
117
|
-
Does not seem needed: webpack can already hot reload theme files
|
|
118
|
-
getPathsToWatch() {
|
|
119
|
-
return [
|
|
120
|
-
path.join(__dirname, '..', 'lib'),
|
|
121
|
-
path.join(__dirname, '..', 'lib-next'),
|
|
122
|
-
];
|
|
123
|
-
},
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
113
|
getThemePath() {
|
|
127
|
-
return path.join(__dirname, '
|
|
114
|
+
return path.join(__dirname, '../lib-next/theme');
|
|
128
115
|
},
|
|
129
116
|
|
|
130
117
|
getTypeScriptThemePath() {
|
|
131
|
-
return path.resolve(__dirname, '
|
|
118
|
+
return path.resolve(__dirname, '../src/theme');
|
|
132
119
|
},
|
|
133
120
|
|
|
134
121
|
getTranslationFiles: async () => getTranslationFiles({themeConfig}),
|
|
@@ -170,11 +157,10 @@ export default function docusaurusThemeClassic(
|
|
|
170
157
|
.join('|');
|
|
171
158
|
|
|
172
159
|
return {
|
|
173
|
-
ignoreWarnings: [
|
|
174
|
-
// See https://github.com/facebook/docusaurus/pull/3382
|
|
175
|
-
(e) => e.message.includes("Can't resolve '@theme-init/hooks/useDocs"),
|
|
176
|
-
],
|
|
177
160
|
plugins: [
|
|
161
|
+
// This allows better optimization by only bundling those components
|
|
162
|
+
// that the user actually needs, because the modules are dynamically
|
|
163
|
+
// required and can't be known during compile time.
|
|
178
164
|
new ContextReplacementPlugin(
|
|
179
165
|
/prismjs[\\/]components$/,
|
|
180
166
|
new RegExp(`^./(${prismLanguages})$`),
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import type {Props} from '@theme/Admonition';
|
|
11
|
+
|
|
12
|
+
const icons = {
|
|
13
|
+
note: (
|
|
14
|
+
<svg
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
width="14"
|
|
17
|
+
height="16"
|
|
18
|
+
viewBox="0 0 14 16">
|
|
19
|
+
<path
|
|
20
|
+
fillRule="evenodd"
|
|
21
|
+
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"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
),
|
|
25
|
+
tip: (
|
|
26
|
+
<svg
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
width="12"
|
|
29
|
+
height="16"
|
|
30
|
+
viewBox="0 0 12 16">
|
|
31
|
+
<path
|
|
32
|
+
fillRule="evenodd"
|
|
33
|
+
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"
|
|
34
|
+
/>
|
|
35
|
+
</svg>
|
|
36
|
+
),
|
|
37
|
+
danger: (
|
|
38
|
+
<svg
|
|
39
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
40
|
+
width="12"
|
|
41
|
+
height="16"
|
|
42
|
+
viewBox="0 0 12 16">
|
|
43
|
+
<path
|
|
44
|
+
fillRule="evenodd"
|
|
45
|
+
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"
|
|
46
|
+
/>
|
|
47
|
+
</svg>
|
|
48
|
+
),
|
|
49
|
+
info: (
|
|
50
|
+
<svg
|
|
51
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
52
|
+
width="14"
|
|
53
|
+
height="16"
|
|
54
|
+
viewBox="0 0 14 16">
|
|
55
|
+
<path
|
|
56
|
+
fillRule="evenodd"
|
|
57
|
+
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"
|
|
58
|
+
/>
|
|
59
|
+
</svg>
|
|
60
|
+
),
|
|
61
|
+
caution: (
|
|
62
|
+
<svg
|
|
63
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
64
|
+
width="16"
|
|
65
|
+
height="16"
|
|
66
|
+
viewBox="0 0 16 16">
|
|
67
|
+
<path
|
|
68
|
+
fillRule="evenodd"
|
|
69
|
+
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"
|
|
70
|
+
/>
|
|
71
|
+
</svg>
|
|
72
|
+
),
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const ifmClassNames = {
|
|
76
|
+
note: 'secondary',
|
|
77
|
+
tip: 'success',
|
|
78
|
+
danger: 'danger',
|
|
79
|
+
info: 'info',
|
|
80
|
+
caution: 'warning',
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export default function Admonition({
|
|
84
|
+
children,
|
|
85
|
+
type,
|
|
86
|
+
title = type,
|
|
87
|
+
icon = icons[type],
|
|
88
|
+
}: Props): JSX.Element {
|
|
89
|
+
return (
|
|
90
|
+
<div
|
|
91
|
+
className={clsx(
|
|
92
|
+
'admonition',
|
|
93
|
+
`admonition-${type}`,
|
|
94
|
+
'alert',
|
|
95
|
+
`alert--${ifmClassNames[type]}`,
|
|
96
|
+
)}>
|
|
97
|
+
<div className="admonition-heading">
|
|
98
|
+
<h5>
|
|
99
|
+
<span className="admonition-icon">{icon}</span>
|
|
100
|
+
{title}
|
|
101
|
+
</h5>
|
|
102
|
+
</div>
|
|
103
|
+
<div className="admonition-content">{children}</div>
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import Link from '@docusaurus/Link';
|
|
10
9
|
import Translate, {translate} from '@docusaurus/Translate';
|
|
10
|
+
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
|
11
11
|
import type {Props} from '@theme/BlogListPaginator';
|
|
12
12
|
|
|
13
13
|
function BlogListPaginator(props: Props): JSX.Element {
|
|
@@ -24,30 +24,30 @@ function BlogListPaginator(props: Props): JSX.Element {
|
|
|
24
24
|
})}>
|
|
25
25
|
<div className="pagination-nav__item">
|
|
26
26
|
{previousPage && (
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
<PaginatorNavLink
|
|
28
|
+
permalink={previousPage}
|
|
29
|
+
title={
|
|
30
30
|
<Translate
|
|
31
31
|
id="theme.blog.paginator.newerEntries"
|
|
32
32
|
description="The label used to navigate to the newer blog posts page (previous page)">
|
|
33
33
|
Newer Entries
|
|
34
34
|
</Translate>
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
}
|
|
36
|
+
/>
|
|
37
37
|
)}
|
|
38
38
|
</div>
|
|
39
39
|
<div className="pagination-nav__item pagination-nav__item--next">
|
|
40
40
|
{nextPage && (
|
|
41
|
-
<
|
|
42
|
-
|
|
41
|
+
<PaginatorNavLink
|
|
42
|
+
permalink={nextPage}
|
|
43
|
+
title={
|
|
43
44
|
<Translate
|
|
44
45
|
id="theme.blog.paginator.olderEntries"
|
|
45
46
|
description="The label used to navigate to the older blog posts page (next page)">
|
|
46
47
|
Older Entries
|
|
47
|
-
</Translate>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</Link>
|
|
48
|
+
</Translate>
|
|
49
|
+
}
|
|
50
|
+
/>
|
|
51
51
|
)}
|
|
52
52
|
</div>
|
|
53
53
|
</nav>
|
|
@@ -22,7 +22,7 @@ function BlogPostAuthor({author}: Props): JSX.Element {
|
|
|
22
22
|
)}
|
|
23
23
|
|
|
24
24
|
{
|
|
25
|
-
// Note: only legacy author
|
|
25
|
+
// Note: only legacy author front matter allow empty name (not frontMatter.authors)
|
|
26
26
|
name && (
|
|
27
27
|
<div
|
|
28
28
|
className="avatar__intro"
|
|
@@ -21,10 +21,20 @@ export default function BlogPostAuthors({
|
|
|
21
21
|
if (authorsCount === 0) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
+
const imageOnly = authors.every(({name}) => !name);
|
|
24
25
|
return (
|
|
25
|
-
<div
|
|
26
|
+
<div
|
|
27
|
+
className={clsx(
|
|
28
|
+
'margin-top--md margin-bottom--sm',
|
|
29
|
+
imageOnly ? styles.imageOnlyAuthorRow : 'row',
|
|
30
|
+
)}>
|
|
26
31
|
{authors.map((author, idx) => (
|
|
27
|
-
<div
|
|
32
|
+
<div
|
|
33
|
+
className={clsx(
|
|
34
|
+
!imageOnly && 'col col--6',
|
|
35
|
+
imageOnly ? styles.imageOnlyAuthorCol : styles.authorCol,
|
|
36
|
+
)}
|
|
37
|
+
key={idx}>
|
|
28
38
|
<BlogPostAuthor
|
|
29
39
|
author={{
|
|
30
40
|
...author,
|
|
@@ -12,6 +12,7 @@ import Translate, {translate} from '@docusaurus/Translate';
|
|
|
12
12
|
import Link from '@docusaurus/Link';
|
|
13
13
|
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
14
14
|
import {usePluralForm} from '@docusaurus/theme-common';
|
|
15
|
+
import {blogPostContainerID} from '@docusaurus/utils-common';
|
|
15
16
|
import MDXComponents from '@theme/MDXComponents';
|
|
16
17
|
import EditThisPage from '@theme/EditThisPage';
|
|
17
18
|
import type {Props} from '@theme/BlogPostItem';
|
|
@@ -65,11 +66,14 @@ function BlogPostItem(props: Props): JSX.Element {
|
|
|
65
66
|
const image = assets.image ?? frontMatter.image;
|
|
66
67
|
const truncatedPost = !isBlogPostPage && truncated;
|
|
67
68
|
const tagsExists = tags.length > 0;
|
|
69
|
+
const TitleHeading = isBlogPostPage ? 'h1' : 'h2';
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
return (
|
|
72
|
+
<article
|
|
73
|
+
className={!isBlogPostPage ? 'margin-bottom--xl' : undefined}
|
|
74
|
+
itemProp="blogPost"
|
|
75
|
+
itemScope
|
|
76
|
+
itemType="http://schema.org/BlogPosting">
|
|
73
77
|
<header>
|
|
74
78
|
<TitleHeading className={styles.blogPostTitle} itemProp="headline">
|
|
75
79
|
{isBlogPostPage ? (
|
|
@@ -94,22 +98,16 @@ function BlogPostItem(props: Props): JSX.Element {
|
|
|
94
98
|
</div>
|
|
95
99
|
<BlogPostAuthors authors={authors} assets={assets} />
|
|
96
100
|
</header>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<article
|
|
102
|
-
className={!isBlogPostPage ? 'margin-bottom--xl' : undefined}
|
|
103
|
-
itemProp="blogPost"
|
|
104
|
-
itemScope
|
|
105
|
-
itemType="http://schema.org/BlogPosting">
|
|
106
|
-
{renderPostHeader()}
|
|
107
101
|
|
|
108
102
|
{image && (
|
|
109
103
|
<meta itemProp="image" content={withBaseUrl(image, {absolute: true})} />
|
|
110
104
|
)}
|
|
111
105
|
|
|
112
|
-
<div
|
|
106
|
+
<div
|
|
107
|
+
// This ID is used for the feed generation to locate the main content
|
|
108
|
+
id={isBlogPostPage ? blogPostContainerID : undefined}
|
|
109
|
+
className="markdown"
|
|
110
|
+
itemProp="articleBody">
|
|
113
111
|
<MDXProvider components={MDXComponents}>{children}</MDXProvider>
|
|
114
112
|
</div>
|
|
115
113
|
|
|
@@ -16,14 +16,17 @@ import TOC from '@theme/TOC';
|
|
|
16
16
|
|
|
17
17
|
function BlogPostPage(props: Props): JSX.Element {
|
|
18
18
|
const {content: BlogPostContents, sidebar} = props;
|
|
19
|
+
const {assets, metadata} = BlogPostContents;
|
|
19
20
|
const {
|
|
20
|
-
|
|
21
|
+
title,
|
|
22
|
+
description,
|
|
23
|
+
nextItem,
|
|
24
|
+
prevItem,
|
|
25
|
+
date,
|
|
26
|
+
tags,
|
|
27
|
+
authors,
|
|
21
28
|
frontMatter,
|
|
22
|
-
|
|
23
|
-
metadata,
|
|
24
|
-
} = BlogPostContents;
|
|
25
|
-
const {title, description, nextItem, prevItem, date, tags, authors} =
|
|
26
|
-
metadata;
|
|
29
|
+
} = metadata;
|
|
27
30
|
const {
|
|
28
31
|
hide_table_of_contents: hideTableOfContents,
|
|
29
32
|
keywords,
|
|
@@ -59,7 +62,7 @@ function BlogPostPage(props: Props): JSX.Element {
|
|
|
59
62
|
<meta property="og:type" content="article" />
|
|
60
63
|
<meta property="article:published_time" content={date} />
|
|
61
64
|
|
|
62
|
-
{/* TODO double check those article
|
|
65
|
+
{/* TODO double check those article meta array syntaxes, see https://ogp.me/#array */}
|
|
63
66
|
{authors.some((author) => author.url) && (
|
|
64
67
|
<meta
|
|
65
68
|
property="article:author"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import Translate, {translate} from '@docusaurus/Translate';
|
|
10
|
-
import
|
|
10
|
+
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
|
11
11
|
import type {Props} from '@theme/BlogPostPaginator';
|
|
12
12
|
|
|
13
13
|
function BlogPostPaginator(props: Props): JSX.Element {
|
|
@@ -23,34 +23,30 @@ function BlogPostPaginator(props: Props): JSX.Element {
|
|
|
23
23
|
})}>
|
|
24
24
|
<div className="pagination-nav__item">
|
|
25
25
|
{prevItem && (
|
|
26
|
-
<
|
|
27
|
-
|
|
26
|
+
<PaginatorNavLink
|
|
27
|
+
{...prevItem}
|
|
28
|
+
subLabel={
|
|
28
29
|
<Translate
|
|
29
30
|
id="theme.blog.post.paginator.newerPost"
|
|
30
31
|
description="The blog post button label to navigate to the newer/previous post">
|
|
31
32
|
Newer Post
|
|
32
33
|
</Translate>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
« {prevItem.title}
|
|
36
|
-
</div>
|
|
37
|
-
</Link>
|
|
34
|
+
}
|
|
35
|
+
/>
|
|
38
36
|
)}
|
|
39
37
|
</div>
|
|
40
38
|
<div className="pagination-nav__item pagination-nav__item--next">
|
|
41
39
|
{nextItem && (
|
|
42
|
-
<
|
|
43
|
-
|
|
40
|
+
<PaginatorNavLink
|
|
41
|
+
{...nextItem}
|
|
42
|
+
subLabel={
|
|
44
43
|
<Translate
|
|
45
44
|
id="theme.blog.post.paginator.olderPost"
|
|
46
45
|
description="The blog post button label to navigate to the older/next post">
|
|
47
46
|
Older Post
|
|
48
47
|
</Translate>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{nextItem.title} »
|
|
52
|
-
</div>
|
|
53
|
-
</Link>
|
|
48
|
+
}
|
|
49
|
+
/>
|
|
54
50
|
)}
|
|
55
51
|
</div>
|
|
56
52
|
</nav>
|