--- // 命令面板:动作层(主题/语言/gitea/RSS)+ 导航层 + Pagefind 搜索层 // 由 SearchDialog 薄壳转发而来(挂载点名与 DOM id 保持不变,BaseLayout 无需感知) import { t } from '../i18n/ui'; import { localePath } from '../lib/locale'; import type { Locale } from '../lib/locale'; interface Props { locale?: Locale; } const { locale = 'zh' } = Astro.props; const other: Locale = locale === 'zh' ? 'en' : 'zh'; // 静态站每页渲染时 Astro.url 即本页路径:语言跳转目标构建期算死,运行时零计算 const langHref = localePath(Astro.url.pathname.replace(/\/index\.html$/, ''), other); const rssPath = locale === 'zh' ? '/rss.xml' : '/en/rss.xml'; const prefix = locale === 'zh' ? '' : '/en'; const navItems = [ { href: `${prefix}/`, label: t('nav_home', locale) }, { href: `${prefix}/archives/`, label: t('nav_posts', locale) }, { href: `${prefix}/gallery/`, label: t('nav_gallery', locale) }, { href: `${prefix}/moments/`, label: t('nav_moments', locale) }, { href: `${prefix}/about/`, label: t('nav_about', locale) }, ]; ---

{t('search_hint', locale)}

{t('cmd_hint', locale)}