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 7da667d02ee Revert "fix:Solve the problem of URL automatically
carrying slashes c… (#1363)
7da667d02ee is described below
commit 7da667d02ee04e9fc37fe5ff4e84196fa7ddc768
Author: yangon <[email protected]>
AuthorDate: Thu Nov 14 21:11:08 2024 +0800
Revert "fix:Solve the problem of URL automatically carrying slashes c…
(#1363)
…ausing dead links (#1341)"
This reverts commit f23632df3312d69dc78a19f458b3fef3114671f8.
# Versions
- [ ] dev
- [ ] 3.0
- [ ] 2.1
- [ ] 2.0
# Languages
- [ ] Chinese
- [ ] English
Co-authored-by: liyang <[email protected]>
---
src/theme/Navbar/Layout/index.tsx | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/src/theme/Navbar/Layout/index.tsx
b/src/theme/Navbar/Layout/index.tsx
index b9632cf47d1..2e447e2e5bc 100644
--- a/src/theme/Navbar/Layout/index.tsx
+++ b/src/theme/Navbar/Layout/index.tsx
@@ -5,13 +5,10 @@ import { useHideableNavbar, useNavbarMobileSidebar } from
'@docusaurus/theme-com
import { translate } from '@docusaurus/Translate';
import NavbarMobileSidebar from '@theme/Navbar/MobileSidebar';
import styles from './styles.module.css';
-import { useLocation } from '@docusaurus/router';
-
function NavbarBackdrop(props) {
return <div role="presentation" {...props}
className={clsx('navbar-sidebar__backdrop', props.className)} />;
}
export default function NavbarLayout({ children }) {
- const location = useLocation();
const {
navbar: { hideOnScroll, style },
} = useThemeConfig();
@@ -25,12 +22,11 @@ export default function NavbarLayout({ children }) {
useEffect(() => {
if (typeof window !== 'undefined') {
const pathname = location.pathname.split('/')[1];
- const tempPath = ['get-starting', 'benchmark', 'ecosystems',
'faq', 'releasenotes'];
- const isDocsPage =
- tempPath.includes(pathname) || tempPath.some(path =>
location.pathname.includes(`zh-CN/${path}`));
+ const tempPath = ['get-starting', 'benchmark', 'ecosystems',
'faq', 'releasenotes']
+ const isDocsPage = tempPath.includes(pathname) ||
tempPath.some(path => location.pathname.includes(`zh-CN/${path}`))
const docsPage = pathname === 'docs' ||
location.pathname.includes('zh-CN/docs');
setIsDocsPage(docsPage);
- setWithoutDoc(isDocsPage);
+ setWithoutDoc(isDocsPage)
}
if (typeof window !== 'undefined') {
@@ -39,17 +35,6 @@ export default function NavbarLayout({ children }) {
setIsCommunity(communityPage);
}
}, [typeof window !== 'undefined' && location.pathname]);
-
- useEffect(() => {
- if (
- typeof window !== 'undefined' &&
- location.pathname.length > 1 &&
- location.pathname[location.pathname.length - 1] === '/'
- ) {
- window.location.pathname = location.pathname.slice(0, -1);
- }
- }, [location.pathname]);
-
return (
<nav
ref={navbarRef}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]