- const navbarOptions = { title: siteConfig.site_title, showLeftMenu: true, showRightMenu: true, } const _leftMenu = [ { child: '所有文章', link: '/articles', extra: { class: (currentPath === '/articles' || currentPath === '/articles/' ? 'text-blue-600 font-bold border-b-2 border-blue-600' : 'text-gray-700 hover:text-blue-600 hover:border-b-2 hover:border-blue-400') } }, ] const _rightMenu = !user ? [ { child: '登录', link: '/login' }, ] : [ { child: `欢迎您,${'aaa' || user.name || user.nickname}`, link: '/profile' }, { child: `
`, link: '/notice' }, { child: `退出`, link: '/logout', extra: { 'hx-post': '/logout' } }, ] nav.navbar(class="relative") .placeholder(class="h-[45px] w-full opacity-0") .fixed-container(class="shadow fixed bg-white h-[45px] top-0 left-0 right-0 z-10") .container.clearfix(class="h-full") .navbar-brand a(href="/" class="text-[20px]") #{navbarOptions.title} if navbarOptions.showLeftMenu .left.menu.desktop-only - _leftMenu.forEach(item => { a.menu-item(href=item.link)&attributes(item.extra || {}) != item.child - }) if navbarOptions.showRightMenu .right.menu.desktop-only - _rightMenu.forEach(item => { a.menu-item(href=item.link)&attributes(item.extra || {}) != item.child - })