This is an automated email from the ASF dual-hosted git repository.
luzhijing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new 7932d68944d9 [feat] add join discussion (#456)
7932d68944d9 is described below
commit 7932d68944d963200e4c1711a398adad9fb19541
Author: Jeffrey <[email protected]>
AuthorDate: Fri Mar 22 15:21:10 2024 +0800
[feat] add join discussion (#456)
---
src/theme/TOC/index.tsx | 71 +++++++++++++++++++++++++++++++++++++++++
src/theme/TOC/styles.module.css | 16 ++++++++++
2 files changed, 87 insertions(+)
diff --git a/src/theme/TOC/index.tsx b/src/theme/TOC/index.tsx
new file mode 100644
index 000000000000..d9d5faee07ee
--- /dev/null
+++ b/src/theme/TOC/index.tsx
@@ -0,0 +1,71 @@
+import React from 'react';
+import clsx from 'clsx';
+import TOCItems from '@theme/TOCItems';
+import type { Props } from '@theme/TOC';
+
+import styles from './styles.module.css';
+import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
+import Link from '@docusaurus/Link';
+
+// Using a custom className
+// This prevents TOCInline/TOCCollapsible getting highlighted by mistake
+const LINK_CLASS_NAME = 'table-of-contents__link toc-highlight';
+const LINK_ACTIVE_CLASS_NAME = 'table-of-contents__link--active';
+
+export default function TOC({ className, ...props }: Props): JSX.Element {
+ const { siteConfig } = useDocusaurusContext();
+ const isCN = siteConfig.baseUrl.indexOf('zh-CN') > -1;
+ return (
+ <div className={clsx(styles.tableOfContents, 'thin-scrollbar',
className)}>
+ {isCN ? (
+ <Link
+ className="ml-4 mb-8 flex items-center hover:no-underline"
+ href="https://ask.selectdb.com"
+ target="_blank"
+ >
+ <span className="pr-2">问答论坛</span>
+ <svg
+ viewBox="0 0 1024 1024"
+ version="1.1"
+ xmlns="http://www.w3.org/2000/svg"
+ p-id="8500"
+ id="mx_n_1711090272569"
+ width="16"
+ height="16"
+ >
+ <path
+ d="M522.24 896.512c-25.6 4.608-51.712 7.168-78.336
7.168-79.36 0-157.696-21.504-225.792-62.464l-18.432-10.752-103.936
28.16c-28.672
7.68-54.784-18.432-47.104-47.104l28.16-103.936c-10.752-17.92-17.408-30.208-20.992-36.864C20.992
607.232 3.072 536.064 3.584 463.36c0-243.2 197.12-440.32 440.32-440.32 221.696
0 405.504 164.352 435.712 377.856 90.112 55.808 144.896 154.112 144.896 260.096
0 51.2-12.8 100.352-36.352 144.384-2.048 4.096-6.144 10.752-11.776 20.48l17.4
[...]
+ p-id="8501"
+ fill="currentColor"
+ ></path>
+ </svg>
+ </Link>
+ ) : (
+ <Link
+ className="ml-4 mb-8 flex items-center hover:no-underline"
+ href="https://ask.selectdb.com"
+ target="_blank"
+ >
+ <span className="pr-2">Join Discussion</span>
+ <svg
+ viewBox="0 0 1024 1024"
+ version="1.1"
+ xmlns="http://www.w3.org/2000/svg"
+ p-id="8500"
+ id="mx_n_1711090272569"
+ width="16"
+ height="16"
+ >
+ <path
+ d="M522.24 896.512c-25.6 4.608-51.712 7.168-78.336
7.168-79.36 0-157.696-21.504-225.792-62.464l-18.432-10.752-103.936
28.16c-28.672
7.68-54.784-18.432-47.104-47.104l28.16-103.936c-10.752-17.92-17.408-30.208-20.992-36.864C20.992
607.232 3.072 536.064 3.584 463.36c0-243.2 197.12-440.32 440.32-440.32 221.696
0 405.504 164.352 435.712 377.856 90.112 55.808 144.896 154.112 144.896 260.096
0 51.2-12.8 100.352-36.352 144.384-2.048 4.096-6.144 10.752-11.776 20.48l17.4
[...]
+ p-id="8501"
+ fill="currentColor"
+ ></path>
+ </svg>
+ </Link>
+ )}
+ <span className="ml-4">{!isCN ? 'On This Page' : '本页导航'}</span>
+ <TOCItems {...props} linkClassName={LINK_CLASS_NAME}
linkActiveClassName={LINK_ACTIVE_CLASS_NAME} />
+ </div>
+ );
+}
diff --git a/src/theme/TOC/styles.module.css b/src/theme/TOC/styles.module.css
new file mode 100644
index 000000000000..4b5d9f462e06
--- /dev/null
+++ b/src/theme/TOC/styles.module.css
@@ -0,0 +1,16 @@
+.tableOfContents {
+ max-height: calc(100vh - (var(--ifm-navbar-height) + 2rem));
+ overflow-y: auto;
+ position: sticky;
+ top: calc(var(--ifm-navbar-height) + 1rem);
+}
+
+@media (max-width: 996px) {
+ .tableOfContents {
+ display: none;
+ }
+
+ .docItemContainer {
+ padding: 0 0.3rem;
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]