@docusaurus/theme-classic 3.3.2 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/lib/getSwizzleConfig.js +32 -1
  2. package/lib/index.d.ts +0 -2
  3. package/lib/index.js +7 -88
  4. package/lib/inlineScripts.d.ts +16 -0
  5. package/lib/inlineScripts.js +98 -0
  6. package/lib/options.d.ts +0 -1
  7. package/lib/options.js +15 -3
  8. package/lib/theme/Admonition/Icon/Danger.d.ts +0 -2
  9. package/lib/theme/Admonition/Icon/Info.d.ts +0 -2
  10. package/lib/theme/Admonition/Icon/Note.d.ts +0 -2
  11. package/lib/theme/Admonition/Icon/Tip.d.ts +0 -2
  12. package/lib/theme/Admonition/Icon/Warning.d.ts +0 -2
  13. package/lib/theme/Admonition/Layout/index.d.ts +0 -2
  14. package/lib/theme/Admonition/Type/Caution.d.ts +0 -2
  15. package/lib/theme/Admonition/Type/Danger.d.ts +0 -2
  16. package/lib/theme/Admonition/Type/Info.d.ts +0 -2
  17. package/lib/theme/Admonition/Type/Note.d.ts +0 -2
  18. package/lib/theme/Admonition/Type/Tip.d.ts +0 -2
  19. package/lib/theme/Admonition/Type/Warning.d.ts +0 -2
  20. package/lib/theme/Admonition/Types.d.ts +0 -1
  21. package/lib/theme/Admonition/index.d.ts +0 -2
  22. package/lib/theme/AnnouncementBar/CloseButton/index.d.ts +0 -2
  23. package/lib/theme/AnnouncementBar/Content/index.d.ts +0 -2
  24. package/lib/theme/AnnouncementBar/index.d.ts +0 -1
  25. package/lib/theme/BackToTopButton/index.d.ts +0 -1
  26. package/lib/theme/Blog/Components/Author/Socials/index.d.ts +10 -0
  27. package/lib/theme/Blog/Components/Author/Socials/index.js +49 -0
  28. package/lib/theme/Blog/Components/Author/Socials/styles.module.css +39 -0
  29. package/lib/theme/Blog/Components/Author/index.d.ts +8 -0
  30. package/lib/theme/Blog/Components/Author/index.js +86 -0
  31. package/lib/theme/Blog/Components/Author/styles.module.css +74 -0
  32. package/lib/theme/Blog/Pages/BlogAuthorsListPage/index.d.ts +9 -0
  33. package/lib/theme/Blog/Pages/BlogAuthorsListPage/index.js +54 -0
  34. package/lib/theme/Blog/Pages/BlogAuthorsListPage/styles.module.css +11 -0
  35. package/lib/theme/Blog/Pages/BlogAuthorsPostsPage/index.d.ts +8 -0
  36. package/lib/theme/Blog/Pages/BlogAuthorsPostsPage/index.js +67 -0
  37. package/lib/theme/BlogArchivePage/index.d.ts +0 -2
  38. package/lib/theme/BlogLayout/index.d.ts +0 -2
  39. package/lib/theme/BlogListPage/StructuredData/index.d.ts +0 -2
  40. package/lib/theme/BlogListPage/StructuredData/index.js +1 -1
  41. package/lib/theme/BlogListPage/index.d.ts +0 -2
  42. package/lib/theme/BlogListPaginator/index.d.ts +0 -2
  43. package/lib/theme/BlogPostItem/Container/index.d.ts +0 -2
  44. package/lib/theme/BlogPostItem/Content/index.d.ts +0 -2
  45. package/lib/theme/BlogPostItem/Content/index.js +1 -1
  46. package/lib/theme/BlogPostItem/Footer/ReadMoreLink/index.d.ts +0 -2
  47. package/lib/theme/BlogPostItem/Footer/index.d.ts +0 -1
  48. package/lib/theme/BlogPostItem/Footer/index.js +1 -1
  49. package/lib/theme/BlogPostItem/Header/Authors/index.d.ts +0 -2
  50. package/lib/theme/BlogPostItem/Header/Authors/index.js +5 -4
  51. package/lib/theme/BlogPostItem/Header/Authors/styles.module.css +0 -1
  52. package/lib/theme/BlogPostItem/Header/Info/index.d.ts +0 -2
  53. package/lib/theme/BlogPostItem/Header/Info/index.js +2 -4
  54. package/lib/theme/BlogPostItem/Header/Title/index.d.ts +0 -2
  55. package/lib/theme/BlogPostItem/Header/Title/index.js +1 -1
  56. package/lib/theme/BlogPostItem/Header/index.d.ts +0 -1
  57. package/lib/theme/BlogPostItem/index.d.ts +0 -2
  58. package/lib/theme/BlogPostItem/index.js +1 -1
  59. package/lib/theme/BlogPostItems/index.d.ts +0 -2
  60. package/lib/theme/BlogPostItems/index.js +1 -1
  61. package/lib/theme/BlogPostPage/Metadata/index.d.ts +0 -1
  62. package/lib/theme/BlogPostPage/Metadata/index.js +1 -1
  63. package/lib/theme/BlogPostPage/StructuredData/index.d.ts +0 -1
  64. package/lib/theme/BlogPostPage/StructuredData/index.js +1 -1
  65. package/lib/theme/BlogPostPage/index.d.ts +0 -2
  66. package/lib/theme/BlogPostPage/index.js +7 -4
  67. package/lib/theme/BlogPostPaginator/index.d.ts +0 -2
  68. package/lib/theme/BlogSidebar/Content/index.d.ts +11 -0
  69. package/lib/theme/BlogSidebar/Content/index.js +41 -0
  70. package/lib/theme/BlogSidebar/Desktop/index.d.ts +4 -3
  71. package/lib/theme/BlogSidebar/Desktop/index.js +24 -17
  72. package/lib/theme/BlogSidebar/Desktop/styles.module.css +5 -0
  73. package/lib/theme/BlogSidebar/Mobile/index.d.ts +4 -3
  74. package/lib/theme/BlogSidebar/Mobile/index.js +25 -17
  75. package/lib/theme/BlogSidebar/Mobile/styles.module.css +10 -0
  76. package/lib/theme/BlogSidebar/index.d.ts +0 -2
  77. package/lib/theme/BlogTagsListPage/index.d.ts +0 -2
  78. package/lib/theme/BlogTagsPostsPage/index.d.ts +0 -2
  79. package/lib/theme/BlogTagsPostsPage/index.js +5 -32
  80. package/lib/theme/CodeBlock/Content/Element.d.ts +0 -2
  81. package/lib/theme/CodeBlock/Content/String.d.ts +0 -2
  82. package/lib/theme/CodeBlock/CopyButton/index.d.ts +0 -2
  83. package/lib/theme/CodeBlock/Line/index.d.ts +0 -2
  84. package/lib/theme/CodeBlock/WordWrapButton/index.d.ts +0 -2
  85. package/lib/theme/CodeBlock/index.d.ts +0 -2
  86. package/lib/theme/CodeInline/index.d.ts +0 -2
  87. package/lib/theme/ColorModeToggle/index.d.ts +0 -1
  88. package/lib/theme/ContentVisibility/Draft/index.d.ts +8 -0
  89. package/lib/theme/ContentVisibility/Draft/index.js +24 -0
  90. package/lib/theme/{Unlisted → ContentVisibility/Unlisted}/index.d.ts +1 -3
  91. package/lib/theme/ContentVisibility/index.d.ts +8 -0
  92. package/lib/theme/ContentVisibility/index.js +21 -0
  93. package/lib/theme/Details/index.d.ts +0 -2
  94. package/lib/theme/DocBreadcrumbs/Items/Home/index.d.ts +0 -1
  95. package/lib/theme/DocBreadcrumbs/index.d.ts +0 -1
  96. package/lib/theme/DocBreadcrumbs/index.js +2 -4
  97. package/lib/theme/DocCard/index.d.ts +0 -2
  98. package/lib/theme/DocCard/index.js +3 -3
  99. package/lib/theme/DocCardList/index.d.ts +0 -2
  100. package/lib/theme/DocCardList/index.js +1 -1
  101. package/lib/theme/DocCategoryGeneratedIndexPage/index.d.ts +0 -2
  102. package/lib/theme/DocCategoryGeneratedIndexPage/index.js +2 -4
  103. package/lib/theme/DocItem/Content/index.d.ts +0 -2
  104. package/lib/theme/DocItem/Content/index.js +1 -1
  105. package/lib/theme/DocItem/Footer/index.d.ts +0 -1
  106. package/lib/theme/DocItem/Footer/index.js +1 -1
  107. package/lib/theme/DocItem/Layout/index.d.ts +0 -2
  108. package/lib/theme/DocItem/Layout/index.js +4 -6
  109. package/lib/theme/DocItem/Metadata/index.d.ts +0 -1
  110. package/lib/theme/DocItem/Metadata/index.js +1 -1
  111. package/lib/theme/DocItem/Paginator/index.d.ts +0 -1
  112. package/lib/theme/DocItem/Paginator/index.js +1 -1
  113. package/lib/theme/DocItem/TOC/Desktop/index.d.ts +0 -1
  114. package/lib/theme/DocItem/TOC/Desktop/index.js +1 -1
  115. package/lib/theme/DocItem/TOC/Mobile/index.d.ts +0 -1
  116. package/lib/theme/DocItem/TOC/Mobile/index.js +1 -1
  117. package/lib/theme/DocItem/index.d.ts +0 -2
  118. package/lib/theme/DocItem/index.js +1 -1
  119. package/lib/theme/DocPaginator/index.d.ts +0 -2
  120. package/lib/theme/DocRoot/Layout/Main/index.d.ts +0 -2
  121. package/lib/theme/DocRoot/Layout/Main/index.js +1 -1
  122. package/lib/theme/DocRoot/Layout/Sidebar/ExpandButton/index.d.ts +0 -2
  123. package/lib/theme/DocRoot/Layout/Sidebar/index.d.ts +0 -2
  124. package/lib/theme/DocRoot/Layout/Sidebar/index.js +1 -1
  125. package/lib/theme/DocRoot/Layout/index.d.ts +0 -2
  126. package/lib/theme/DocRoot/Layout/index.js +1 -1
  127. package/lib/theme/DocRoot/index.d.ts +0 -2
  128. package/lib/theme/DocRoot/index.js +1 -1
  129. package/lib/theme/DocSidebar/Desktop/CollapseButton/index.d.ts +0 -2
  130. package/lib/theme/DocSidebar/Desktop/Content/index.d.ts +0 -2
  131. package/lib/theme/DocSidebar/Desktop/index.d.ts +0 -1
  132. package/lib/theme/DocSidebar/Mobile/index.d.ts +0 -1
  133. package/lib/theme/DocSidebar/index.d.ts +0 -2
  134. package/lib/theme/DocSidebarItem/Category/index.d.ts +0 -2
  135. package/lib/theme/DocSidebarItem/Category/index.js +2 -2
  136. package/lib/theme/DocSidebarItem/Html/index.d.ts +0 -2
  137. package/lib/theme/DocSidebarItem/Link/index.d.ts +0 -2
  138. package/lib/theme/DocSidebarItem/Link/index.js +1 -1
  139. package/lib/theme/DocSidebarItem/index.d.ts +0 -2
  140. package/lib/theme/DocSidebarItems/index.d.ts +0 -1
  141. package/lib/theme/DocSidebarItems/index.js +1 -1
  142. package/lib/theme/DocTagDocListPage/index.d.ts +0 -2
  143. package/lib/theme/DocTagDocListPage/index.js +4 -3
  144. package/lib/theme/DocTagsListPage/index.d.ts +0 -2
  145. package/lib/theme/DocVersionBadge/index.d.ts +0 -2
  146. package/lib/theme/DocVersionBadge/index.js +1 -1
  147. package/lib/theme/DocVersionBanner/index.d.ts +0 -2
  148. package/lib/theme/DocVersionBanner/index.js +1 -1
  149. package/lib/theme/DocVersionRoot/index.d.ts +0 -2
  150. package/lib/theme/DocVersionRoot/index.js +3 -3
  151. package/lib/theme/DocsRoot/index.d.ts +0 -2
  152. package/lib/theme/EditMetaRow/index.d.ts +0 -2
  153. package/lib/theme/EditThisPage/index.d.ts +0 -2
  154. package/lib/theme/ErrorPageContent.d.ts +0 -2
  155. package/lib/theme/Footer/Copyright/index.d.ts +0 -2
  156. package/lib/theme/Footer/Layout/index.d.ts +0 -2
  157. package/lib/theme/Footer/LinkItem/index.d.ts +0 -2
  158. package/lib/theme/Footer/Links/MultiColumn/index.d.ts +0 -2
  159. package/lib/theme/Footer/Links/Simple/index.d.ts +0 -2
  160. package/lib/theme/Footer/Links/index.d.ts +0 -2
  161. package/lib/theme/Footer/Logo/index.d.ts +0 -2
  162. package/lib/theme/Heading/index.d.ts +0 -2
  163. package/lib/theme/Icon/Arrow/index.d.ts +0 -2
  164. package/lib/theme/Icon/Close/index.d.ts +0 -2
  165. package/lib/theme/Icon/Copy/index.d.ts +0 -2
  166. package/lib/theme/Icon/DarkMode/index.d.ts +0 -2
  167. package/lib/theme/Icon/Edit/index.d.ts +0 -2
  168. package/lib/theme/Icon/ExternalLink/index.d.ts +0 -2
  169. package/lib/theme/Icon/Home/index.d.ts +0 -2
  170. package/lib/theme/Icon/Language/index.d.ts +0 -2
  171. package/lib/theme/Icon/LightMode/index.d.ts +0 -2
  172. package/lib/theme/Icon/Menu/index.d.ts +0 -2
  173. package/lib/theme/Icon/Socials/Default/index.d.ts +9 -0
  174. package/lib/theme/Icon/Socials/Default/index.js +30 -0
  175. package/lib/theme/Icon/Socials/GitHub/index.d.ts +9 -0
  176. package/lib/theme/Icon/Socials/GitHub/index.js +25 -0
  177. package/lib/theme/Icon/Socials/GitHub/styles.module.css +14 -0
  178. package/lib/theme/Icon/Socials/LinkedIn/index.d.ts +9 -0
  179. package/lib/theme/Icon/Socials/LinkedIn/index.js +24 -0
  180. package/lib/theme/Icon/Socials/StackOverflow/index.d.ts +9 -0
  181. package/lib/theme/Icon/Socials/StackOverflow/index.js +27 -0
  182. package/lib/theme/Icon/Socials/Twitter/index.d.ts +9 -0
  183. package/lib/theme/Icon/Socials/Twitter/index.js +24 -0
  184. package/lib/theme/Icon/Socials/X/index.d.ts +9 -0
  185. package/lib/theme/Icon/Socials/X/index.js +25 -0
  186. package/lib/theme/Icon/Socials/X/styles.module.css +14 -0
  187. package/lib/theme/Icon/Success/index.d.ts +0 -2
  188. package/lib/theme/Icon/WordWrap/index.d.ts +0 -2
  189. package/lib/theme/LastUpdated/index.d.ts +0 -2
  190. package/lib/theme/Layout/Provider/index.d.ts +0 -2
  191. package/lib/theme/Layout/Provider/index.js +1 -1
  192. package/lib/theme/Layout/index.d.ts +0 -3
  193. package/lib/theme/Logo/index.d.ts +0 -2
  194. package/lib/theme/MDXComponents/A.d.ts +0 -2
  195. package/lib/theme/MDXComponents/Code.d.ts +0 -2
  196. package/lib/theme/MDXComponents/Details.d.ts +0 -2
  197. package/lib/theme/MDXComponents/Heading.d.ts +0 -2
  198. package/lib/theme/MDXComponents/Img/index.d.ts +0 -2
  199. package/lib/theme/MDXComponents/Li.d.ts +0 -1
  200. package/lib/theme/MDXComponents/Pre.d.ts +0 -1
  201. package/lib/theme/MDXComponents/Ul/index.d.ts +0 -2
  202. package/lib/theme/MDXComponents/index.d.ts +0 -1
  203. package/lib/theme/MDXContent/index.d.ts +0 -2
  204. package/lib/theme/MDXPage/index.d.ts +0 -2
  205. package/lib/theme/MDXPage/index.js +10 -13
  206. package/lib/theme/Mermaid.d.ts +0 -1
  207. package/lib/theme/Navbar/ColorModeToggle/index.d.ts +0 -2
  208. package/lib/theme/Navbar/Content/index.d.ts +0 -1
  209. package/lib/theme/Navbar/Layout/index.d.ts +0 -2
  210. package/lib/theme/Navbar/Logo/index.d.ts +0 -1
  211. package/lib/theme/Navbar/MobileSidebar/Header/index.d.ts +0 -1
  212. package/lib/theme/Navbar/MobileSidebar/Layout/index.d.ts +0 -2
  213. package/lib/theme/Navbar/MobileSidebar/PrimaryMenu/index.d.ts +0 -1
  214. package/lib/theme/Navbar/MobileSidebar/SecondaryMenu/index.d.ts +0 -1
  215. package/lib/theme/Navbar/MobileSidebar/Toggle/index.d.ts +0 -1
  216. package/lib/theme/Navbar/MobileSidebar/index.d.ts +0 -1
  217. package/lib/theme/Navbar/Search/index.d.ts +0 -2
  218. package/lib/theme/Navbar/index.d.ts +0 -1
  219. package/lib/theme/NavbarItem/ComponentTypes.d.ts +0 -1
  220. package/lib/theme/NavbarItem/DefaultNavbarItem.d.ts +0 -2
  221. package/lib/theme/NavbarItem/DocNavbarItem.d.ts +0 -2
  222. package/lib/theme/NavbarItem/DocNavbarItem.js +4 -2
  223. package/lib/theme/NavbarItem/DocSidebarNavbarItem.d.ts +0 -2
  224. package/lib/theme/NavbarItem/DocSidebarNavbarItem.js +4 -2
  225. package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.d.ts +0 -2
  226. package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +19 -14
  227. package/lib/theme/NavbarItem/DocsVersionNavbarItem.d.ts +0 -2
  228. package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +1 -1
  229. package/lib/theme/NavbarItem/DropdownNavbarItem/index.d.ts +0 -2
  230. package/lib/theme/NavbarItem/HtmlNavbarItem.d.ts +0 -2
  231. package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.d.ts +0 -2
  232. package/lib/theme/NavbarItem/NavbarNavLink.d.ts +0 -2
  233. package/lib/theme/NavbarItem/SearchNavbarItem.d.ts +0 -2
  234. package/lib/theme/NavbarItem/index.d.ts +0 -2
  235. package/lib/theme/NotFound/Content/index.d.ts +0 -2
  236. package/lib/theme/NotFound/index.d.ts +0 -1
  237. package/lib/theme/PaginatorNavLink/index.d.ts +0 -2
  238. package/lib/theme/SearchBar.d.ts +0 -1
  239. package/lib/theme/SearchMetadata/index.d.ts +0 -2
  240. package/lib/theme/SiteMetadata/index.d.ts +0 -1
  241. package/lib/theme/SkipToContent/index.d.ts +0 -1
  242. package/lib/theme/TOC/index.d.ts +0 -2
  243. package/lib/theme/TOCCollapsible/CollapseButton/index.d.ts +0 -2
  244. package/lib/theme/TOCCollapsible/index.d.ts +0 -2
  245. package/lib/theme/TOCInline/index.d.ts +0 -2
  246. package/lib/theme/TOCItems/Tree.d.ts +0 -1
  247. package/lib/theme/TOCItems/index.d.ts +0 -2
  248. package/lib/theme/TabItem/index.d.ts +0 -2
  249. package/lib/theme/Tabs/index.d.ts +0 -2
  250. package/lib/theme/Tabs/index.js +3 -1
  251. package/lib/theme/Tag/index.d.ts +1 -3
  252. package/lib/theme/Tag/index.js +2 -1
  253. package/lib/theme/TagsListByLetter/index.d.ts +0 -2
  254. package/lib/theme/TagsListInline/index.d.ts +0 -2
  255. package/lib/theme/TagsListInline/index.js +3 -3
  256. package/lib/theme/ThemedImage/index.d.ts +0 -2
  257. package/lib/translations.js +2 -3
  258. package/package.json +15 -15
  259. package/src/getSwizzleConfig.ts +32 -0
  260. package/src/index.ts +8 -93
  261. package/src/inlineScripts.ts +114 -0
  262. package/src/options.ts +18 -2
  263. package/src/theme/Blog/Components/Author/Socials/index.tsx +66 -0
  264. package/src/theme/Blog/Components/Author/Socials/styles.module.css +39 -0
  265. package/src/theme/Blog/Components/Author/index.tsx +99 -0
  266. package/src/theme/Blog/Components/Author/styles.module.css +74 -0
  267. package/src/theme/Blog/Pages/BlogAuthorsListPage/index.tsx +62 -0
  268. package/src/theme/Blog/Pages/BlogAuthorsListPage/styles.module.css +11 -0
  269. package/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.tsx +73 -0
  270. package/src/theme/BlogListPage/StructuredData/index.tsx +1 -1
  271. package/src/theme/BlogPostItem/Content/index.tsx +1 -1
  272. package/src/theme/BlogPostItem/Footer/index.tsx +1 -1
  273. package/src/theme/BlogPostItem/Header/Authors/index.tsx +5 -4
  274. package/src/theme/BlogPostItem/Header/Authors/styles.module.css +0 -1
  275. package/src/theme/BlogPostItem/Header/Info/index.tsx +2 -4
  276. package/src/theme/BlogPostItem/Header/Title/index.tsx +1 -1
  277. package/src/theme/BlogPostItem/index.tsx +1 -1
  278. package/src/theme/BlogPostItems/index.tsx +1 -1
  279. package/src/theme/BlogPostPage/Metadata/index.tsx +1 -1
  280. package/src/theme/BlogPostPage/StructuredData/index.tsx +1 -1
  281. package/src/theme/BlogPostPage/index.tsx +7 -4
  282. package/src/theme/BlogSidebar/Content/index.tsx +57 -0
  283. package/src/theme/BlogSidebar/Desktop/index.tsx +27 -17
  284. package/src/theme/BlogSidebar/Desktop/styles.module.css +5 -0
  285. package/src/theme/BlogSidebar/Mobile/index.tsx +29 -17
  286. package/src/theme/BlogSidebar/Mobile/styles.module.css +10 -0
  287. package/src/theme/BlogTagsPostsPage/index.tsx +5 -34
  288. package/src/theme/ContentVisibility/Draft/index.tsx +27 -0
  289. package/src/theme/{Unlisted → ContentVisibility/Unlisted}/index.tsx +1 -1
  290. package/src/theme/ContentVisibility/index.tsx +27 -0
  291. package/src/theme/DocBreadcrumbs/index.tsx +2 -4
  292. package/src/theme/DocCard/index.tsx +3 -3
  293. package/src/theme/DocCardList/index.tsx +1 -1
  294. package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +2 -4
  295. package/src/theme/DocItem/Content/index.tsx +1 -1
  296. package/src/theme/DocItem/Footer/index.tsx +1 -1
  297. package/src/theme/DocItem/Layout/index.tsx +4 -6
  298. package/src/theme/DocItem/Metadata/index.tsx +1 -1
  299. package/src/theme/DocItem/Paginator/index.tsx +1 -1
  300. package/src/theme/DocItem/TOC/Desktop/index.tsx +1 -1
  301. package/src/theme/DocItem/TOC/Mobile/index.tsx +1 -1
  302. package/src/theme/DocItem/index.tsx +1 -1
  303. package/src/theme/DocRoot/Layout/Main/index.tsx +1 -1
  304. package/src/theme/DocRoot/Layout/Sidebar/index.tsx +1 -1
  305. package/src/theme/DocRoot/Layout/index.tsx +1 -1
  306. package/src/theme/DocRoot/index.tsx +1 -1
  307. package/src/theme/DocSidebarItem/Category/index.tsx +2 -2
  308. package/src/theme/DocSidebarItem/Link/index.tsx +1 -1
  309. package/src/theme/DocSidebarItems/index.tsx +1 -1
  310. package/src/theme/DocTagDocListPage/index.tsx +4 -2
  311. package/src/theme/DocVersionBadge/index.tsx +1 -1
  312. package/src/theme/DocVersionBanner/index.tsx +1 -1
  313. package/src/theme/DocVersionRoot/index.tsx +3 -3
  314. package/src/theme/Icon/Socials/Default/index.tsx +33 -0
  315. package/src/theme/Icon/Socials/GitHub/index.tsx +29 -0
  316. package/src/theme/Icon/Socials/GitHub/styles.module.css +14 -0
  317. package/src/theme/Icon/Socials/LinkedIn/index.tsx +27 -0
  318. package/src/theme/Icon/Socials/StackOverflow/index.tsx +30 -0
  319. package/src/theme/Icon/Socials/Twitter/index.tsx +27 -0
  320. package/src/theme/Icon/Socials/X/index.tsx +29 -0
  321. package/src/theme/Icon/Socials/X/styles.module.css +14 -0
  322. package/src/theme/Layout/Provider/index.tsx +1 -1
  323. package/src/theme/MDXPage/index.tsx +10 -13
  324. package/src/theme/NavbarItem/DocNavbarItem.tsx +4 -2
  325. package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +4 -2
  326. package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +32 -16
  327. package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +1 -1
  328. package/src/theme/Tabs/index.tsx +3 -1
  329. package/src/theme/Tag/index.tsx +7 -1
  330. package/src/theme/TagsListInline/index.tsx +3 -3
  331. package/src/theme-classic.d.ts +106 -12
  332. package/lib/theme/BlogPostItem/Header/Author/index.d.ts +0 -10
  333. package/lib/theme/BlogPostItem/Header/Author/index.js +0 -39
  334. package/src/theme/BlogPostItem/Header/Author/index.tsx +0 -47
  335. /package/lib/theme/{Unlisted → ContentVisibility/Unlisted}/index.js +0 -0
package/src/index.ts CHANGED
@@ -10,6 +10,11 @@ import {createRequire} from 'module';
10
10
  import rtlcss from 'rtlcss';
11
11
  import {readDefaultCodeTranslationMessages} from '@docusaurus/theme-translations';
12
12
  import {getTranslationFiles, translateThemeConfig} from './translations';
13
+ import {
14
+ getThemeInlineScript,
15
+ getAnnouncementBarInlineScript,
16
+ DataAttributeQueryStringInlineJavaScript,
17
+ } from './inlineScripts';
13
18
  import type {LoadContext, Plugin} from '@docusaurus/types';
14
19
  import type {ThemeConfig} from '@docusaurus/theme-common';
15
20
  import type {Plugin as PostCssPlugin} from 'postcss';
@@ -23,97 +28,6 @@ const ContextReplacementPlugin = requireFromDocusaurusCore(
23
28
  'webpack/lib/ContextReplacementPlugin',
24
29
  ) as typeof webpack.ContextReplacementPlugin;
25
30
 
26
- // Need to be inlined to prevent dark mode FOUC
27
- // Make sure the key is the same as the one in `/theme/hooks/useTheme.js`
28
- const ThemeStorageKey = 'theme';
29
- // Support for ?docusaurus-theme=dark
30
- const ThemeQueryStringKey = 'docusaurus-theme';
31
- // Support for ?docusaurus-data-mode=embed&docusaurus-data-myAttr=42
32
- const DataQueryStringPrefixKey = 'docusaurus-data-';
33
-
34
- const noFlashColorMode = ({
35
- defaultMode,
36
- respectPrefersColorScheme,
37
- }: ThemeConfig['colorMode']) =>
38
- /* language=js */
39
- `(function() {
40
- var defaultMode = '${defaultMode}';
41
- var respectPrefersColorScheme = ${respectPrefersColorScheme};
42
-
43
- function setDataThemeAttribute(theme) {
44
- document.documentElement.setAttribute('data-theme', theme);
45
- }
46
-
47
- function getQueryStringTheme() {
48
- try {
49
- return new URLSearchParams(window.location.search).get('${ThemeQueryStringKey}')
50
- } catch(e) {}
51
- }
52
-
53
- function getStoredTheme() {
54
- try {
55
- return localStorage.getItem('${ThemeStorageKey}');
56
- } catch (err) {}
57
- }
58
-
59
- var initialTheme = getQueryStringTheme() || getStoredTheme();
60
- if (initialTheme !== null) {
61
- setDataThemeAttribute(initialTheme);
62
- } else {
63
- if (
64
- respectPrefersColorScheme &&
65
- window.matchMedia('(prefers-color-scheme: dark)').matches
66
- ) {
67
- setDataThemeAttribute('dark');
68
- } else if (
69
- respectPrefersColorScheme &&
70
- window.matchMedia('(prefers-color-scheme: light)').matches
71
- ) {
72
- setDataThemeAttribute('light');
73
- } else {
74
- setDataThemeAttribute(defaultMode === 'dark' ? 'dark' : 'light');
75
- }
76
- }
77
- })();`;
78
-
79
- /* language=js */
80
- const DataAttributeQueryStringInlineJavaScript = `
81
- (function() {
82
- try {
83
- const entries = new URLSearchParams(window.location.search).entries();
84
- for (var [searchKey, value] of entries) {
85
- if (searchKey.startsWith('${DataQueryStringPrefixKey}')) {
86
- var key = searchKey.replace('${DataQueryStringPrefixKey}',"data-")
87
- document.documentElement.setAttribute(key, value);
88
- }
89
- }
90
- } catch(e) {}
91
- })();
92
- `;
93
-
94
- // Duplicated constant. Unfortunately we can't import it from theme-common, as
95
- // we need to support older nodejs versions without ESM support
96
- // TODO: import from theme-common once we only support Node.js with ESM support
97
- // + move all those announcementBar stuff there too
98
- export const AnnouncementBarDismissStorageKey =
99
- 'docusaurus.announcement.dismiss';
100
- const AnnouncementBarDismissDataAttribute =
101
- 'data-announcement-bar-initially-dismissed';
102
- // We always render the announcement bar html on the server, to prevent layout
103
- // shifts on React hydration. The theme can use CSS + the data attribute to hide
104
- // the announcement bar asap (before React hydration)
105
- /* language=js */
106
- const AnnouncementBarInlineJavaScript = `
107
- (function() {
108
- function isDismissed() {
109
- try {
110
- return localStorage.getItem('${AnnouncementBarDismissStorageKey}') === 'true';
111
- } catch (err) {}
112
- return false;
113
- }
114
- document.documentElement.setAttribute('${AnnouncementBarDismissDataAttribute}', isDismissed());
115
- })();`;
116
-
117
31
  function getInfimaCSSFile(direction: string) {
118
32
  return `infima/dist/css/default/default${
119
33
  direction === 'rtl' ? '-rtl' : ''
@@ -126,6 +40,7 @@ export default function themeClassic(
126
40
  ): Plugin<undefined> {
127
41
  const {
128
42
  i18n: {currentLocale, localeConfigs},
43
+ siteStorage,
129
44
  } = context;
130
45
  const themeConfig = context.siteConfig.themeConfig as ThemeConfig;
131
46
  const {
@@ -218,9 +133,9 @@ export default function themeClassic(
218
133
  {
219
134
  tagName: 'script',
220
135
  innerHTML: `
221
- ${noFlashColorMode(colorMode)}
136
+ ${getThemeInlineScript({colorMode, siteStorage})}
222
137
  ${DataAttributeQueryStringInlineJavaScript}
223
- ${announcementBar ? AnnouncementBarInlineJavaScript : ''}
138
+ ${announcementBar ? getAnnouncementBarInlineScript({siteStorage}) : ''}
224
139
  `,
225
140
  },
226
141
  ],
@@ -0,0 +1,114 @@
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 type {SiteStorage} from '@docusaurus/types';
9
+ import type {ThemeConfig} from '@docusaurus/theme-common';
10
+
11
+ // Support for ?docusaurus-theme=dark
12
+ const ThemeQueryStringKey = 'docusaurus-theme';
13
+
14
+ // Support for ?docusaurus-data-mode=embed&docusaurus-data-myAttr=42
15
+ const DataQueryStringPrefixKey = 'docusaurus-data-';
16
+
17
+ export function getThemeInlineScript({
18
+ colorMode: {defaultMode, respectPrefersColorScheme},
19
+ siteStorage,
20
+ }: {
21
+ colorMode: ThemeConfig['colorMode'];
22
+ siteStorage: SiteStorage;
23
+ }): string {
24
+ // Need to be inlined to prevent dark mode FOUC
25
+ // Make sure the key is the same as the one in the color mode React context
26
+ // Currently defined in: `docusaurus-theme-common/src/contexts/colorMode.tsx`
27
+ const themeStorageKey = `theme${siteStorage.namespace}`;
28
+
29
+ /* language=js */
30
+ return `(function() {
31
+ var defaultMode = '${defaultMode}';
32
+ var respectPrefersColorScheme = ${respectPrefersColorScheme};
33
+
34
+ function setDataThemeAttribute(theme) {
35
+ document.documentElement.setAttribute('data-theme', theme);
36
+ }
37
+
38
+ function getQueryStringTheme() {
39
+ try {
40
+ return new URLSearchParams(window.location.search).get('${ThemeQueryStringKey}')
41
+ } catch (e) {
42
+ }
43
+ }
44
+
45
+ function getStoredTheme() {
46
+ try {
47
+ return window['${siteStorage.type}'].getItem('${themeStorageKey}');
48
+ } catch (err) {
49
+ }
50
+ }
51
+
52
+ var initialTheme = getQueryStringTheme() || getStoredTheme();
53
+ if (initialTheme !== null) {
54
+ setDataThemeAttribute(initialTheme);
55
+ } else {
56
+ if (
57
+ respectPrefersColorScheme &&
58
+ window.matchMedia('(prefers-color-scheme: dark)').matches
59
+ ) {
60
+ setDataThemeAttribute('dark');
61
+ } else if (
62
+ respectPrefersColorScheme &&
63
+ window.matchMedia('(prefers-color-scheme: light)').matches
64
+ ) {
65
+ setDataThemeAttribute('light');
66
+ } else {
67
+ setDataThemeAttribute(defaultMode === 'dark' ? 'dark' : 'light');
68
+ }
69
+ }
70
+ })();`;
71
+ }
72
+
73
+ /* language=js */
74
+ export const DataAttributeQueryStringInlineJavaScript = `
75
+ (function() {
76
+ try {
77
+ const entries = new URLSearchParams(window.location.search).entries();
78
+ for (var [searchKey, value] of entries) {
79
+ if (searchKey.startsWith('${DataQueryStringPrefixKey}')) {
80
+ var key = searchKey.replace('${DataQueryStringPrefixKey}',"data-")
81
+ document.documentElement.setAttribute(key, value);
82
+ }
83
+ }
84
+ } catch(e) {}
85
+ })();
86
+ `;
87
+
88
+ // We always render the announcement bar html on the server, to prevent layout
89
+ // shifts on React hydration. The theme can use CSS + the data attribute to hide
90
+ // the announcement bar asap (before React hydration)
91
+ export function getAnnouncementBarInlineScript({
92
+ siteStorage,
93
+ }: {
94
+ siteStorage: SiteStorage;
95
+ }): string {
96
+ // Duplicated constant. Unfortunately we can't import it from theme-common, as
97
+ // we need to support older nodejs versions without ESM support
98
+ // TODO: import from theme-common once we support Node.js with ESM support
99
+ // + move all those announcementBar stuff there too
100
+ const AnnouncementBarDismissStorageKey = `docusaurus.announcement.dismiss${siteStorage.namespace}`;
101
+ const AnnouncementBarDismissDataAttribute =
102
+ 'data-announcement-bar-initially-dismissed';
103
+
104
+ /* language=js */
105
+ return `(function() {
106
+ function isDismissed() {
107
+ try {
108
+ return localStorage.getItem('${AnnouncementBarDismissStorageKey}') === 'true';
109
+ } catch (err) {}
110
+ return false;
111
+ }
112
+ document.documentElement.setAttribute('${AnnouncementBarDismissDataAttribute}', isDismissed());
113
+ })();`;
114
+ }
package/src/options.ts CHANGED
@@ -15,6 +15,7 @@ import type {
15
15
  } from '@docusaurus/types';
16
16
 
17
17
  const defaultPrismTheme = themes.palenight;
18
+
18
19
  const DEFAULT_DOCS_CONFIG: ThemeConfig['docs'] = {
19
20
  versionPersistence: 'localStorage',
20
21
  sidebar: {
@@ -22,11 +23,12 @@ const DEFAULT_DOCS_CONFIG: ThemeConfig['docs'] = {
22
23
  autoCollapseCategories: false,
23
24
  },
24
25
  };
25
- const DocsSchema = Joi.object({
26
+
27
+ const DocsSchema = Joi.object<ThemeConfig['docs']>({
26
28
  versionPersistence: Joi.string()
27
29
  .equal('localStorage', 'none')
28
30
  .default(DEFAULT_DOCS_CONFIG.versionPersistence),
29
- sidebar: Joi.object({
31
+ sidebar: Joi.object<ThemeConfig['docs']['sidebar']>({
30
32
  hideable: Joi.bool().default(DEFAULT_DOCS_CONFIG.sidebar.hideable),
31
33
  autoCollapseCategories: Joi.bool().default(
32
34
  DEFAULT_DOCS_CONFIG.sidebar.autoCollapseCategories,
@@ -34,6 +36,18 @@ const DocsSchema = Joi.object({
34
36
  }).default(DEFAULT_DOCS_CONFIG.sidebar),
35
37
  }).default(DEFAULT_DOCS_CONFIG);
36
38
 
39
+ const DEFAULT_BLOG_CONFIG: ThemeConfig['blog'] = {
40
+ sidebar: {
41
+ groupByYear: true,
42
+ },
43
+ };
44
+
45
+ const BlogSchema = Joi.object<ThemeConfig['blog']>({
46
+ sidebar: Joi.object<ThemeConfig['blog']['sidebar']>({
47
+ groupByYear: Joi.bool().default(DEFAULT_BLOG_CONFIG.sidebar.groupByYear),
48
+ }).default(DEFAULT_BLOG_CONFIG.sidebar),
49
+ }).default(DEFAULT_BLOG_CONFIG);
50
+
37
51
  const DEFAULT_COLOR_MODE_CONFIG: ThemeConfig['colorMode'] = {
38
52
  defaultMode: 'light',
39
53
  disableSwitch: false,
@@ -43,6 +57,7 @@ const DEFAULT_COLOR_MODE_CONFIG: ThemeConfig['colorMode'] = {
43
57
  export const DEFAULT_CONFIG: ThemeConfig = {
44
58
  colorMode: DEFAULT_COLOR_MODE_CONFIG,
45
59
  docs: DEFAULT_DOCS_CONFIG,
60
+ blog: DEFAULT_BLOG_CONFIG,
46
61
  metadata: [],
47
62
  prism: {
48
63
  additionalLanguages: [],
@@ -333,6 +348,7 @@ export const ThemeConfigSchema = Joi.object<ThemeConfig>({
333
348
  colorMode: ColorModeSchema,
334
349
  image: Joi.string(),
335
350
  docs: DocsSchema,
351
+ blog: BlogSchema,
336
352
  metadata: Joi.array()
337
353
  .items(HtmlMetadataSchema)
338
354
  .default(DEFAULT_CONFIG.metadata),
@@ -0,0 +1,66 @@
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 type {ComponentType} from 'react';
9
+ import React from 'react';
10
+ import clsx from 'clsx';
11
+ import Link from '@docusaurus/Link';
12
+ import type {Props} from '@theme/Blog/Components/Author/Socials';
13
+
14
+ import Twitter from '@theme/Icon/Socials/Twitter';
15
+ import GitHub from '@theme/Icon/Socials/GitHub';
16
+ import X from '@theme/Icon/Socials/X';
17
+ import StackOverflow from '@theme/Icon/Socials/StackOverflow';
18
+ import LinkedIn from '@theme/Icon/Socials/LinkedIn';
19
+ import DefaultSocialIcon from '@theme/Icon/Socials/Default';
20
+
21
+ import styles from './styles.module.css';
22
+
23
+ type SocialIcon = ComponentType<{className: string}>;
24
+
25
+ type SocialPlatformConfig = {Icon: SocialIcon; label: string};
26
+
27
+ const SocialPlatformConfigs: Record<string, SocialPlatformConfig> = {
28
+ twitter: {Icon: Twitter, label: 'Twitter'},
29
+ github: {Icon: GitHub, label: 'GitHub'},
30
+ stackoverflow: {Icon: StackOverflow, label: 'Stack Overflow'},
31
+ linkedin: {Icon: LinkedIn, label: 'LinkedIn'},
32
+ x: {Icon: X, label: 'X'},
33
+ };
34
+
35
+ function getSocialPlatformConfig(platformKey: string): SocialPlatformConfig {
36
+ return (
37
+ SocialPlatformConfigs[platformKey] ?? {
38
+ Icon: DefaultSocialIcon,
39
+ label: platformKey,
40
+ }
41
+ );
42
+ }
43
+
44
+ function SocialLink({platform, link}: {platform: string; link: string}) {
45
+ const {Icon, label} = getSocialPlatformConfig(platform);
46
+ return (
47
+ <Link className={styles.authorSocialLink} href={link} title={label}>
48
+ <Icon className={clsx(styles.authorSocialLink)} />
49
+ </Link>
50
+ );
51
+ }
52
+
53
+ export default function BlogAuthorSocials({
54
+ author,
55
+ }: {
56
+ author: Props['author'];
57
+ }): JSX.Element {
58
+ const entries = Object.entries(author.socials ?? {});
59
+ return (
60
+ <div className={styles.authorSocials}>
61
+ {entries.map(([platform, linkUrl]) => {
62
+ return <SocialLink key={platform} platform={platform} link={linkUrl} />;
63
+ })}
64
+ </div>
65
+ );
66
+ }
@@ -0,0 +1,39 @@
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
+ :root {
9
+ --docusaurus-blog-social-icon-size: 1rem;
10
+ }
11
+
12
+ .authorSocials {
13
+ /*
14
+ This ensures that container takes height even if there's no social link
15
+ This keeps author names aligned even if only some have socials
16
+ */
17
+ height: var(--docusaurus-blog-social-icon-size);
18
+
19
+ display: flex;
20
+ flex-wrap: wrap;
21
+ align-items: center;
22
+ line-height: 0;
23
+ overflow: hidden;
24
+ line-clamp: 1;
25
+ -webkit-line-clamp: 1;
26
+ -webkit-box-orient: vertical;
27
+ }
28
+
29
+ .authorSocialLink {
30
+ height: var(--docusaurus-blog-social-icon-size);
31
+ width: var(--docusaurus-blog-social-icon-size);
32
+ line-height: 0;
33
+ margin-right: 0.4rem;
34
+ }
35
+
36
+ .authorSocialIcon {
37
+ width: var(--docusaurus-blog-social-icon-size);
38
+ height: var(--docusaurus-blog-social-icon-size);
39
+ }
@@ -0,0 +1,99 @@
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 Link, {type Props as LinkProps} from '@docusaurus/Link';
11
+ import AuthorSocials from '@theme/Blog/Components/Author/Socials';
12
+ import type {Props} from '@theme/Blog/Components/Author';
13
+ import Heading from '@theme/Heading';
14
+ import styles from './styles.module.css';
15
+
16
+ function MaybeLink(props: LinkProps): JSX.Element {
17
+ if (props.href) {
18
+ return <Link {...props} />;
19
+ }
20
+ return <>{props.children}</>;
21
+ }
22
+
23
+ function AuthorTitle({title}: {title: string}) {
24
+ return (
25
+ <small className={styles.authorTitle} title={title}>
26
+ {title}
27
+ </small>
28
+ );
29
+ }
30
+
31
+ function AuthorName({name, as}: {name: string; as: Props['as']}) {
32
+ if (!as) {
33
+ return <span className={styles.authorName}>{name}</span>;
34
+ } else {
35
+ return (
36
+ <Heading as={as} className={styles.authorName}>
37
+ {name}
38
+ </Heading>
39
+ );
40
+ }
41
+ }
42
+
43
+ function AuthorBlogPostCount({count}: {count: number}) {
44
+ return <span className={clsx(styles.authorBlogPostCount)}>{count}</span>;
45
+ }
46
+
47
+ // Note: in the future we might want to have multiple "BlogAuthor" components
48
+ // Creating different display modes with the "as" prop may not be the best idea
49
+ // Explainer: https://kyleshevlin.com/prefer-multiple-compositions/
50
+ // For now, we almost use the same design for all cases, so it's good enough
51
+ export default function BlogAuthor({
52
+ as,
53
+ author,
54
+ className,
55
+ count,
56
+ }: Props): JSX.Element {
57
+ const {name, title, url, imageURL, email, page} = author;
58
+ const link =
59
+ page?.permalink || url || (email && `mailto:${email}`) || undefined;
60
+
61
+ return (
62
+ <div
63
+ className={clsx(
64
+ 'avatar margin-bottom--sm',
65
+ className,
66
+ styles[`author-as-${as}`],
67
+ )}>
68
+ {imageURL && (
69
+ <MaybeLink href={link} className="avatar__photo-link">
70
+ <img
71
+ className={clsx('avatar__photo', styles.authorImage)}
72
+ src={imageURL}
73
+ alt={name}
74
+ />
75
+ </MaybeLink>
76
+ )}
77
+
78
+ {(name || title) && (
79
+ <div className={clsx('avatar__intro', styles.authorDetails)}>
80
+ <div className="avatar__name">
81
+ {name && (
82
+ <MaybeLink href={link}>
83
+ <AuthorName name={name} as={as} />
84
+ </MaybeLink>
85
+ )}
86
+ {count && <AuthorBlogPostCount count={count} />}
87
+ </div>
88
+ {!!title && <AuthorTitle title={title} />}
89
+
90
+ {/*
91
+ We always render AuthorSocials even if there's none
92
+ This keeps other things aligned with flexbox layout
93
+ */}
94
+ <AuthorSocials author={author} />
95
+ </div>
96
+ )}
97
+ </div>
98
+ );
99
+ }
@@ -0,0 +1,74 @@
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
+ .authorImage {
9
+ --ifm-avatar-photo-size: 3.6rem;
10
+ }
11
+
12
+ .author-as-h1 .authorImage {
13
+ --ifm-avatar-photo-size: 7rem;
14
+ }
15
+
16
+ .author-as-h2 .authorImage {
17
+ --ifm-avatar-photo-size: 5.4rem;
18
+ }
19
+
20
+ .authorDetails {
21
+ display: flex;
22
+ flex-direction: column;
23
+ align-items: flex-start;
24
+ justify-content: space-around;
25
+ }
26
+
27
+ .authorName {
28
+ font-size: 1.1rem;
29
+ line-height: 1.1rem;
30
+ display: flex;
31
+ flex-direction: row;
32
+ }
33
+
34
+ .author-as-h1 .authorName {
35
+ font-size: 2.4rem;
36
+ line-height: 2.4rem;
37
+ display: inline;
38
+ }
39
+
40
+ .author-as-h2 .authorName {
41
+ font-size: 1.4rem;
42
+ line-height: 1.4rem;
43
+ display: inline;
44
+ }
45
+
46
+ .authorTitle {
47
+ font-size: 0.8rem;
48
+ line-height: 0.8rem;
49
+ display: -webkit-box;
50
+ overflow: hidden;
51
+ line-clamp: 1;
52
+ -webkit-line-clamp: 1;
53
+ -webkit-box-orient: vertical;
54
+ }
55
+
56
+ .author-as-h1 .authorTitle {
57
+ font-size: 1.2rem;
58
+ line-height: 1.2rem;
59
+ }
60
+
61
+ .author-as-h2 .authorTitle {
62
+ font-size: 1rem;
63
+ line-height: 1rem;
64
+ }
65
+
66
+ .authorBlogPostCount {
67
+ background: var(--ifm-color-secondary);
68
+ color: var(--ifm-color-black);
69
+ font-size: 0.8rem;
70
+ line-height: 1.2;
71
+ border-radius: var(--ifm-global-radius);
72
+ padding: 0.1rem 0.4rem;
73
+ margin-left: 0.3rem;
74
+ }
@@ -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
+ }