--- import { terminalConfig } from '../lib/config/terminal'; import { getI18n, SUPPORTED_LOCALES } from '../lib/i18n'; import type { SiteSettings } from '../lib/types'; interface Props { siteName?: string; siteSettings?: SiteSettings; } const { siteName = Astro.props.siteSettings?.siteShortName || terminalConfig.branding?.shortName || 'Termi' } = Astro.props; const { locale, t, buildLocaleUrl } = getI18n(Astro); const aiEnabled = Boolean(Astro.props.siteSettings?.ai?.enabled); const navItems = [ { icon: 'fa-file-code', text: t('nav.articles'), href: '/articles' }, { icon: 'fa-folder', text: t('nav.categories'), href: '/categories' }, { icon: 'fa-tags', text: t('nav.tags'), href: '/tags' }, { icon: 'fa-stream', text: t('nav.timeline'), href: '/timeline' }, { icon: 'fa-star', text: t('nav.reviews'), href: '/reviews' }, { icon: 'fa-link', text: t('nav.friends'), href: '/friends' }, { icon: 'fa-user-secret', text: t('nav.about'), href: '/about' }, ...(aiEnabled ? [{ icon: 'fa-robot', text: t('nav.ask'), href: '/ask' }] : []), ]; const localeLinks = SUPPORTED_LOCALES.map((item) => ({ locale: item, href: buildLocaleUrl(item), label: t(`common.languages.${item}`), shortLabel: item === 'zh-CN' ? '中' : 'EN', })); const currentPath = Astro.url.pathname; ---
root@termi {siteName}