@docusaurus/theme-classic 2.0.0-beta.21 → 2.0.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/getSwizzleConfig.js +5 -5
- package/lib/index.js +4 -2
- package/lib/theme/Admonition/index.d.ts +1 -1
- package/lib/theme/Admonition/index.js +139 -57
- package/lib/{admonitions.css → theme/Admonition/styles.module.css} +14 -15
- package/lib/theme/AnnouncementBar/index.js +3 -2
- package/lib/theme/BackToTopButton/index.js +2 -1
- package/lib/theme/BlogListPage/index.js +2 -11
- package/lib/theme/BlogPostItem/Container/index.d.ts +9 -0
- package/lib/theme/BlogPostItem/Container/index.js +26 -0
- package/lib/theme/BlogPostItem/Content/index.d.ts +9 -0
- package/lib/theme/BlogPostItem/Content/index.js +23 -0
- package/lib/theme/BlogPostItem/Footer/ReadMoreLink/index.d.ts +9 -0
- package/lib/theme/BlogPostItem/Footer/ReadMoreLink/index.js +38 -0
- package/lib/theme/BlogPostItem/Footer/index.d.ts +8 -0
- package/lib/theme/BlogPostItem/Footer/index.js +52 -0
- package/lib/theme/BlogPostItem/Footer/styles.module.css +10 -0
- package/lib/theme/BlogPostItem/Header/Author/index.d.ts +9 -0
- package/lib/theme/{BlogPostAuthor → BlogPostItem/Header/Author}/index.js +3 -2
- package/lib/theme/BlogPostItem/Header/Authors/index.d.ts +9 -0
- package/{src/theme/BlogPostAuthors/index.tsx → lib/theme/BlogPostItem/Header/Authors/index.js} +9 -10
- package/lib/theme/{BlogPostAuthors → BlogPostItem/Header/Authors}/styles.module.css +0 -0
- package/lib/theme/{BlogPostAuthors → BlogPostItem/Header/Info}/index.d.ts +2 -2
- package/lib/theme/BlogPostItem/Header/Info/index.js +60 -0
- package/lib/theme/BlogPostItem/Header/Info/styles.module.css +10 -0
- package/lib/theme/BlogPostItem/Header/Title/index.d.ts +9 -0
- package/lib/theme/BlogPostItem/Header/Title/index.js +27 -0
- package/{src/theme/BlogPostItem → lib/theme/BlogPostItem/Header/Title}/styles.module.css +2 -10
- package/lib/theme/BlogPostItem/Header/index.d.ts +8 -0
- package/lib/theme/BlogPostItem/Header/index.js +19 -0
- package/lib/theme/BlogPostItem/index.d.ts +1 -1
- package/lib/theme/BlogPostItem/index.js +16 -142
- package/lib/theme/BlogPostItems/index.d.ts +9 -0
- package/lib/theme/BlogPostItems/index.js +27 -0
- package/lib/theme/BlogPostPage/Metadata/index.d.ts +8 -0
- package/lib/theme/BlogPostPage/Metadata/index.js +41 -0
- package/lib/theme/BlogPostPage/index.js +21 -60
- package/lib/theme/BlogTagsListPage/index.js +1 -1
- package/lib/theme/BlogTagsPostsPage/index.d.ts +1 -1
- package/lib/theme/BlogTagsPostsPage/index.js +36 -30
- package/lib/theme/CodeBlock/Container/index.js +2 -5
- package/lib/theme/CodeBlock/Content/String.js +2 -3
- package/lib/theme/CodeBlock/CopyButton/index.js +1 -0
- package/lib/theme/CodeBlock/Line/styles.module.css +7 -7
- package/lib/theme/ColorModeToggle/index.js +2 -2
- package/lib/theme/DocBreadcrumbs/index.js +3 -3
- package/lib/theme/DocCard/index.js +4 -1
- package/lib/theme/DocCardList/index.js +2 -2
- package/lib/theme/DocItem/Content/index.d.ts +9 -0
- package/lib/theme/DocItem/Content/index.js +44 -0
- package/lib/theme/DocItem/Footer/index.d.ts +8 -0
- package/lib/theme/{DocItemFooter → DocItem/Footer}/index.js +3 -3
- package/lib/theme/{DocItemFooter → DocItem/Footer}/styles.module.css +0 -0
- package/lib/theme/{BlogPostAuthor → DocItem/Layout}/index.d.ts +2 -2
- package/lib/theme/DocItem/Layout/index.js +59 -0
- package/lib/theme/DocItem/Layout/styles.module.css +17 -0
- package/lib/theme/DocItem/Metadata/index.d.ts +8 -0
- package/lib/theme/DocItem/Metadata/index.js +20 -0
- package/lib/theme/{DocItemFooter → DocItem/Paginator}/index.d.ts +5 -3
- package/lib/theme/DocItem/Paginator/index.js +17 -0
- package/lib/theme/DocItem/TOC/Desktop/index.d.ts +8 -0
- package/lib/theme/DocItem/TOC/Desktop/index.js +21 -0
- package/lib/theme/DocItem/TOC/Mobile/index.d.ts +8 -0
- package/lib/theme/DocItem/TOC/Mobile/index.js +23 -0
- package/lib/theme/DocItem/{styles.module.css → TOC/Mobile/styles.module.css} +0 -9
- package/lib/theme/DocItem/index.js +13 -106
- package/lib/theme/DocPage/Layout/Main/index.js +1 -1
- package/lib/theme/DocPage/Layout/Sidebar/ExpandButton/index.js +1 -1
- package/lib/theme/DocPage/Layout/Sidebar/index.js +2 -1
- package/lib/theme/DocPage/Layout/index.js +1 -1
- package/lib/theme/DocPage/index.js +2 -3
- package/lib/theme/DocSidebar/Desktop/CollapseButton/index.js +1 -1
- package/lib/theme/DocSidebar/Desktop/Content/index.js +2 -2
- package/lib/theme/DocSidebar/Mobile/index.js +1 -1
- package/lib/theme/DocSidebarItem/Category/index.js +6 -4
- package/lib/theme/DocSidebarItem/Link/index.js +3 -2
- package/lib/theme/DocSidebarItems/index.js +1 -1
- package/lib/theme/DocVersionBadge/index.js +2 -1
- package/lib/theme/DocVersionBanner/index.js +2 -2
- package/lib/theme/EditThisPage/index.js +1 -1
- package/lib/theme/Footer/LinkItem/index.js +1 -1
- package/lib/theme/Footer/Logo/index.js +7 -2
- package/lib/theme/{IconArrow → Icon/Arrow}/index.d.ts +1 -1
- package/lib/theme/{IconArrow → Icon/Arrow}/index.js +0 -0
- package/lib/theme/{IconClose → Icon/Close}/index.d.ts +1 -1
- package/lib/theme/{IconClose → Icon/Close}/index.js +0 -0
- package/lib/theme/{IconDarkMode → Icon/DarkMode}/index.d.ts +1 -1
- package/lib/theme/{IconDarkMode → Icon/DarkMode}/index.js +0 -0
- package/lib/theme/{IconEdit → Icon/Edit}/index.d.ts +1 -1
- package/lib/theme/{IconEdit → Icon/Edit}/index.js +0 -0
- package/lib/theme/{IconEdit → Icon/Edit}/styles.module.css +0 -0
- package/lib/theme/{IconExternalLink → Icon/ExternalLink}/index.d.ts +1 -1
- package/lib/theme/{IconExternalLink → Icon/ExternalLink}/index.js +0 -0
- package/lib/theme/{IconExternalLink → Icon/ExternalLink}/styles.module.css +0 -0
- package/lib/theme/{IconHome → Icon/Home}/index.d.ts +1 -1
- package/lib/theme/{IconHome → Icon/Home}/index.js +0 -0
- package/lib/theme/{IconLanguage → Icon/Language}/index.d.ts +1 -1
- package/lib/theme/{IconLanguage → Icon/Language}/index.js +0 -0
- package/lib/theme/{IconLightMode → Icon/LightMode}/index.d.ts +1 -1
- package/lib/theme/{IconLightMode → Icon/LightMode}/index.js +0 -0
- package/lib/theme/{IconMenu → Icon/Menu}/index.d.ts +1 -1
- package/lib/theme/{IconMenu → Icon/Menu}/index.js +0 -0
- package/lib/theme/Layout/Provider/index.d.ts +9 -0
- package/lib/theme/Layout/Provider/index.js +29 -0
- package/lib/theme/Layout/index.d.ts +0 -1
- package/lib/theme/Layout/index.js +12 -10
- package/{src/theme/Layout/styles.css → lib/theme/Layout/styles.module.css} +10 -12
- package/lib/theme/Logo/index.js +35 -17
- package/lib/theme/MDXComponents/Code.js +1 -1
- package/lib/theme/MDXComponents/index.js +2 -0
- package/lib/theme/MDXPage/index.js +6 -4
- package/lib/theme/Navbar/Content/index.js +2 -2
- package/lib/theme/Navbar/Layout/index.js +2 -2
- package/lib/theme/Navbar/MobileSidebar/Header/index.js +2 -2
- package/lib/theme/Navbar/MobileSidebar/Layout/index.js +1 -1
- package/lib/theme/Navbar/MobileSidebar/PrimaryMenu/index.js +2 -1
- package/lib/theme/Navbar/MobileSidebar/SecondaryMenu/index.js +2 -1
- package/lib/theme/Navbar/MobileSidebar/Toggle/index.js +2 -2
- package/lib/theme/Navbar/MobileSidebar/index.js +1 -1
- package/lib/theme/NavbarItem/DocNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DocSidebarNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +2 -4
- package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DropdownNavbarItem.js +2 -3
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +2 -2
- package/lib/theme/NavbarItem/NavbarNavLink.js +1 -1
- package/lib/theme/SiteMetadata/index.js +2 -3
- package/lib/theme/SkipToContent/index.js +1 -1
- package/lib/theme/TOCItems/index.js +2 -2
- package/lib/theme/Tabs/index.js +2 -2
- package/lib/validateThemeConfig.js +13 -18
- package/package.json +19 -15
- package/src/getSwizzleConfig.ts +5 -5
- package/src/index.ts +4 -2
- package/src/theme/Admonition/index.tsx +161 -58
- package/src/{admonitions.css → theme/Admonition/styles.module.css} +14 -15
- package/src/theme/AnnouncementBar/index.tsx +3 -2
- package/src/theme/BackToTopButton/index.tsx +2 -1
- package/src/theme/BlogListPage/index.tsx +2 -11
- package/src/theme/BlogPostItem/Container/index.tsx +32 -0
- package/src/theme/BlogPostItem/Content/index.tsx +29 -0
- package/src/theme/BlogPostItem/Footer/ReadMoreLink/index.tsx +44 -0
- package/src/theme/BlogPostItem/Footer/index.tsx +60 -0
- package/src/theme/BlogPostItem/Footer/styles.module.css +10 -0
- package/src/theme/{BlogPostAuthor → BlogPostItem/Header/Author}/index.tsx +8 -3
- package/{lib/theme/BlogPostAuthors/index.js → src/theme/BlogPostItem/Header/Authors/index.tsx} +14 -3
- package/src/theme/{BlogPostAuthors → BlogPostItem/Header/Authors}/styles.module.css +0 -0
- package/src/theme/BlogPostItem/Header/Info/index.tsx +71 -0
- package/src/theme/BlogPostItem/Header/Info/styles.module.css +10 -0
- package/src/theme/BlogPostItem/Header/Title/index.tsx +33 -0
- package/{lib/theme/BlogPostItem → src/theme/BlogPostItem/Header/Title}/styles.module.css +2 -10
- package/src/theme/BlogPostItem/Header/index.tsx +21 -0
- package/src/theme/BlogPostItem/index.tsx +19 -145
- package/src/theme/BlogPostItems/index.tsx +30 -0
- package/src/theme/BlogPostPage/Metadata/index.tsx +44 -0
- package/src/theme/BlogPostPage/index.tsx +29 -62
- package/src/theme/BlogTagsListPage/index.tsx +1 -1
- package/src/theme/BlogTagsPostsPage/index.tsx +42 -35
- package/src/theme/CodeBlock/Container/index.tsx +3 -6
- package/src/theme/CodeBlock/Content/String.tsx +2 -3
- package/src/theme/CodeBlock/CopyButton/index.tsx +1 -0
- package/src/theme/CodeBlock/Line/styles.module.css +7 -7
- package/src/theme/ColorModeToggle/index.tsx +2 -2
- package/src/theme/DocBreadcrumbs/index.tsx +3 -3
- package/src/theme/DocCard/index.tsx +4 -1
- package/src/theme/DocCardList/index.tsx +2 -2
- package/src/theme/DocItem/Content/index.tsx +48 -0
- package/src/theme/{DocItemFooter → DocItem/Footer}/index.tsx +4 -5
- package/src/theme/{DocItemFooter → DocItem/Footer}/styles.module.css +0 -0
- package/src/theme/DocItem/Layout/index.tsx +68 -0
- package/src/theme/DocItem/Layout/styles.module.css +17 -0
- package/src/theme/DocItem/Metadata/index.tsx +22 -0
- package/src/theme/DocItem/Paginator/index.tsx +19 -0
- package/src/theme/DocItem/TOC/Desktop/index.tsx +24 -0
- package/src/theme/DocItem/TOC/Mobile/index.tsx +27 -0
- package/src/theme/DocItem/{styles.module.css → TOC/Mobile/styles.module.css} +0 -9
- package/src/theme/DocItem/index.tsx +13 -115
- package/src/theme/DocPage/Layout/Main/index.tsx +1 -1
- package/src/theme/DocPage/Layout/Sidebar/ExpandButton/index.tsx +1 -1
- package/src/theme/DocPage/Layout/Sidebar/index.tsx +2 -1
- package/src/theme/DocPage/Layout/index.tsx +1 -1
- package/src/theme/DocPage/index.tsx +2 -3
- package/src/theme/DocPaginator/index.tsx +0 -1
- package/src/theme/DocSidebar/Desktop/CollapseButton/index.tsx +1 -1
- package/src/theme/DocSidebar/Desktop/Content/index.tsx +2 -2
- package/src/theme/DocSidebar/Mobile/index.tsx +1 -1
- package/src/theme/DocSidebarItem/Category/index.tsx +6 -4
- package/src/theme/DocSidebarItem/Link/index.tsx +3 -2
- package/src/theme/DocSidebarItems/index.tsx +1 -1
- package/src/theme/DocVersionBadge/index.tsx +2 -1
- package/src/theme/DocVersionBanner/index.tsx +2 -3
- package/src/theme/EditThisPage/index.tsx +1 -1
- package/src/theme/Footer/LinkItem/index.tsx +1 -1
- package/src/theme/Footer/Logo/index.tsx +7 -2
- package/src/theme/{IconArrow → Icon/Arrow}/index.tsx +1 -1
- package/src/theme/{IconClose → Icon/Close}/index.tsx +1 -1
- package/src/theme/{IconDarkMode → Icon/DarkMode}/index.tsx +1 -1
- package/src/theme/{IconEdit → Icon/Edit}/index.tsx +1 -1
- package/src/theme/{IconEdit → Icon/Edit}/styles.module.css +0 -0
- package/src/theme/{IconExternalLink → Icon/ExternalLink}/index.tsx +1 -1
- package/src/theme/{IconExternalLink → Icon/ExternalLink}/styles.module.css +0 -0
- package/src/theme/{IconHome → Icon/Home}/index.tsx +1 -1
- package/src/theme/{IconLanguage → Icon/Language}/index.tsx +1 -1
- package/src/theme/{IconLightMode → Icon/LightMode}/index.tsx +1 -1
- package/src/theme/{IconMenu → Icon/Menu}/index.tsx +1 -1
- package/src/theme/Layout/Provider/index.tsx +33 -0
- package/src/theme/Layout/index.tsx +12 -10
- package/{lib/theme/Layout/styles.css → src/theme/Layout/styles.module.css} +10 -12
- package/src/theme/Logo/index.tsx +49 -19
- package/src/theme/MDXComponents/Code.tsx +5 -2
- package/src/theme/MDXComponents/Details.tsx +2 -1
- package/src/theme/MDXComponents/Head.tsx +3 -5
- package/src/theme/MDXComponents/Pre.tsx +2 -1
- package/src/theme/MDXComponents/index.tsx +2 -0
- package/src/theme/MDXPage/index.tsx +6 -4
- package/src/theme/Navbar/Content/index.tsx +2 -2
- package/src/theme/Navbar/Layout/index.tsx +2 -2
- package/src/theme/Navbar/MobileSidebar/Header/index.tsx +2 -2
- package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +1 -1
- package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +2 -1
- package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +2 -1
- package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +2 -2
- package/src/theme/Navbar/MobileSidebar/index.tsx +1 -1
- package/src/theme/NavbarItem/DocNavbarItem.tsx +1 -1
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +1 -1
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +2 -4
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +1 -1
- package/src/theme/NavbarItem/DropdownNavbarItem.tsx +2 -3
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +2 -2
- package/src/theme/NavbarItem/NavbarNavLink.tsx +1 -1
- package/src/theme/NavbarItem/index.tsx +1 -1
- package/src/theme/SiteMetadata/index.tsx +2 -3
- package/src/theme/SkipToContent/index.tsx +1 -1
- package/src/theme/TOCItems/index.tsx +3 -3
- package/src/theme/Tabs/index.tsx +2 -2
- package/src/theme-classic.d.ts +128 -36
- package/src/validateThemeConfig.ts +14 -18
- package/lib/theme/LayoutProviders/index.d.ts +0 -9
- package/lib/theme/LayoutProviders/index.js +0 -33
- package/src/theme/LayoutProviders/index.tsx +0 -36
|
@@ -5,102 +5,205 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React from 'react';
|
|
8
|
+
import React, {type ReactNode} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
import Translate from '@docusaurus/Translate';
|
|
10
12
|
import type {Props} from '@theme/Admonition';
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
height="16"
|
|
18
|
-
viewBox="0 0 14 16">
|
|
14
|
+
import styles from './styles.module.css';
|
|
15
|
+
|
|
16
|
+
function NoteIcon() {
|
|
17
|
+
return (
|
|
18
|
+
<svg viewBox="0 0 14 16">
|
|
19
19
|
<path
|
|
20
20
|
fillRule="evenodd"
|
|
21
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
22
|
/>
|
|
23
23
|
</svg>
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
viewBox="0 0 12 16">
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function TipIcon() {
|
|
28
|
+
return (
|
|
29
|
+
<svg viewBox="0 0 12 16">
|
|
31
30
|
<path
|
|
32
31
|
fillRule="evenodd"
|
|
33
32
|
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
33
|
/>
|
|
35
34
|
</svg>
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
viewBox="0 0 12 16">
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function DangerIcon() {
|
|
39
|
+
return (
|
|
40
|
+
<svg viewBox="0 0 12 16">
|
|
43
41
|
<path
|
|
44
42
|
fillRule="evenodd"
|
|
45
43
|
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
44
|
/>
|
|
47
45
|
</svg>
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
viewBox="0 0 14 16">
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function InfoIcon() {
|
|
50
|
+
return (
|
|
51
|
+
<svg viewBox="0 0 14 16">
|
|
55
52
|
<path
|
|
56
53
|
fillRule="evenodd"
|
|
57
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"
|
|
58
55
|
/>
|
|
59
56
|
</svg>
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
viewBox="0 0 16 16">
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function CautionIcon() {
|
|
61
|
+
return (
|
|
62
|
+
<svg viewBox="0 0 16 16">
|
|
67
63
|
<path
|
|
68
64
|
fillRule="evenodd"
|
|
69
65
|
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
66
|
/>
|
|
71
67
|
</svg>
|
|
72
|
-
)
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
type AdmonitionConfig = {
|
|
72
|
+
iconComponent: React.ComponentType;
|
|
73
|
+
infimaClassName: string;
|
|
74
|
+
label: ReactNode;
|
|
73
75
|
};
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
|
|
78
|
+
const AdmonitionConfigs: Record<Props['type'], AdmonitionConfig> = {
|
|
79
|
+
note: {
|
|
80
|
+
infimaClassName: 'secondary',
|
|
81
|
+
iconComponent: NoteIcon,
|
|
82
|
+
label: (
|
|
83
|
+
<Translate
|
|
84
|
+
id="theme.admonition.note"
|
|
85
|
+
description="The default label used for the Note admonition (:::note)">
|
|
86
|
+
note
|
|
87
|
+
</Translate>
|
|
88
|
+
),
|
|
89
|
+
},
|
|
90
|
+
tip: {
|
|
91
|
+
infimaClassName: 'success',
|
|
92
|
+
iconComponent: TipIcon,
|
|
93
|
+
label: (
|
|
94
|
+
<Translate
|
|
95
|
+
id="theme.admonition.tip"
|
|
96
|
+
description="The default label used for the Tip admonition (:::tip)">
|
|
97
|
+
tip
|
|
98
|
+
</Translate>
|
|
99
|
+
),
|
|
100
|
+
},
|
|
101
|
+
danger: {
|
|
102
|
+
infimaClassName: 'danger',
|
|
103
|
+
iconComponent: DangerIcon,
|
|
104
|
+
label: (
|
|
105
|
+
<Translate
|
|
106
|
+
id="theme.admonition.danger"
|
|
107
|
+
description="The default label used for the Danger admonition (:::danger)">
|
|
108
|
+
danger
|
|
109
|
+
</Translate>
|
|
110
|
+
),
|
|
111
|
+
},
|
|
112
|
+
info: {
|
|
113
|
+
infimaClassName: 'info',
|
|
114
|
+
iconComponent: InfoIcon,
|
|
115
|
+
label: (
|
|
116
|
+
<Translate
|
|
117
|
+
id="theme.admonition.info"
|
|
118
|
+
description="The default label used for the Info admonition (:::info)">
|
|
119
|
+
info
|
|
120
|
+
</Translate>
|
|
121
|
+
),
|
|
122
|
+
},
|
|
123
|
+
caution: {
|
|
124
|
+
infimaClassName: 'warning',
|
|
125
|
+
iconComponent: CautionIcon,
|
|
126
|
+
label: (
|
|
127
|
+
<Translate
|
|
128
|
+
id="theme.admonition.caution"
|
|
129
|
+
description="The default label used for the Caution admonition (:::caution)">
|
|
130
|
+
caution
|
|
131
|
+
</Translate>
|
|
132
|
+
),
|
|
133
|
+
},
|
|
81
134
|
};
|
|
82
135
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
136
|
+
// Legacy aliases, undocumented but kept for retro-compatibility
|
|
137
|
+
const aliases = {
|
|
138
|
+
secondary: 'note',
|
|
139
|
+
important: 'info',
|
|
140
|
+
success: 'tip',
|
|
141
|
+
warning: 'danger',
|
|
142
|
+
} as const;
|
|
143
|
+
|
|
144
|
+
function getAdmonitionConfig(unsafeType: string): AdmonitionConfig {
|
|
145
|
+
const type =
|
|
146
|
+
(aliases as {[key: string]: Props['type']})[unsafeType] ?? unsafeType;
|
|
147
|
+
const config = (AdmonitionConfigs as {[key: string]: AdmonitionConfig})[type];
|
|
148
|
+
if (config) {
|
|
149
|
+
return config;
|
|
150
|
+
}
|
|
151
|
+
console.warn(
|
|
152
|
+
`No admonition config found for admonition type "${type}". Using Info as fallback.`,
|
|
153
|
+
);
|
|
154
|
+
return AdmonitionConfigs.info;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Workaround because it's difficult in MDX v1 to provide a MDX title as props
|
|
158
|
+
// See https://github.com/facebook/docusaurus/pull/7152#issuecomment-1145779682
|
|
159
|
+
function extractMDXAdmonitionTitle(children: ReactNode): {
|
|
160
|
+
mdxAdmonitionTitle: ReactNode | undefined;
|
|
161
|
+
rest: ReactNode;
|
|
162
|
+
} {
|
|
163
|
+
const items = React.Children.toArray(children);
|
|
164
|
+
const mdxAdmonitionTitle = items.find(
|
|
165
|
+
(item) =>
|
|
166
|
+
React.isValidElement(item) &&
|
|
167
|
+
(item.props as {mdxType: string} | null)?.mdxType ===
|
|
168
|
+
'mdxAdmonitionTitle',
|
|
169
|
+
);
|
|
170
|
+
const rest = <>{items.filter((item) => item !== mdxAdmonitionTitle)}</>;
|
|
171
|
+
return {
|
|
172
|
+
mdxAdmonitionTitle,
|
|
173
|
+
rest,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function processAdmonitionProps(props: Props): Props {
|
|
178
|
+
const {mdxAdmonitionTitle, rest} = extractMDXAdmonitionTitle(props.children);
|
|
179
|
+
return {
|
|
180
|
+
...props,
|
|
181
|
+
title: props.title ?? mdxAdmonitionTitle,
|
|
182
|
+
children: rest,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export default function Admonition(props: Props): JSX.Element {
|
|
187
|
+
const {children, type, title, icon: iconProp} = processAdmonitionProps(props);
|
|
188
|
+
|
|
189
|
+
const typeConfig = getAdmonitionConfig(type);
|
|
190
|
+
const titleLabel = title ?? typeConfig.label;
|
|
191
|
+
const {iconComponent: IconComponent} = typeConfig;
|
|
192
|
+
const icon = iconProp ?? <IconComponent />;
|
|
89
193
|
return (
|
|
90
194
|
<div
|
|
91
195
|
className={clsx(
|
|
92
|
-
|
|
93
|
-
|
|
196
|
+
ThemeClassNames.common.admonition,
|
|
197
|
+
ThemeClassNames.common.admonitionType(props.type),
|
|
94
198
|
'alert',
|
|
95
|
-
`alert--${
|
|
199
|
+
`alert--${typeConfig.infimaClassName}`,
|
|
200
|
+
styles.admonition,
|
|
96
201
|
)}>
|
|
97
|
-
<div className=
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
{title}
|
|
101
|
-
</h5>
|
|
202
|
+
<div className={styles.admonitionHeading}>
|
|
203
|
+
<span className={styles.admonitionIcon}>{icon}</span>
|
|
204
|
+
{titleLabel}
|
|
102
205
|
</div>
|
|
103
|
-
<div className=
|
|
206
|
+
<div className={styles.admonitionContent}>{children}</div>
|
|
104
207
|
</div>
|
|
105
208
|
);
|
|
106
209
|
}
|
|
@@ -5,35 +5,34 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
.admonition
|
|
9
|
-
margin-
|
|
10
|
-
|
|
8
|
+
.admonition {
|
|
9
|
+
margin-bottom: 1em;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.admonitionHeading {
|
|
13
|
+
font: var(--ifm-heading-font-weight) var(--ifm-h5-font-size) /
|
|
14
|
+
var(--ifm-heading-line-height) var(--ifm-heading-font-family);
|
|
11
15
|
text-transform: uppercase;
|
|
16
|
+
margin-bottom: 0.3rem;
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
.
|
|
19
|
+
.admonitionHeading code {
|
|
15
20
|
text-transform: none;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
|
-
.
|
|
23
|
+
.admonitionIcon {
|
|
19
24
|
display: inline-block;
|
|
20
25
|
vertical-align: middle;
|
|
21
26
|
margin-right: 0.4em;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
|
-
.
|
|
29
|
+
.admonitionIcon svg {
|
|
25
30
|
display: inline-block;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
stroke-width: 0;
|
|
31
|
+
height: 1.6em;
|
|
32
|
+
width: 1.6em;
|
|
29
33
|
fill: var(--ifm-alert-foreground-color);
|
|
30
|
-
stroke: var(--ifm-alert-foreground-color);
|
|
31
34
|
}
|
|
32
35
|
|
|
33
|
-
.
|
|
36
|
+
.admonitionContent > :last-child {
|
|
34
37
|
margin-bottom: 0;
|
|
35
38
|
}
|
|
36
|
-
|
|
37
|
-
.admonition {
|
|
38
|
-
margin-bottom: 1em;
|
|
39
|
-
}
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {useThemeConfig
|
|
10
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
11
|
+
import {useAnnouncementBar} from '@docusaurus/theme-common/internal';
|
|
11
12
|
import {translate} from '@docusaurus/Translate';
|
|
12
|
-
import IconClose from '@theme/
|
|
13
|
+
import IconClose from '@theme/Icon/Close';
|
|
13
14
|
|
|
14
15
|
import styles from './styles.module.css';
|
|
15
16
|
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import {translate} from '@docusaurus/Translate';
|
|
11
|
-
import {ThemeClassNames
|
|
11
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
12
|
+
import {useBackToTopButton} from '@docusaurus/theme-common/internal';
|
|
12
13
|
|
|
13
14
|
import styles from './styles.module.css';
|
|
14
15
|
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
ThemeClassNames,
|
|
16
16
|
} from '@docusaurus/theme-common';
|
|
17
17
|
import BlogLayout from '@theme/BlogLayout';
|
|
18
|
-
import BlogPostItem from '@theme/BlogPostItem';
|
|
19
18
|
import BlogListPaginator from '@theme/BlogListPaginator';
|
|
20
19
|
import SearchMetadata from '@theme/SearchMetadata';
|
|
21
20
|
import type {Props} from '@theme/BlogListPage';
|
|
21
|
+
import BlogPostItems from '@theme/BlogPostItems';
|
|
22
22
|
|
|
23
23
|
function BlogListPageMetadata(props: Props): JSX.Element {
|
|
24
24
|
const {metadata} = props;
|
|
@@ -40,16 +40,7 @@ function BlogListPageContent(props: Props): JSX.Element {
|
|
|
40
40
|
const {metadata, items, sidebar} = props;
|
|
41
41
|
return (
|
|
42
42
|
<BlogLayout sidebar={sidebar}>
|
|
43
|
-
{items
|
|
44
|
-
<BlogPostItem
|
|
45
|
-
key={BlogPostContent.metadata.permalink}
|
|
46
|
-
frontMatter={BlogPostContent.frontMatter}
|
|
47
|
-
assets={BlogPostContent.assets}
|
|
48
|
-
metadata={BlogPostContent.metadata}
|
|
49
|
-
truncated={BlogPostContent.metadata.truncated}>
|
|
50
|
-
<BlogPostContent />
|
|
51
|
-
</BlogPostItem>
|
|
52
|
-
))}
|
|
43
|
+
<BlogPostItems items={items} />
|
|
53
44
|
<BlogListPaginator metadata={metadata} />
|
|
54
45
|
</BlogLayout>
|
|
55
46
|
);
|
|
@@ -0,0 +1,32 @@
|
|
|
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 {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
10
|
+
import {useBlogPost} from '@docusaurus/theme-common/internal';
|
|
11
|
+
import type {Props} from '@theme/BlogPostItem/Container';
|
|
12
|
+
|
|
13
|
+
export default function BlogPostItemContainer({
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
}: Props): JSX.Element {
|
|
17
|
+
const {frontMatter, assets} = useBlogPost();
|
|
18
|
+
const {withBaseUrl} = useBaseUrlUtils();
|
|
19
|
+
const image = assets.image ?? frontMatter.image;
|
|
20
|
+
return (
|
|
21
|
+
<article
|
|
22
|
+
className={className}
|
|
23
|
+
itemProp="blogPost"
|
|
24
|
+
itemScope
|
|
25
|
+
itemType="http://schema.org/BlogPosting">
|
|
26
|
+
{image && (
|
|
27
|
+
<meta itemProp="image" content={withBaseUrl(image, {absolute: true})} />
|
|
28
|
+
)}
|
|
29
|
+
{children}
|
|
30
|
+
</article>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 {blogPostContainerID} from '@docusaurus/utils-common';
|
|
11
|
+
import {useBlogPost} from '@docusaurus/theme-common/internal';
|
|
12
|
+
import MDXContent from '@theme/MDXContent';
|
|
13
|
+
import type {Props} from '@theme/BlogPostItem/Content';
|
|
14
|
+
|
|
15
|
+
export default function BlogPostItemContent({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
}: Props): JSX.Element {
|
|
19
|
+
const {isBlogPostPage} = useBlogPost();
|
|
20
|
+
return (
|
|
21
|
+
<div
|
|
22
|
+
// This ID is used for the feed generation to locate the main content
|
|
23
|
+
id={isBlogPostPage ? blogPostContainerID : undefined}
|
|
24
|
+
className={clsx('markdown', className)}
|
|
25
|
+
itemProp="articleBody">
|
|
26
|
+
<MDXContent>{children}</MDXContent>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 Translate, {translate} from '@docusaurus/Translate';
|
|
10
|
+
import Link from '@docusaurus/Link';
|
|
11
|
+
import type {Props} from '@theme/BlogPostItem/Footer/ReadMoreLink';
|
|
12
|
+
|
|
13
|
+
function ReadMoreLabel() {
|
|
14
|
+
return (
|
|
15
|
+
<b>
|
|
16
|
+
<Translate
|
|
17
|
+
id="theme.blog.post.readMore"
|
|
18
|
+
description="The label used in blog post item excerpts to link to full blog posts">
|
|
19
|
+
Read More
|
|
20
|
+
</Translate>
|
|
21
|
+
</b>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default function BlogPostItemFooterReadMoreLink(
|
|
26
|
+
props: Props,
|
|
27
|
+
): JSX.Element {
|
|
28
|
+
const {blogPostTitle, ...linkProps} = props;
|
|
29
|
+
return (
|
|
30
|
+
<Link
|
|
31
|
+
aria-label={translate(
|
|
32
|
+
{
|
|
33
|
+
message: 'Read more about {title}',
|
|
34
|
+
id: 'theme.blog.post.readMoreLabel',
|
|
35
|
+
description:
|
|
36
|
+
'The ARIA label for the link to full blog posts from excerpts',
|
|
37
|
+
},
|
|
38
|
+
{title: blogPostTitle},
|
|
39
|
+
)}
|
|
40
|
+
{...linkProps}>
|
|
41
|
+
<ReadMoreLabel />
|
|
42
|
+
</Link>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 {useBlogPost} from '@docusaurus/theme-common/internal';
|
|
11
|
+
import EditThisPage from '@theme/EditThisPage';
|
|
12
|
+
import TagsListInline from '@theme/TagsListInline';
|
|
13
|
+
import ReadMoreLink from '@theme/BlogPostItem/Footer/ReadMoreLink';
|
|
14
|
+
|
|
15
|
+
import styles from './styles.module.css';
|
|
16
|
+
|
|
17
|
+
export default function BlogPostItemFooter(): JSX.Element | null {
|
|
18
|
+
const {metadata, isBlogPostPage} = useBlogPost();
|
|
19
|
+
const {tags, title, editUrl, hasTruncateMarker} = metadata;
|
|
20
|
+
|
|
21
|
+
// A post is truncated if it's in the "list view" and it has a truncate marker
|
|
22
|
+
const truncatedPost = !isBlogPostPage && hasTruncateMarker;
|
|
23
|
+
|
|
24
|
+
const tagsExists = tags.length > 0;
|
|
25
|
+
|
|
26
|
+
const renderFooter = tagsExists || truncatedPost || editUrl;
|
|
27
|
+
|
|
28
|
+
if (!renderFooter) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<footer
|
|
34
|
+
className={clsx(
|
|
35
|
+
'row docusaurus-mt-lg',
|
|
36
|
+
isBlogPostPage && styles.blogPostFooterDetailsFull,
|
|
37
|
+
)}>
|
|
38
|
+
{tagsExists && (
|
|
39
|
+
<div className={clsx('col', {'col--9': truncatedPost})}>
|
|
40
|
+
<TagsListInline tags={tags} />
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
43
|
+
|
|
44
|
+
{isBlogPostPage && editUrl && (
|
|
45
|
+
<div className="col margin-top--sm">
|
|
46
|
+
<EditThisPage editUrl={editUrl} />
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
|
|
50
|
+
{truncatedPost && (
|
|
51
|
+
<div
|
|
52
|
+
className={clsx('col text--right', {
|
|
53
|
+
'col--3': tagsExists,
|
|
54
|
+
})}>
|
|
55
|
+
<ReadMoreLink blogPostTitle={title} to={metadata.permalink} />
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
</footer>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
9
10
|
import Link, {type Props as LinkProps} from '@docusaurus/Link';
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
import type {Props} from '@theme/BlogPostItem/Header/Author';
|
|
11
13
|
|
|
12
14
|
function MaybeLink(props: LinkProps): JSX.Element {
|
|
13
15
|
if (props.href) {
|
|
@@ -16,11 +18,14 @@ function MaybeLink(props: LinkProps): JSX.Element {
|
|
|
16
18
|
return <>{props.children}</>;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
export default function
|
|
21
|
+
export default function BlogPostItemHeaderAuthor({
|
|
22
|
+
author,
|
|
23
|
+
className,
|
|
24
|
+
}: Props): JSX.Element {
|
|
20
25
|
const {name, title, url, imageURL, email} = author;
|
|
21
26
|
const link = url || (email && `mailto:${email}`) || undefined;
|
|
22
27
|
return (
|
|
23
|
-
<div className=
|
|
28
|
+
<div className={clsx('avatar margin-bottom--sm', className)}>
|
|
24
29
|
{imageURL && (
|
|
25
30
|
<MaybeLink href={link} className="avatar__photo-link">
|
|
26
31
|
<img className="avatar__photo" src={imageURL} alt={name} />
|
package/{lib/theme/BlogPostAuthors/index.js → src/theme/BlogPostItem/Header/Authors/index.tsx}
RENAMED
|
@@ -4,12 +4,22 @@
|
|
|
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
|
+
|
|
7
8
|
import React from 'react';
|
|
8
9
|
import clsx from 'clsx';
|
|
9
|
-
import
|
|
10
|
+
import {useBlogPost} from '@docusaurus/theme-common/internal';
|
|
11
|
+
import BlogPostItemHeaderAuthor from '@theme/BlogPostItem/Header/Author';
|
|
12
|
+
import type {Props} from '@theme/BlogPostItem/Header/Authors';
|
|
10
13
|
import styles from './styles.module.css';
|
|
14
|
+
|
|
11
15
|
// Component responsible for the authors layout
|
|
12
|
-
export default function
|
|
16
|
+
export default function BlogPostItemHeaderAuthors({
|
|
17
|
+
className,
|
|
18
|
+
}: Props): JSX.Element | null {
|
|
19
|
+
const {
|
|
20
|
+
metadata: {authors},
|
|
21
|
+
assets,
|
|
22
|
+
} = useBlogPost();
|
|
13
23
|
const authorsCount = authors.length;
|
|
14
24
|
if (authorsCount === 0) {
|
|
15
25
|
return null;
|
|
@@ -20,6 +30,7 @@ export default function BlogPostAuthors({authors, assets}) {
|
|
|
20
30
|
className={clsx(
|
|
21
31
|
'margin-top--md margin-bottom--sm',
|
|
22
32
|
imageOnly ? styles.imageOnlyAuthorRow : 'row',
|
|
33
|
+
className,
|
|
23
34
|
)}>
|
|
24
35
|
{authors.map((author, idx) => (
|
|
25
36
|
<div
|
|
@@ -28,7 +39,7 @@ export default function BlogPostAuthors({authors, assets}) {
|
|
|
28
39
|
imageOnly ? styles.imageOnlyAuthorCol : styles.authorCol,
|
|
29
40
|
)}
|
|
30
41
|
key={idx}>
|
|
31
|
-
<
|
|
42
|
+
<BlogPostItemHeaderAuthor
|
|
32
43
|
author={{
|
|
33
44
|
...author,
|
|
34
45
|
// Handle author images using relative paths
|
|
File without changes
|