diff --git a/sidebars-next.ts b/sidebars-next.ts index 43bc453f9e1b6..66c3a92934237 100644 --- a/sidebars-next.ts +++ b/sidebars-next.ts @@ -2,6 +2,12 @@ import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; const sidebars: SidebarsConfig = { docs: [ + { + type: 'category', + label: 'Get Started', + collapsible: false, + collapsed: false, + items: [ { type: 'category', label: 'Getting Started', @@ -174,7 +180,15 @@ const sidebars: SidebarsConfig = { ], }, ], + }, + ], }, + { + type: 'category', + label: 'Use Doris', + collapsible: false, + collapsed: false, + items: [ { type: 'category', label: 'Table Design', @@ -712,6 +726,41 @@ const sidebars: SidebarsConfig = { }, ], }, + ], + }, + { + type: 'category', + label: 'Solutions', + collapsible: false, + collapsed: false, + items: [ + { + type: 'category', + label: 'Doris for AI', + link: {type: 'doc', id: 'ai/ai-overview'}, + collapsed: true, + items: [ + 'ai/ai-function-overview', + ], + }, + { + type: 'category', + label: 'Observability with Doris', + link: {type: 'doc', id: 'observability/overview'}, + collapsed: true, + items: [ + 'observability/log', + 'observability/trace', + ], + }, + ], + }, + { + type: 'category', + label: 'Operate & Maintain', + collapsible: false, + collapsed: false, + items: [ { type: 'category', label: 'Administration', @@ -2598,23 +2647,6 @@ const sidebars: SidebarsConfig = { }, ], }, - { - type: 'category', - label: 'Doris for AI', - link: {type: 'doc', id: 'ai/ai-overview'}, - collapsed: true, - items: [ - 'ai/ai-function-overview', - ], - }, - { - type: 'category', - label: 'Observability with Doris', - link: {type: 'doc', id: 'observability/overview'}, - collapsed: true, - items: [ - 'observability/log', - 'observability/trace', ], }, ], diff --git a/src/components/home-next/NavbarNext.tsx b/src/components/home-next/NavbarNext.tsx index 1ee5471e9ecf0..0ff0e0c28839c 100644 --- a/src/components/home-next/NavbarNext.tsx +++ b/src/components/home-next/NavbarNext.tsx @@ -1,9 +1,7 @@ import React, { JSX, useState, useEffect } from 'react'; import Link from '@docusaurus/Link'; -import { useLocation } from '@docusaurus/router'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem'; -import { getLocalePrefix, isDocsNextPath, isReleasesPath, normalizePathname } from '@site/src/utils/locale'; +import { getLocalePrefix } from '@site/src/utils/locale'; import { STAR_COUNT } from '@site/src/constant/github.data'; import './NavbarNext.scss'; @@ -109,33 +107,15 @@ function MenuIcon({ open }: { open: boolean }): JSX.Element { export function NavbarNext(): JSX.Element { const { - i18n: { currentLocale, defaultLocale, localeConfigs }, + i18n: { currentLocale, defaultLocale }, } = useDocusaurusContext(); - const { pathname, search, hash } = useLocation(); const [mobileOpen, setMobileOpen] = useState(false); const localePrefix = getLocalePrefix(currentLocale, defaultLocale); const docsHref = `${localePrefix}/docs-next/dev/getting-started/what-is-apache-doris`; const releasesHref = `${localePrefix}/releases/all-release`; const navItems = buildNavItems(docsHref, releasesHref); const [expandedMobileItem, setExpandedMobileItem] = useState(navItems[0]?.label ?? ''); - const isDocsNextPage = isDocsNextPath(pathname, [defaultLocale, 'zh-CN']); - const isReleasesPage = isReleasesPath(pathname, [defaultLocale, 'zh-CN']); - const showLocaleSwitcher = isDocsNextPage || isReleasesPage; const homeHref = `${getLocalePrefix(currentLocale, defaultLocale)}/`; - const localeSwitchLabel = currentLocale === 'zh-CN' ? localeConfigs[defaultLocale]?.label ?? 'English' : '中文'; - const currentLocalizedPath = normalizePathname(pathname, [defaultLocale, 'zh-CN']); - const buildLocaleHref = (locale: string) => - `pathname://${locale === defaultLocale ? '' : `/${locale}`}${currentLocalizedPath}${search}${hash}`; - const localeItems = [defaultLocale, 'zh-CN'] - .filter((locale, index, arr) => arr.indexOf(locale) === index) - .map(locale => ({ - label: localeConfigs[locale]?.label ?? locale, - lang: localeConfigs[locale]?.htmlLang, - to: buildLocaleHref(locale), - target: '_self', - autoAddBaseUrl: false, - className: locale === currentLocale ? 'dropdown__link--active' : '', - })); useEffect(() => { if (!mobileOpen) return undefined; @@ -186,33 +166,6 @@ export function NavbarNext(): JSX.Element {
{label}
++ {label} +
) : ( <> .menu__list-item > .menu__list-item-collapsible { + position: relative; + > .menu__link--sublist { + font-size: var(--global-font-size-medium, 14px); + font-weight: 400; + color: #1F1F26 !important; + } + /* Active state for a category whose descendant is the current page */ + > .menu__link--sublist.menu__link--active { + font-weight: 400 !important; + color: var(--ifm-color-primary) !important; + background-color: transparent !important; + &:hover { + background-color: #F2F4F7 !important; + } + } + } #menu__group:hover { background-color: white !important; } @@ -30,19 +50,23 @@ } .title_level_1 { - color: #00000a; - text-align: center; - font-size: 14px; + color: #0D0D12; + font-size: 15px; font-style: normal; font-weight: 600; line-height: 20px; - letter-spacing: 0.56px; - text-transform: capitalize; + letter-spacing: 0.4px; display: flex; - padding: 0px 10px 12px 10px; - align-items: center; - gap: 4px; + padding: 20px 10px 12px 10px; + align-items: baseline; + gap: 8px; align-self: stretch; + margin: 0; + } + + .title_level_1__label { + font-weight: 600; + color: #0D0D12; } @media (max-width: 996px) { @@ -64,8 +88,10 @@ .divider { width: calc(100% - 0.625rem); - border: 0.5px solid #DFE5F0; - margin: 1rem 0 1rem 0; + height: 1px; + border: 0; + background-color: #E5E8EE; + margin: 20px 0 4px 0; position: relative; left: 0.625rem; } diff --git a/src/theme/Layout/index.tsx b/src/theme/Layout/index.tsx index 8d10f8762fa5d..2aa123c2558c7 100644 --- a/src/theme/Layout/index.tsx +++ b/src/theme/Layout/index.tsx @@ -18,7 +18,6 @@ import styles from './styles.module.css'; import { useHistory } from '@docusaurus/router'; import { NavbarNext } from '@site/src/components/home-next/NavbarNext'; import { PreviewBanner } from '@site/src/components/home-next/PreviewBanner'; -import { DocsSearchSection } from '@site/src/components/home-next/DocsSearchSection'; import { isDocsNextPath, isReleasesPath, isEventsPath } from '@site/src/utils/locale'; interface DataType { showSearchPageMobile: boolean; @@ -93,7 +92,6 @@ export default function Layout(props: Props): JSX.Element {