diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index c7120c2e..a90d54cf 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -23,6 +23,15 @@ const config = { }, }, + scripts: [ + { + type: "text/javascript", + charset: "UTF-8", + src: "https://cdn.wwads.cn/js/makemoney.js", + async: true, + }, + ], + presets: [ [ "docusaurus-preset-nonepress", diff --git a/website/src/theme/FooterCopyright/index.tsx b/website/src/theme/FooterCopyright/index.tsx index a7b334ae..1cfb65bd 100644 --- a/website/src/theme/FooterCopyright/index.tsx +++ b/website/src/theme/FooterCopyright/index.tsx @@ -3,7 +3,7 @@ import React from "react"; import Link from "@docusaurus/Link"; import OriginCopyright from "@theme-original/FooterCopyright"; -function FooterCopyright() { +export default function FooterCopyright(): JSX.Element { return ( <> @@ -24,7 +24,7 @@ function FooterCopyright() { fill="none" xmlns="http://www.w3.org/2000/svg" > - + ); } - -export default FooterCopyright; diff --git a/website/src/theme/TOC/index.tsx b/website/src/theme/TOC/index.tsx new file mode 100644 index 00000000..743967dc --- /dev/null +++ b/website/src/theme/TOC/index.tsx @@ -0,0 +1,27 @@ +import React from "react"; +import clsx from "clsx"; + +import TOCItems from "@theme/TOCItems"; +import styles from "./styles.module.css"; +import type { TOCProps } from "@theme/TOC"; + +const LINK_CLASS_NAME = styles["toc-link"]; +const LINK_ACTIVE_CLASS_NAME = styles["toc-link-active"]; + +export default function TOC({ className, ...props }: TOCProps): JSX.Element { + return ( +
+ +
+
+
+
+ ); +} diff --git a/website/src/theme/TOC/styles.module.css b/website/src/theme/TOC/styles.module.css new file mode 100644 index 00000000..27f15aaa --- /dev/null +++ b/website/src/theme/TOC/styles.module.css @@ -0,0 +1,41 @@ +.toc { + max-height: calc(100vh - 7rem); + + @apply sticky top-28 overflow-y-auto; +} + +.toc-link { + @apply text-light-text; +} + +:global .dark :local .toc-link { + @apply text-dark-text; +} + +.toc-link-active { + @apply text-light-text-active; +} + +:global .dark :local .toc-link-active { + @apply text-dark-text-active; +} + +.tocAdsContainer { + @apply sticky bottom-0 w-full max-w-full mt-2; +} + +.tocAds { + @apply max-w-full !bg-light; +} + +:global .dark :local .tocAds { + @apply !bg-dark; +} + +.tocAds :global .wwads-text { + @apply text-light-text; +} + +:global .dark :local .tocAds :global .wwads-text { + @apply text-dark-text; +}