slug 调整兼容已有主题

This commit is contained in:
tangly1024.com
2024-05-08 16:22:14 +08:00
parent 65eff434ec
commit 9b78eb499c
56 changed files with 1318 additions and 826 deletions

View File

@@ -1,18 +1,36 @@
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import CONFIG from '../config'
import { siteConfig } from '@/lib/config'
import { MenuItemDrop } from './MenuItemDrop'
export const MenuListTop = (props) => {
export const MenuListTop = props => {
const { customNav, customMenu } = props
const { locale } = useGlobal()
let links = [
{ id: 1, icon: 'fa-solid fa-house', name: locale.NAV.INDEX, to: '/', show: siteConfig('HEXO_MENU_INDEX', null, CONFIG) },
{ id: 2, icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: siteConfig('HEXO_MENU_SEARCH', null, CONFIG) },
{ id: 3, icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: siteConfig('HEXO_MENU_ARCHIVE', null, CONFIG) }
// { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('MENU_CATEGORY', null, CONFIG) },
// { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('MENU_TAG', null, CONFIG) }
{
id: 1,
icon: 'fa-solid fa-house',
name: locale.NAV.INDEX,
href: '/',
show: siteConfig('HEXO_MENU_INDEX', null, CONFIG)
},
{
id: 2,
icon: 'fas fa-search',
name: locale.NAV.SEARCH,
href: '/search',
show: siteConfig('HEXO_MENU_SEARCH', null, CONFIG)
},
{
id: 3,
icon: 'fas fa-archive',
name: locale.NAV.ARCHIVE,
href: '/archive',
show: siteConfig('HEXO_MENU_ARCHIVE', null, CONFIG)
}
// { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, href: '/category', show: siteConfig('MENU_CATEGORY', null, CONFIG) },
// { icon: 'fas fa-tag', name: locale.COMMON.TAGS, href: '/tag', show: siteConfig('MENU_TAG', null, CONFIG) }
]
if (customNav) {
@@ -34,9 +52,16 @@ export const MenuListTop = (props) => {
return null
}
return (<>
<nav id='nav-mobile' className='leading-8 justify-center font-light w-full flex'>
{links?.map((link, index) => link && link.show && <MenuItemDrop key={index} link={link} />)}
</nav>
</>)
return (
<>
<nav
id='nav-mobile'
className='leading-8 justify-center font-light w-full flex'>
{links?.map(
(link, index) =>
link && link.show && <MenuItemDrop key={index} link={link} />
)}
</nav>
</>
)
}