@docusaurus/theme-classic 3.4.0 → 3.5.1
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 +32 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -1
- package/lib/inlineScripts.js +3 -3
- package/lib/options.d.ts +0 -1
- package/lib/options.js +15 -3
- package/lib/theme/Admonition/Icon/Danger.d.ts +0 -2
- package/lib/theme/Admonition/Icon/Info.d.ts +0 -2
- package/lib/theme/Admonition/Icon/Note.d.ts +0 -2
- package/lib/theme/Admonition/Icon/Tip.d.ts +0 -2
- package/lib/theme/Admonition/Icon/Warning.d.ts +0 -2
- package/lib/theme/Admonition/Layout/index.d.ts +0 -2
- package/lib/theme/Admonition/Type/Caution.d.ts +0 -2
- package/lib/theme/Admonition/Type/Danger.d.ts +0 -2
- package/lib/theme/Admonition/Type/Info.d.ts +0 -2
- package/lib/theme/Admonition/Type/Note.d.ts +0 -2
- package/lib/theme/Admonition/Type/Tip.d.ts +0 -2
- package/lib/theme/Admonition/Type/Warning.d.ts +0 -2
- package/lib/theme/Admonition/Types.d.ts +0 -1
- package/lib/theme/Admonition/index.d.ts +0 -2
- package/lib/theme/AnnouncementBar/CloseButton/index.d.ts +0 -2
- package/lib/theme/AnnouncementBar/Content/index.d.ts +0 -2
- package/lib/theme/AnnouncementBar/index.d.ts +0 -1
- package/lib/theme/BackToTopButton/index.d.ts +0 -1
- package/lib/theme/Blog/Components/Author/Socials/index.d.ts +10 -0
- package/lib/theme/Blog/Components/Author/Socials/index.js +49 -0
- package/lib/theme/Blog/Components/Author/Socials/styles.module.css +39 -0
- package/lib/theme/Blog/Components/Author/index.d.ts +8 -0
- package/lib/theme/Blog/Components/Author/index.js +86 -0
- package/lib/theme/Blog/Components/Author/styles.module.css +74 -0
- package/lib/theme/Blog/Pages/BlogAuthorsListPage/index.d.ts +9 -0
- package/lib/theme/Blog/Pages/BlogAuthorsListPage/index.js +54 -0
- package/lib/theme/Blog/Pages/BlogAuthorsListPage/styles.module.css +11 -0
- package/lib/theme/Blog/Pages/BlogAuthorsPostsPage/index.d.ts +8 -0
- package/lib/theme/Blog/Pages/BlogAuthorsPostsPage/index.js +67 -0
- package/lib/theme/BlogArchivePage/index.d.ts +0 -2
- package/lib/theme/BlogLayout/index.d.ts +0 -2
- package/lib/theme/BlogListPage/StructuredData/index.d.ts +0 -2
- package/lib/theme/BlogListPage/StructuredData/index.js +1 -1
- package/lib/theme/BlogListPage/index.d.ts +0 -2
- package/lib/theme/BlogListPaginator/index.d.ts +0 -2
- package/lib/theme/BlogPostItem/Container/index.d.ts +0 -2
- package/lib/theme/BlogPostItem/Content/index.d.ts +0 -2
- package/lib/theme/BlogPostItem/Content/index.js +1 -1
- package/lib/theme/BlogPostItem/Footer/ReadMoreLink/index.d.ts +0 -2
- package/lib/theme/BlogPostItem/Footer/index.d.ts +0 -1
- package/lib/theme/BlogPostItem/Footer/index.js +1 -1
- package/lib/theme/BlogPostItem/Header/Authors/index.d.ts +0 -2
- package/lib/theme/BlogPostItem/Header/Authors/index.js +5 -4
- package/lib/theme/BlogPostItem/Header/Authors/styles.module.css +0 -1
- package/lib/theme/BlogPostItem/Header/Info/index.d.ts +0 -2
- package/lib/theme/BlogPostItem/Header/Info/index.js +2 -4
- package/lib/theme/BlogPostItem/Header/Title/index.d.ts +0 -2
- package/lib/theme/BlogPostItem/Header/Title/index.js +1 -1
- package/lib/theme/BlogPostItem/Header/index.d.ts +0 -1
- package/lib/theme/BlogPostItem/index.d.ts +0 -2
- package/lib/theme/BlogPostItem/index.js +1 -1
- package/lib/theme/BlogPostItems/index.d.ts +0 -2
- package/lib/theme/BlogPostItems/index.js +1 -1
- package/lib/theme/BlogPostPage/Metadata/index.d.ts +0 -1
- package/lib/theme/BlogPostPage/Metadata/index.js +1 -1
- package/lib/theme/BlogPostPage/StructuredData/index.d.ts +0 -1
- package/lib/theme/BlogPostPage/StructuredData/index.js +1 -1
- package/lib/theme/BlogPostPage/index.d.ts +0 -2
- package/lib/theme/BlogPostPage/index.js +7 -4
- package/lib/theme/BlogPostPaginator/index.d.ts +0 -2
- package/lib/theme/BlogSidebar/Content/index.d.ts +11 -0
- package/lib/theme/BlogSidebar/Content/index.js +41 -0
- package/lib/theme/BlogSidebar/Desktop/index.d.ts +4 -3
- package/lib/theme/BlogSidebar/Desktop/index.js +24 -17
- package/lib/theme/BlogSidebar/Desktop/styles.module.css +5 -0
- package/lib/theme/BlogSidebar/Mobile/index.d.ts +4 -3
- package/lib/theme/BlogSidebar/Mobile/index.js +25 -17
- package/lib/theme/BlogSidebar/Mobile/styles.module.css +10 -0
- package/lib/theme/BlogSidebar/index.d.ts +0 -2
- package/lib/theme/BlogTagsListPage/index.d.ts +0 -2
- package/lib/theme/BlogTagsPostsPage/index.d.ts +0 -2
- package/lib/theme/BlogTagsPostsPage/index.js +3 -31
- package/lib/theme/CodeBlock/Content/Element.d.ts +0 -2
- package/lib/theme/CodeBlock/Content/String.d.ts +0 -2
- package/lib/theme/CodeBlock/CopyButton/index.d.ts +0 -2
- package/lib/theme/CodeBlock/Line/index.d.ts +0 -2
- package/lib/theme/CodeBlock/WordWrapButton/index.d.ts +0 -2
- package/lib/theme/CodeBlock/index.d.ts +0 -2
- package/lib/theme/CodeInline/index.d.ts +0 -2
- package/lib/theme/ColorModeToggle/index.d.ts +0 -1
- package/lib/theme/ContentVisibility/Draft/index.d.ts +8 -0
- package/lib/theme/ContentVisibility/Draft/index.js +24 -0
- package/lib/theme/{Unlisted → ContentVisibility/Unlisted}/index.d.ts +1 -3
- package/lib/theme/ContentVisibility/index.d.ts +8 -0
- package/lib/theme/ContentVisibility/index.js +21 -0
- package/lib/theme/Details/index.d.ts +0 -2
- package/lib/theme/DocBreadcrumbs/Items/Home/index.d.ts +0 -1
- package/lib/theme/DocBreadcrumbs/index.d.ts +0 -1
- package/lib/theme/DocBreadcrumbs/index.js +2 -4
- package/lib/theme/DocCard/index.d.ts +0 -2
- package/lib/theme/DocCard/index.js +2 -2
- package/lib/theme/DocCardList/index.d.ts +0 -2
- package/lib/theme/DocCardList/index.js +1 -1
- package/lib/theme/DocCategoryGeneratedIndexPage/index.d.ts +0 -2
- package/lib/theme/DocCategoryGeneratedIndexPage/index.js +2 -4
- package/lib/theme/DocItem/Content/index.d.ts +0 -2
- package/lib/theme/DocItem/Content/index.js +1 -1
- package/lib/theme/DocItem/Footer/index.d.ts +0 -1
- package/lib/theme/DocItem/Footer/index.js +1 -1
- package/lib/theme/DocItem/Layout/index.d.ts +0 -2
- package/lib/theme/DocItem/Layout/index.js +4 -6
- package/lib/theme/DocItem/Metadata/index.d.ts +0 -1
- package/lib/theme/DocItem/Metadata/index.js +1 -1
- package/lib/theme/DocItem/Paginator/index.d.ts +0 -1
- package/lib/theme/DocItem/Paginator/index.js +1 -1
- package/lib/theme/DocItem/TOC/Desktop/index.d.ts +0 -1
- package/lib/theme/DocItem/TOC/Desktop/index.js +1 -1
- package/lib/theme/DocItem/TOC/Mobile/index.d.ts +0 -1
- package/lib/theme/DocItem/TOC/Mobile/index.js +1 -1
- package/lib/theme/DocItem/index.d.ts +0 -2
- package/lib/theme/DocItem/index.js +1 -1
- package/lib/theme/DocPaginator/index.d.ts +0 -2
- package/lib/theme/DocRoot/Layout/Main/index.d.ts +0 -2
- package/lib/theme/DocRoot/Layout/Main/index.js +1 -1
- package/lib/theme/DocRoot/Layout/Sidebar/ExpandButton/index.d.ts +0 -2
- package/lib/theme/DocRoot/Layout/Sidebar/index.d.ts +0 -2
- package/lib/theme/DocRoot/Layout/Sidebar/index.js +1 -1
- package/lib/theme/DocRoot/Layout/index.d.ts +0 -2
- package/lib/theme/DocRoot/Layout/index.js +1 -1
- package/lib/theme/DocRoot/index.d.ts +0 -2
- package/lib/theme/DocRoot/index.js +1 -1
- package/lib/theme/DocSidebar/Desktop/CollapseButton/index.d.ts +0 -2
- package/lib/theme/DocSidebar/Desktop/Content/index.d.ts +0 -2
- package/lib/theme/DocSidebar/Desktop/index.d.ts +0 -1
- package/lib/theme/DocSidebar/Mobile/index.d.ts +0 -1
- package/lib/theme/DocSidebar/index.d.ts +0 -2
- package/lib/theme/DocSidebarItem/Category/index.d.ts +0 -2
- package/lib/theme/DocSidebarItem/Category/index.js +2 -2
- package/lib/theme/DocSidebarItem/Html/index.d.ts +0 -2
- package/lib/theme/DocSidebarItem/Link/index.d.ts +0 -2
- package/lib/theme/DocSidebarItem/Link/index.js +1 -1
- package/lib/theme/DocSidebarItem/index.d.ts +0 -2
- package/lib/theme/DocSidebarItems/index.d.ts +0 -1
- package/lib/theme/DocSidebarItems/index.js +1 -1
- package/lib/theme/DocTagDocListPage/index.d.ts +0 -2
- package/lib/theme/DocTagDocListPage/index.js +1 -1
- package/lib/theme/DocTagsListPage/index.d.ts +0 -2
- package/lib/theme/DocVersionBadge/index.d.ts +0 -2
- package/lib/theme/DocVersionBadge/index.js +1 -1
- package/lib/theme/DocVersionBanner/index.d.ts +0 -2
- package/lib/theme/DocVersionBanner/index.js +1 -1
- package/lib/theme/DocVersionRoot/index.d.ts +0 -2
- package/lib/theme/DocVersionRoot/index.js +3 -3
- package/lib/theme/DocsRoot/index.d.ts +0 -2
- package/lib/theme/EditMetaRow/index.d.ts +0 -2
- package/lib/theme/EditThisPage/index.d.ts +0 -2
- package/lib/theme/ErrorPageContent.d.ts +0 -2
- package/lib/theme/Footer/Copyright/index.d.ts +0 -2
- package/lib/theme/Footer/Layout/index.d.ts +0 -2
- package/lib/theme/Footer/LinkItem/index.d.ts +0 -2
- package/lib/theme/Footer/Links/MultiColumn/index.d.ts +0 -2
- package/lib/theme/Footer/Links/Simple/index.d.ts +0 -2
- package/lib/theme/Footer/Links/index.d.ts +0 -2
- package/lib/theme/Footer/Logo/index.d.ts +0 -2
- package/lib/theme/Heading/index.d.ts +0 -2
- package/lib/theme/Icon/Arrow/index.d.ts +0 -2
- package/lib/theme/Icon/Close/index.d.ts +0 -2
- package/lib/theme/Icon/Copy/index.d.ts +0 -2
- package/lib/theme/Icon/DarkMode/index.d.ts +0 -2
- package/lib/theme/Icon/Edit/index.d.ts +0 -2
- package/lib/theme/Icon/ExternalLink/index.d.ts +0 -2
- package/lib/theme/Icon/Home/index.d.ts +0 -2
- package/lib/theme/Icon/Language/index.d.ts +0 -2
- package/lib/theme/Icon/LightMode/index.d.ts +0 -2
- package/lib/theme/Icon/Menu/index.d.ts +0 -2
- package/lib/theme/Icon/Socials/Default/index.d.ts +9 -0
- package/lib/theme/Icon/Socials/Default/index.js +30 -0
- package/lib/theme/Icon/Socials/GitHub/index.d.ts +9 -0
- package/lib/theme/Icon/Socials/GitHub/index.js +25 -0
- package/lib/theme/Icon/Socials/GitHub/styles.module.css +14 -0
- package/lib/theme/Icon/Socials/LinkedIn/index.d.ts +9 -0
- package/lib/theme/Icon/Socials/LinkedIn/index.js +24 -0
- package/lib/theme/Icon/Socials/StackOverflow/index.d.ts +9 -0
- package/lib/theme/Icon/Socials/StackOverflow/index.js +27 -0
- package/lib/theme/Icon/Socials/Twitter/index.d.ts +9 -0
- package/lib/theme/Icon/Socials/Twitter/index.js +24 -0
- package/lib/theme/Icon/Socials/X/index.d.ts +9 -0
- package/lib/theme/Icon/Socials/X/index.js +25 -0
- package/lib/theme/Icon/Socials/X/styles.module.css +14 -0
- package/lib/theme/Icon/Success/index.d.ts +0 -2
- package/lib/theme/Icon/WordWrap/index.d.ts +0 -2
- package/lib/theme/LastUpdated/index.d.ts +0 -2
- package/lib/theme/Layout/Provider/index.d.ts +0 -2
- package/lib/theme/Layout/Provider/index.js +1 -1
- package/lib/theme/Layout/index.d.ts +0 -3
- package/lib/theme/Logo/index.d.ts +0 -2
- package/lib/theme/MDXComponents/A.d.ts +0 -2
- package/lib/theme/MDXComponents/Code.d.ts +0 -2
- package/lib/theme/MDXComponents/Details.d.ts +0 -2
- package/lib/theme/MDXComponents/Heading.d.ts +0 -2
- package/lib/theme/MDXComponents/Img/index.d.ts +0 -2
- package/lib/theme/MDXComponents/Li.d.ts +0 -1
- package/lib/theme/MDXComponents/Pre.d.ts +0 -1
- package/lib/theme/MDXComponents/Ul/index.d.ts +0 -2
- package/lib/theme/MDXComponents/index.d.ts +0 -1
- package/lib/theme/MDXContent/index.d.ts +0 -2
- package/lib/theme/MDXPage/index.d.ts +0 -2
- package/lib/theme/MDXPage/index.js +10 -13
- package/lib/theme/Mermaid.d.ts +0 -1
- package/lib/theme/Navbar/ColorModeToggle/index.d.ts +0 -2
- package/lib/theme/Navbar/Content/index.d.ts +0 -1
- package/lib/theme/Navbar/Layout/index.d.ts +0 -2
- package/lib/theme/Navbar/Logo/index.d.ts +0 -1
- package/lib/theme/Navbar/MobileSidebar/Header/index.d.ts +0 -1
- package/lib/theme/Navbar/MobileSidebar/Layout/index.d.ts +0 -2
- package/lib/theme/Navbar/MobileSidebar/PrimaryMenu/index.d.ts +0 -1
- package/lib/theme/Navbar/MobileSidebar/SecondaryMenu/index.d.ts +0 -1
- package/lib/theme/Navbar/MobileSidebar/Toggle/index.d.ts +0 -1
- package/lib/theme/Navbar/MobileSidebar/index.d.ts +0 -1
- package/lib/theme/Navbar/Search/index.d.ts +0 -2
- package/lib/theme/Navbar/index.d.ts +0 -1
- package/lib/theme/NavbarItem/ComponentTypes.d.ts +0 -1
- package/lib/theme/NavbarItem/DefaultNavbarItem.d.ts +0 -2
- package/lib/theme/NavbarItem/DocNavbarItem.d.ts +0 -2
- package/lib/theme/NavbarItem/DocNavbarItem.js +4 -2
- package/lib/theme/NavbarItem/DocSidebarNavbarItem.d.ts +0 -2
- package/lib/theme/NavbarItem/DocSidebarNavbarItem.js +4 -2
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.d.ts +0 -2
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +19 -14
- package/lib/theme/NavbarItem/DocsVersionNavbarItem.d.ts +0 -2
- package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DropdownNavbarItem/index.d.ts +0 -2
- package/lib/theme/NavbarItem/HtmlNavbarItem.d.ts +0 -2
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.d.ts +0 -2
- package/lib/theme/NavbarItem/NavbarNavLink.d.ts +0 -2
- package/lib/theme/NavbarItem/SearchNavbarItem.d.ts +0 -2
- package/lib/theme/NavbarItem/index.d.ts +0 -2
- package/lib/theme/NotFound/Content/index.d.ts +0 -2
- package/lib/theme/NotFound/index.d.ts +0 -1
- package/lib/theme/PaginatorNavLink/index.d.ts +0 -2
- package/lib/theme/SearchBar.d.ts +0 -1
- package/lib/theme/SearchMetadata/index.d.ts +0 -2
- package/lib/theme/SiteMetadata/index.d.ts +0 -1
- package/lib/theme/SkipToContent/index.d.ts +0 -1
- package/lib/theme/TOC/index.d.ts +0 -2
- package/lib/theme/TOCCollapsible/CollapseButton/index.d.ts +0 -2
- package/lib/theme/TOCCollapsible/index.d.ts +0 -2
- package/lib/theme/TOCInline/index.d.ts +0 -2
- package/lib/theme/TOCItems/Tree.d.ts +0 -1
- package/lib/theme/TOCItems/index.d.ts +0 -2
- package/lib/theme/TabItem/index.d.ts +0 -2
- package/lib/theme/Tabs/index.d.ts +0 -2
- package/lib/theme/Tabs/index.js +3 -1
- package/lib/theme/Tag/index.d.ts +0 -2
- package/lib/theme/TagsListByLetter/index.d.ts +0 -2
- package/lib/theme/TagsListInline/index.d.ts +0 -2
- package/lib/theme/ThemedImage/index.d.ts +0 -2
- package/lib/translations.js +2 -3
- package/package.json +15 -15
- package/src/getSwizzleConfig.ts +32 -0
- package/src/options.ts +18 -2
- package/src/theme/Blog/Components/Author/Socials/index.tsx +66 -0
- package/src/theme/Blog/Components/Author/Socials/styles.module.css +39 -0
- package/src/theme/Blog/Components/Author/index.tsx +99 -0
- package/src/theme/Blog/Components/Author/styles.module.css +74 -0
- package/src/theme/Blog/Pages/BlogAuthorsListPage/index.tsx +62 -0
- package/src/theme/Blog/Pages/BlogAuthorsListPage/styles.module.css +11 -0
- package/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.tsx +73 -0
- package/src/theme/BlogListPage/StructuredData/index.tsx +1 -1
- package/src/theme/BlogPostItem/Content/index.tsx +1 -1
- package/src/theme/BlogPostItem/Footer/index.tsx +1 -1
- package/src/theme/BlogPostItem/Header/Authors/index.tsx +5 -4
- package/src/theme/BlogPostItem/Header/Authors/styles.module.css +0 -1
- package/src/theme/BlogPostItem/Header/Info/index.tsx +2 -4
- package/src/theme/BlogPostItem/Header/Title/index.tsx +1 -1
- package/src/theme/BlogPostItem/index.tsx +1 -1
- package/src/theme/BlogPostItems/index.tsx +1 -1
- package/src/theme/BlogPostPage/Metadata/index.tsx +1 -1
- package/src/theme/BlogPostPage/StructuredData/index.tsx +1 -1
- package/src/theme/BlogPostPage/index.tsx +7 -4
- package/src/theme/BlogSidebar/Content/index.tsx +57 -0
- package/src/theme/BlogSidebar/Desktop/index.tsx +27 -17
- package/src/theme/BlogSidebar/Desktop/styles.module.css +5 -0
- package/src/theme/BlogSidebar/Mobile/index.tsx +29 -17
- package/src/theme/BlogSidebar/Mobile/styles.module.css +10 -0
- package/src/theme/BlogTagsPostsPage/index.tsx +3 -33
- package/src/theme/ContentVisibility/Draft/index.tsx +27 -0
- package/src/theme/{Unlisted → ContentVisibility/Unlisted}/index.tsx +1 -1
- package/src/theme/ContentVisibility/index.tsx +27 -0
- package/src/theme/DocBreadcrumbs/index.tsx +2 -4
- package/src/theme/DocCard/index.tsx +2 -2
- package/src/theme/DocCardList/index.tsx +1 -1
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +2 -4
- package/src/theme/DocItem/Content/index.tsx +1 -1
- package/src/theme/DocItem/Footer/index.tsx +1 -1
- package/src/theme/DocItem/Layout/index.tsx +4 -6
- package/src/theme/DocItem/Metadata/index.tsx +1 -1
- package/src/theme/DocItem/Paginator/index.tsx +1 -1
- package/src/theme/DocItem/TOC/Desktop/index.tsx +1 -1
- package/src/theme/DocItem/TOC/Mobile/index.tsx +1 -1
- package/src/theme/DocItem/index.tsx +1 -1
- package/src/theme/DocRoot/Layout/Main/index.tsx +1 -1
- package/src/theme/DocRoot/Layout/Sidebar/index.tsx +1 -1
- package/src/theme/DocRoot/Layout/index.tsx +1 -1
- package/src/theme/DocRoot/index.tsx +1 -1
- package/src/theme/DocSidebarItem/Category/index.tsx +2 -2
- package/src/theme/DocSidebarItem/Link/index.tsx +1 -1
- package/src/theme/DocSidebarItems/index.tsx +1 -1
- package/src/theme/DocTagDocListPage/index.tsx +1 -1
- package/src/theme/DocVersionBadge/index.tsx +1 -1
- package/src/theme/DocVersionBanner/index.tsx +1 -1
- package/src/theme/DocVersionRoot/index.tsx +3 -3
- package/src/theme/Icon/Socials/Default/index.tsx +33 -0
- package/src/theme/Icon/Socials/GitHub/index.tsx +29 -0
- package/src/theme/Icon/Socials/GitHub/styles.module.css +14 -0
- package/src/theme/Icon/Socials/LinkedIn/index.tsx +27 -0
- package/src/theme/Icon/Socials/StackOverflow/index.tsx +30 -0
- package/src/theme/Icon/Socials/Twitter/index.tsx +27 -0
- package/src/theme/Icon/Socials/X/index.tsx +29 -0
- package/src/theme/Icon/Socials/X/styles.module.css +14 -0
- package/src/theme/Layout/Provider/index.tsx +1 -1
- package/src/theme/MDXPage/index.tsx +10 -13
- package/src/theme/NavbarItem/DocNavbarItem.tsx +4 -2
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +4 -2
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +32 -16
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +1 -1
- package/src/theme/Tabs/index.tsx +3 -1
- package/src/theme-classic.d.ts +106 -12
- package/lib/theme/BlogPostItem/Header/Author/index.d.ts +0 -10
- package/lib/theme/BlogPostItem/Header/Author/index.js +0 -39
- package/src/theme/BlogPostItem/Header/Author/index.tsx +0 -47
- /package/lib/theme/{Unlisted → ContentVisibility/Unlisted}/index.js +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
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, {type ReactNode} from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
import {
|
|
10
|
+
PageMetadata,
|
|
11
|
+
HtmlClassNameProvider,
|
|
12
|
+
ThemeClassNames,
|
|
13
|
+
} from '@docusaurus/theme-common';
|
|
14
|
+
import {translateBlogAuthorsListPageTitle} from '@docusaurus/theme-common/internal';
|
|
15
|
+
import BlogLayout from '@theme/BlogLayout';
|
|
16
|
+
import type {Props} from '@theme/Blog/Pages/BlogAuthorsListPage';
|
|
17
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
18
|
+
import Heading from '@theme/Heading';
|
|
19
|
+
import Author from '@theme/Blog/Components/Author';
|
|
20
|
+
import type {AuthorItemProp} from '@docusaurus/plugin-content-blog';
|
|
21
|
+
import styles from './styles.module.css';
|
|
22
|
+
|
|
23
|
+
function AuthorListItem({author}: {author: AuthorItemProp}) {
|
|
24
|
+
return (
|
|
25
|
+
<li className={styles.authorListItem}>
|
|
26
|
+
<Author as="h2" author={author} count={author.count} />
|
|
27
|
+
</li>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function AuthorsList({authors}: {authors: Props['authors']}) {
|
|
32
|
+
return (
|
|
33
|
+
<section className={clsx('margin-vert--lg', styles.authorsListSection)}>
|
|
34
|
+
<ul>
|
|
35
|
+
{authors.map((author) => (
|
|
36
|
+
<AuthorListItem key={author.key} author={author} />
|
|
37
|
+
))}
|
|
38
|
+
</ul>
|
|
39
|
+
</section>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default function BlogAuthorsListPage({
|
|
44
|
+
authors,
|
|
45
|
+
sidebar,
|
|
46
|
+
}: Props): ReactNode {
|
|
47
|
+
const title: string = translateBlogAuthorsListPageTitle();
|
|
48
|
+
return (
|
|
49
|
+
<HtmlClassNameProvider
|
|
50
|
+
className={clsx(
|
|
51
|
+
ThemeClassNames.wrapper.blogPages,
|
|
52
|
+
ThemeClassNames.page.blogAuthorsListPage,
|
|
53
|
+
)}>
|
|
54
|
+
<PageMetadata title={title} />
|
|
55
|
+
<SearchMetadata tag="blog_authors_list" />
|
|
56
|
+
<BlogLayout sidebar={sidebar}>
|
|
57
|
+
<Heading as="h1">{title}</Heading>
|
|
58
|
+
<AuthorsList authors={authors} />
|
|
59
|
+
</BlogLayout>
|
|
60
|
+
</HtmlClassNameProvider>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
.authorListItem {
|
|
9
|
+
list-style-type: none;
|
|
10
|
+
margin-bottom: 2rem;
|
|
11
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 {
|
|
11
|
+
PageMetadata,
|
|
12
|
+
HtmlClassNameProvider,
|
|
13
|
+
ThemeClassNames,
|
|
14
|
+
} from '@docusaurus/theme-common';
|
|
15
|
+
import {
|
|
16
|
+
useBlogAuthorPageTitle,
|
|
17
|
+
BlogAuthorsListViewAllLabel,
|
|
18
|
+
} from '@docusaurus/theme-common/internal';
|
|
19
|
+
import Link from '@docusaurus/Link';
|
|
20
|
+
import {useBlogMetadata} from '@docusaurus/plugin-content-blog/client';
|
|
21
|
+
import BlogLayout from '@theme/BlogLayout';
|
|
22
|
+
import BlogListPaginator from '@theme/BlogListPaginator';
|
|
23
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
24
|
+
import type {Props} from '@theme/Blog/Pages/BlogAuthorsPostsPage';
|
|
25
|
+
import BlogPostItems from '@theme/BlogPostItems';
|
|
26
|
+
import Author from '@theme/Blog/Components/Author';
|
|
27
|
+
|
|
28
|
+
function Metadata({author}: Props): JSX.Element {
|
|
29
|
+
const title = useBlogAuthorPageTitle(author);
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<PageMetadata title={title} />
|
|
33
|
+
<SearchMetadata tag="blog_authors_posts" />
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function ViewAllAuthorsLink() {
|
|
39
|
+
const {authorsListPath} = useBlogMetadata();
|
|
40
|
+
return (
|
|
41
|
+
<Link href={authorsListPath}>
|
|
42
|
+
<BlogAuthorsListViewAllLabel />
|
|
43
|
+
</Link>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function Content({author, items, sidebar, listMetadata}: Props): JSX.Element {
|
|
48
|
+
return (
|
|
49
|
+
<BlogLayout sidebar={sidebar}>
|
|
50
|
+
<header className="margin-bottom--xl">
|
|
51
|
+
<Author as="h1" author={author} />
|
|
52
|
+
{author.description && <p>{author.description}</p>}
|
|
53
|
+
<ViewAllAuthorsLink />
|
|
54
|
+
</header>
|
|
55
|
+
<hr />
|
|
56
|
+
<BlogPostItems items={items} />
|
|
57
|
+
<BlogListPaginator metadata={listMetadata} />
|
|
58
|
+
</BlogLayout>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default function BlogAuthorsPostsPage(props: Props): JSX.Element {
|
|
63
|
+
return (
|
|
64
|
+
<HtmlClassNameProvider
|
|
65
|
+
className={clsx(
|
|
66
|
+
ThemeClassNames.wrapper.blogPages,
|
|
67
|
+
ThemeClassNames.page.blogAuthorsPostsPage,
|
|
68
|
+
)}>
|
|
69
|
+
<Metadata {...props} />
|
|
70
|
+
<Content {...props} />
|
|
71
|
+
</HtmlClassNameProvider>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import Head from '@docusaurus/Head';
|
|
10
|
-
import {useBlogListPageStructuredData} from '@docusaurus/
|
|
10
|
+
import {useBlogListPageStructuredData} from '@docusaurus/plugin-content-blog/client';
|
|
11
11
|
import type {Props} from '@theme/BlogListPage/StructuredData';
|
|
12
12
|
|
|
13
13
|
export default function BlogListPageStructuredData(props: Props): JSX.Element {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import {blogPostContainerID} from '@docusaurus/utils-common';
|
|
11
|
-
import {useBlogPost} from '@docusaurus/
|
|
11
|
+
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
|
12
12
|
import MDXContent from '@theme/MDXContent';
|
|
13
13
|
import type {Props} from '@theme/BlogPostItem/Content';
|
|
14
14
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {useBlogPost} from '@docusaurus/
|
|
10
|
+
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
|
11
11
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
12
12
|
import EditMetaRow from '@theme/EditMetaRow';
|
|
13
13
|
import TagsListInline from '@theme/TagsListInline';
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {useBlogPost} from '@docusaurus/
|
|
11
|
-
import
|
|
10
|
+
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
|
11
|
+
import BlogAuthor from '@theme/Blog/Components/Author';
|
|
12
12
|
import type {Props} from '@theme/BlogPostItem/Header/Authors';
|
|
13
13
|
import styles from './styles.module.css';
|
|
14
14
|
|
|
@@ -25,6 +25,7 @@ export default function BlogPostItemHeaderAuthors({
|
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
27
|
const imageOnly = authors.every(({name}) => !name);
|
|
28
|
+
const singleAuthor = authors.length === 1;
|
|
28
29
|
return (
|
|
29
30
|
<div
|
|
30
31
|
className={clsx(
|
|
@@ -35,11 +36,11 @@ export default function BlogPostItemHeaderAuthors({
|
|
|
35
36
|
{authors.map((author, idx) => (
|
|
36
37
|
<div
|
|
37
38
|
className={clsx(
|
|
38
|
-
!imageOnly && 'col col--6',
|
|
39
|
+
!imageOnly && (singleAuthor ? 'col col--12' : 'col col--6'),
|
|
39
40
|
imageOnly ? styles.imageOnlyAuthorCol : styles.authorCol,
|
|
40
41
|
)}
|
|
41
42
|
key={idx}>
|
|
42
|
-
<
|
|
43
|
+
<BlogAuthor
|
|
43
44
|
author={{
|
|
44
45
|
...author,
|
|
45
46
|
// Handle author images using relative paths
|
|
@@ -9,10 +9,8 @@ import React from 'react';
|
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import {translate} from '@docusaurus/Translate';
|
|
11
11
|
import {usePluralForm} from '@docusaurus/theme-common';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
useDateTimeFormat,
|
|
15
|
-
} from '@docusaurus/theme-common/internal';
|
|
12
|
+
import {useDateTimeFormat} from '@docusaurus/theme-common/internal';
|
|
13
|
+
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
|
16
14
|
import type {Props} from '@theme/BlogPostItem/Header/Info';
|
|
17
15
|
|
|
18
16
|
import styles from './styles.module.css';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import Link from '@docusaurus/Link';
|
|
11
|
-
import {useBlogPost} from '@docusaurus/
|
|
11
|
+
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
|
12
12
|
import type {Props} from '@theme/BlogPostItem/Header/Title';
|
|
13
13
|
|
|
14
14
|
import styles from './styles.module.css';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {useBlogPost} from '@docusaurus/
|
|
10
|
+
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
|
11
11
|
import BlogPostItemContainer from '@theme/BlogPostItem/Container';
|
|
12
12
|
import BlogPostItemHeader from '@theme/BlogPostItem/Header';
|
|
13
13
|
import BlogPostItemContent from '@theme/BlogPostItem/Content';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {BlogPostProvider} from '@docusaurus/
|
|
9
|
+
import {BlogPostProvider} from '@docusaurus/plugin-content-blog/client';
|
|
10
10
|
import BlogPostItem from '@theme/BlogPostItem';
|
|
11
11
|
import type {Props} from '@theme/BlogPostItems';
|
|
12
12
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import {PageMetadata} from '@docusaurus/theme-common';
|
|
10
|
-
import {useBlogPost} from '@docusaurus/
|
|
10
|
+
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
|
11
11
|
|
|
12
12
|
export default function BlogPostPageMetadata(): JSX.Element {
|
|
13
13
|
const {assets, metadata} = useBlogPost();
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import Head from '@docusaurus/Head';
|
|
10
|
-
import {useBlogPostStructuredData} from '@docusaurus/
|
|
10
|
+
import {useBlogPostStructuredData} from '@docusaurus/plugin-content-blog/client';
|
|
11
11
|
|
|
12
12
|
export default function BlogPostStructuredData(): JSX.Element {
|
|
13
13
|
const structuredData = useBlogPostStructuredData();
|
|
@@ -8,15 +8,18 @@
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import {HtmlClassNameProvider, ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
BlogPostProvider,
|
|
13
|
+
useBlogPost,
|
|
14
|
+
} from '@docusaurus/plugin-content-blog/client';
|
|
12
15
|
import BlogLayout from '@theme/BlogLayout';
|
|
13
16
|
import BlogPostItem from '@theme/BlogPostItem';
|
|
14
17
|
import BlogPostPaginator from '@theme/BlogPostPaginator';
|
|
15
18
|
import BlogPostPageMetadata from '@theme/BlogPostPage/Metadata';
|
|
16
19
|
import BlogPostPageStructuredData from '@theme/BlogPostPage/StructuredData';
|
|
17
20
|
import TOC from '@theme/TOC';
|
|
21
|
+
import ContentVisibility from '@theme/ContentVisibility';
|
|
18
22
|
import type {Props} from '@theme/BlogPostPage';
|
|
19
|
-
import Unlisted from '@theme/Unlisted';
|
|
20
23
|
import type {BlogSidebar} from '@docusaurus/plugin-content-blog';
|
|
21
24
|
|
|
22
25
|
function BlogPostPageContent({
|
|
@@ -27,7 +30,7 @@ function BlogPostPageContent({
|
|
|
27
30
|
children: ReactNode;
|
|
28
31
|
}): JSX.Element {
|
|
29
32
|
const {metadata, toc} = useBlogPost();
|
|
30
|
-
const {nextItem, prevItem, frontMatter
|
|
33
|
+
const {nextItem, prevItem, frontMatter} = metadata;
|
|
31
34
|
const {
|
|
32
35
|
hide_table_of_contents: hideTableOfContents,
|
|
33
36
|
toc_min_heading_level: tocMinHeadingLevel,
|
|
@@ -45,7 +48,7 @@ function BlogPostPageContent({
|
|
|
45
48
|
/>
|
|
46
49
|
) : undefined
|
|
47
50
|
}>
|
|
48
|
-
{
|
|
51
|
+
<ContentVisibility metadata={metadata} />
|
|
49
52
|
|
|
50
53
|
<BlogPostItem>{children}</BlogPostItem>
|
|
51
54
|
|
|
@@ -0,0 +1,57 @@
|
|
|
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, {memo, type ReactNode} from 'react';
|
|
8
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
9
|
+
import {groupBlogSidebarItemsByYear} from '@docusaurus/plugin-content-blog/client';
|
|
10
|
+
import Heading from '@theme/Heading';
|
|
11
|
+
import type {Props} from '@theme/BlogSidebar/Content';
|
|
12
|
+
|
|
13
|
+
function BlogSidebarYearGroup({
|
|
14
|
+
year,
|
|
15
|
+
yearGroupHeadingClassName,
|
|
16
|
+
children,
|
|
17
|
+
}: {
|
|
18
|
+
year: string;
|
|
19
|
+
yearGroupHeadingClassName?: string;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}) {
|
|
22
|
+
return (
|
|
23
|
+
<div role="group">
|
|
24
|
+
<Heading as="h3" className={yearGroupHeadingClassName}>
|
|
25
|
+
{year}
|
|
26
|
+
</Heading>
|
|
27
|
+
{children}
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function BlogSidebarContent({
|
|
33
|
+
items,
|
|
34
|
+
yearGroupHeadingClassName,
|
|
35
|
+
ListComponent,
|
|
36
|
+
}: Props): ReactNode {
|
|
37
|
+
const themeConfig = useThemeConfig();
|
|
38
|
+
if (themeConfig.blog.sidebar.groupByYear) {
|
|
39
|
+
const itemsByYear = groupBlogSidebarItemsByYear(items);
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
{itemsByYear.map(([year, yearItems]) => (
|
|
43
|
+
<BlogSidebarYearGroup
|
|
44
|
+
key={year}
|
|
45
|
+
year={year}
|
|
46
|
+
yearGroupHeadingClassName={yearGroupHeadingClassName}>
|
|
47
|
+
<ListComponent items={yearItems} />
|
|
48
|
+
</BlogSidebarYearGroup>
|
|
49
|
+
))}
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
} else {
|
|
53
|
+
return <ListComponent items={items} />;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default memo(BlogSidebarContent);
|
|
@@ -5,16 +5,32 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React from 'react';
|
|
8
|
+
import React, {memo} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import Link from '@docusaurus/Link';
|
|
11
10
|
import {translate} from '@docusaurus/Translate';
|
|
12
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
useVisibleBlogSidebarItems,
|
|
13
|
+
BlogSidebarItemList,
|
|
14
|
+
} from '@docusaurus/plugin-content-blog/client';
|
|
15
|
+
import BlogSidebarContent from '@theme/BlogSidebar/Content';
|
|
16
|
+
import type {Props as BlogSidebarContentProps} from '@theme/BlogSidebar/Content';
|
|
13
17
|
import type {Props} from '@theme/BlogSidebar/Desktop';
|
|
14
18
|
|
|
15
19
|
import styles from './styles.module.css';
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
const ListComponent: BlogSidebarContentProps['ListComponent'] = ({items}) => {
|
|
22
|
+
return (
|
|
23
|
+
<BlogSidebarItemList
|
|
24
|
+
items={items}
|
|
25
|
+
ulClassName={clsx(styles.sidebarItemList, 'clean-list')}
|
|
26
|
+
liClassName={styles.sidebarItem}
|
|
27
|
+
linkClassName={styles.sidebarItemLink}
|
|
28
|
+
linkActiveClassName={styles.sidebarItemLinkActive}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
function BlogSidebarDesktop({sidebar}: Props) {
|
|
18
34
|
const items = useVisibleBlogSidebarItems(sidebar.items);
|
|
19
35
|
return (
|
|
20
36
|
<aside className="col col--3">
|
|
@@ -28,20 +44,14 @@ export default function BlogSidebarDesktop({sidebar}: Props): JSX.Element {
|
|
|
28
44
|
<div className={clsx(styles.sidebarItemTitle, 'margin-bottom--md')}>
|
|
29
45
|
{sidebar.title}
|
|
30
46
|
</div>
|
|
31
|
-
<
|
|
32
|
-
{items
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
to={item.permalink}
|
|
37
|
-
className={styles.sidebarItemLink}
|
|
38
|
-
activeClassName={styles.sidebarItemLinkActive}>
|
|
39
|
-
{item.title}
|
|
40
|
-
</Link>
|
|
41
|
-
</li>
|
|
42
|
-
))}
|
|
43
|
-
</ul>
|
|
47
|
+
<BlogSidebarContent
|
|
48
|
+
items={items}
|
|
49
|
+
ListComponent={ListComponent}
|
|
50
|
+
yearGroupHeadingClassName={styles.yearGroupHeading}
|
|
51
|
+
/>
|
|
44
52
|
</nav>
|
|
45
53
|
</aside>
|
|
46
54
|
);
|
|
47
55
|
}
|
|
56
|
+
|
|
57
|
+
export default memo(BlogSidebarDesktop);
|
|
@@ -5,32 +5,42 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import
|
|
10
|
-
|
|
8
|
+
import React, {memo} from 'react';
|
|
9
|
+
import {
|
|
10
|
+
useVisibleBlogSidebarItems,
|
|
11
|
+
BlogSidebarItemList,
|
|
12
|
+
} from '@docusaurus/plugin-content-blog/client';
|
|
11
13
|
import {NavbarSecondaryMenuFiller} from '@docusaurus/theme-common';
|
|
14
|
+
import BlogSidebarContent from '@theme/BlogSidebar/Content';
|
|
12
15
|
import type {Props} from '@theme/BlogSidebar/Mobile';
|
|
16
|
+
import type {Props as BlogSidebarContentProps} from '@theme/BlogSidebar/Content';
|
|
17
|
+
|
|
18
|
+
import styles from './styles.module.css';
|
|
19
|
+
|
|
20
|
+
const ListComponent: BlogSidebarContentProps['ListComponent'] = ({items}) => {
|
|
21
|
+
return (
|
|
22
|
+
<BlogSidebarItemList
|
|
23
|
+
items={items}
|
|
24
|
+
ulClassName="menu__list"
|
|
25
|
+
liClassName="menu__list-item"
|
|
26
|
+
linkClassName="menu__link"
|
|
27
|
+
linkActiveClassName="menu__link--active"
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
13
31
|
|
|
14
32
|
function BlogSidebarMobileSecondaryMenu({sidebar}: Props): JSX.Element {
|
|
15
33
|
const items = useVisibleBlogSidebarItems(sidebar.items);
|
|
16
34
|
return (
|
|
17
|
-
<
|
|
18
|
-
{items
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
to={item.permalink}
|
|
23
|
-
className="menu__link"
|
|
24
|
-
activeClassName="menu__link--active">
|
|
25
|
-
{item.title}
|
|
26
|
-
</Link>
|
|
27
|
-
</li>
|
|
28
|
-
))}
|
|
29
|
-
</ul>
|
|
35
|
+
<BlogSidebarContent
|
|
36
|
+
items={items}
|
|
37
|
+
ListComponent={ListComponent}
|
|
38
|
+
yearGroupHeadingClassName={styles.yearGroupHeading}
|
|
39
|
+
/>
|
|
30
40
|
);
|
|
31
41
|
}
|
|
32
42
|
|
|
33
|
-
|
|
43
|
+
function BlogSidebarMobile(props: Props): JSX.Element {
|
|
34
44
|
return (
|
|
35
45
|
<NavbarSecondaryMenuFiller
|
|
36
46
|
component={BlogSidebarMobileSecondaryMenu}
|
|
@@ -38,3 +48,5 @@ export default function BlogSidebarMobile(props: Props): JSX.Element {
|
|
|
38
48
|
/>
|
|
39
49
|
);
|
|
40
50
|
}
|
|
51
|
+
|
|
52
|
+
export default memo(BlogSidebarMobile);
|
|
@@ -7,52 +7,22 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import Translate
|
|
10
|
+
import Translate from '@docusaurus/Translate';
|
|
11
11
|
import {
|
|
12
12
|
PageMetadata,
|
|
13
13
|
HtmlClassNameProvider,
|
|
14
14
|
ThemeClassNames,
|
|
15
|
-
usePluralForm,
|
|
16
15
|
} from '@docusaurus/theme-common';
|
|
16
|
+
import {useBlogTagsPostsPageTitle} from '@docusaurus/theme-common/internal';
|
|
17
17
|
import Link from '@docusaurus/Link';
|
|
18
18
|
import BlogLayout from '@theme/BlogLayout';
|
|
19
19
|
import BlogListPaginator from '@theme/BlogListPaginator';
|
|
20
20
|
import SearchMetadata from '@theme/SearchMetadata';
|
|
21
21
|
import type {Props} from '@theme/BlogTagsPostsPage';
|
|
22
22
|
import BlogPostItems from '@theme/BlogPostItems';
|
|
23
|
-
import Unlisted from '@theme/Unlisted';
|
|
23
|
+
import Unlisted from '@theme/ContentVisibility/Unlisted';
|
|
24
24
|
import Heading from '@theme/Heading';
|
|
25
25
|
|
|
26
|
-
// Very simple pluralization: probably good enough for now
|
|
27
|
-
function useBlogPostsPlural() {
|
|
28
|
-
const {selectMessage} = usePluralForm();
|
|
29
|
-
return (count: number) =>
|
|
30
|
-
selectMessage(
|
|
31
|
-
count,
|
|
32
|
-
translate(
|
|
33
|
-
{
|
|
34
|
-
id: 'theme.blog.post.plurals',
|
|
35
|
-
description:
|
|
36
|
-
'Pluralized label for "{count} posts". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',
|
|
37
|
-
message: 'One post|{count} posts',
|
|
38
|
-
},
|
|
39
|
-
{count},
|
|
40
|
-
),
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function useBlogTagsPostsPageTitle(tag: Props['tag']): string {
|
|
45
|
-
const blogPostsPlural = useBlogPostsPlural();
|
|
46
|
-
return translate(
|
|
47
|
-
{
|
|
48
|
-
id: 'theme.blog.tagTitle',
|
|
49
|
-
description: 'The title of the page for a blog tag',
|
|
50
|
-
message: '{nPosts} tagged with "{tagName}"',
|
|
51
|
-
},
|
|
52
|
-
{nPosts: blogPostsPlural(tag.count), tagName: tag.label},
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
26
|
function BlogTagsPostsPageMetadata({tag}: Props): JSX.Element {
|
|
57
27
|
const title = useBlogTagsPostsPageTitle(tag);
|
|
58
28
|
return (
|
|
@@ -0,0 +1,27 @@
|
|
|
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 {
|
|
11
|
+
ThemeClassNames,
|
|
12
|
+
DraftBannerTitle,
|
|
13
|
+
DraftBannerMessage,
|
|
14
|
+
} from '@docusaurus/theme-common';
|
|
15
|
+
import Admonition from '@theme/Admonition';
|
|
16
|
+
import type {Props} from '@theme/ContentVisibility/Draft';
|
|
17
|
+
|
|
18
|
+
export default function Draft({className}: Props): JSX.Element | null {
|
|
19
|
+
return (
|
|
20
|
+
<Admonition
|
|
21
|
+
type="caution"
|
|
22
|
+
title={<DraftBannerTitle />}
|
|
23
|
+
className={clsx(className, ThemeClassNames.common.draftBanner)}>
|
|
24
|
+
<DraftBannerMessage />
|
|
25
|
+
</Admonition>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
UnlistedMetadata,
|
|
15
15
|
} from '@docusaurus/theme-common';
|
|
16
16
|
import Admonition from '@theme/Admonition';
|
|
17
|
-
import type {Props} from '@theme/Unlisted';
|
|
17
|
+
import type {Props} from '@theme/ContentVisibility/Unlisted';
|
|
18
18
|
|
|
19
19
|
function UnlistedBanner({className}: Props) {
|
|
20
20
|
return (
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
|
|
10
|
+
import type {Props} from '@theme/ContentVisibility';
|
|
11
|
+
import Draft from '@theme/ContentVisibility/Draft';
|
|
12
|
+
import Unlisted from '@theme/ContentVisibility/Unlisted';
|
|
13
|
+
|
|
14
|
+
export default function ContentVisibility({
|
|
15
|
+
metadata,
|
|
16
|
+
}: Props): JSX.Element | null {
|
|
17
|
+
const {unlisted, frontMatter} = metadata;
|
|
18
|
+
// Reading draft/unlisted status from frontMatter is useful to display
|
|
19
|
+
// the banners in dev mode (in dev, metadata.unlisted is always false)
|
|
20
|
+
// See https://github.com/facebook/docusaurus/issues/8285
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
{(unlisted || frontMatter.unlisted) && <Unlisted />}
|
|
24
|
+
{frontMatter.draft && <Draft />}
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
}
|