This is an automated email from the ASF dual-hosted git repository.

jeffreyh 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 9d321d67f08 fix:remove toc items in blog page (#2276)
9d321d67f08 is described below

commit 9d321d67f08c7d52ff02a7ef41bba2976cce5ced
Author: yangon <2689991...@qq.com>
AuthorDate: Wed Apr 9 19:48:47 2025 +0800

    fix:remove toc items in blog page (#2276)
    
    
![image](https://github.com/user-attachments/assets/abe3c16d-9d79-4caa-a250-31320782e4aa)
---
 src/theme/TOC/index.tsx | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/theme/TOC/index.tsx b/src/theme/TOC/index.tsx
index e6c12af1dfd..e70ac5ad5db 100644
--- a/src/theme/TOC/index.tsx
+++ b/src/theme/TOC/index.tsx
@@ -8,6 +8,7 @@ import PdfIcon from '@site/static/images/toc-icon/pdf.svg';
 import GithubIcon from '@site/static/images/toc-icon/github.svg';
 import SlackIconUrl from '@site/static/images/toc-icon/slack.png';
 import SlackColorIconUrl from '@site/static/images/toc-icon/slack-color.png';
+import useIsBrowser from '@docusaurus/useIsBrowser';
 import ConcatIcon from '@site/static/images/toc-icon/concat.svg';
 import { DOWNLOAD_PDFS } from '@site/src/constant/download.data';
 import { VERSIONS } from '@site/src/constant/common';
@@ -36,6 +37,7 @@ export function downloadFile(url: string, filename: string) {
 
 export default function TOC({ className, ...props }: Props): JSX.Element {
     const { siteConfig } = useDocusaurusContext();
+    const isBrowser = useIsBrowser();
     const isCN = siteConfig.baseUrl.indexOf('zh-CN') > -1;
     const DEFAULT_VERSION = '2.1';
     const [currentVersion, setCurrentVersion] = useState(DEFAULT_VERSION);
@@ -70,7 +72,7 @@ export default function TOC({ className, ...props }: Props): 
JSX.Element {
 
     return (
         <div className={clsx(styles.tableOfContents, 'thin-scrollbar', 
'toc-container', className)}>
-            <div>
+            <div style={isBrowser && location.pathname.startsWith('/blog') ? { 
display: 'none' } : {}}>
                 <Link to={'/'}>
                     <div
                         className="toc-icon-content"
@@ -121,9 +123,9 @@ export default function TOC({ className, ...props }: 
Props): JSX.Element {
                         onMouseLeave={() => setIsHoverSlack(false)}
                     >
                         {isHoverSlack ? (
-                            <img style={{margin:'2px'}} 
src={SlackColorIconUrl} width={16} alt="slack icon" />
+                            <img style={{ margin: '2px' }} 
src={SlackColorIconUrl} width={16} alt="slack icon" />
                         ) : (
-                            <img style={{margin:'2px'}} src={SlackIconUrl} 
width={16} alt="slack icon" />
+                            <img style={{ margin: '2px' }} src={SlackIconUrl} 
width={16} alt="slack icon" />
                         )}
                         <span>Chat on Slack</span>
                     </Link>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to