File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2+ import { useLocation } from '@docusaurus/router' ;
23
34import CopyForLLM from './CopyForLLM' ;
45import styles from './styles.module.css' ;
56import ViewAsMarkdown from './ViewAsMarkdown' ;
67
78export default function LLMButtons ( ) {
9+ const location = useLocation ( ) ;
10+
11+ // Don't render LLMButtons if we're on a markdown view
12+ if ( location . pathname . endsWith ( '.md' ) ) {
13+ return null ;
14+ }
15+
816 return (
917 < div className = { styles . llmButtonsContainer } >
1018 < ViewAsMarkdown />
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export default function DocItemContent({ children }) {
4949 '/platform' ,
5050 ] ;
5151
52- const shouldShowLLMButtons = allowedPaths . some ( ( path ) => location . pathname . startsWith ( path ) && ! location . pathname . endsWith ( '.md' ) ) ;
52+ const shouldShowLLMButtons = allowedPaths . some ( ( path ) => location . pathname . startsWith ( path ) ) ;
5353
5454 return (
5555 < div className = { clsx ( ThemeClassNames . docs . docMarkdown , 'markdown' ) } >
You can’t perform that action at this time.
0 commit comments