Docs: 添加 wwads (#2361)

This commit is contained in:
Ju4tCode 2023-09-13 13:55:48 +08:00 committed by GitHub
parent 005968ab70
commit 22b6062900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 79 additions and 4 deletions

View File

@ -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",

View File

@ -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 (
<>
<OriginCopyright />
@ -24,7 +24,7 @@ function FooterCopyright() {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clip-path="url(#clip0_236_25)">
<g clipPath="url(#clip0_236_25)">
<path
d="M58.4704 103.765V77.4144L59.0165 76.8683H65.6043L66.1504 77.4144V103.765L65.6043 104.311H59.0165L58.4704 103.765Z"
fill="#05BDBA"
@ -117,5 +117,3 @@ function FooterCopyright() {
</>
);
}
export default FooterCopyright;

View File

@ -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 (
<div className={clsx(styles.toc, "thin-scrollbar", className)}>
<TOCItems
{...props}
linkClassName={LINK_CLASS_NAME}
linkActiveClassName={LINK_ACTIVE_CLASS_NAME}
/>
<div className={styles.tocAdsContainer}>
<div
className={clsx("wwads-cn wwads-horizontal", styles.tocAds)}
data-id="281"
></div>
</div>
</div>
);
}

View File

@ -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;
}