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,17 +1,37 @@
import { useGlobal } from '@/lib/global'
import { siteConfig } from '@/lib/config'
import { MenuItemCollapse } from './MenuItemCollapse'
import { useGlobal } from '@/lib/global'
import CONFIG from '../config'
import { MenuItemCollapse } from './MenuItemCollapse'
export const MenuListSide = (props) => {
export const MenuListSide = props => {
const { customNav, customMenu } = props
const { locale } = useGlobal()
let links = [
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: siteConfig('HEO_MENU_ARCHIVE', null, CONFIG) },
{ icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: siteConfig('HEO_MENU_SEARCH', null, CONFIG) },
{ icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('HEO_MENU_CATEGORY', null, CONFIG) },
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('HEO_MENU_TAG', null, CONFIG) }
{
icon: 'fas fa-archive',
name: locale.NAV.ARCHIVE,
href: '/archive',
show: siteConfig('HEO_MENU_ARCHIVE', null, CONFIG)
},
{
icon: 'fas fa-search',
name: locale.NAV.SEARCH,
href: '/search',
show: siteConfig('HEO_MENU_SEARCH', null, CONFIG)
},
{
icon: 'fas fa-folder',
name: locale.COMMON.CATEGORY,
href: '/category',
show: siteConfig('HEO_MENU_CATEGORY', null, CONFIG)
},
{
icon: 'fas fa-tag',
name: locale.COMMON.TAGS,
href: '/tag',
show: siteConfig('HEO_MENU_TAG', null, CONFIG)
}
]
if (customNav) {
@@ -28,8 +48,10 @@ export const MenuListSide = (props) => {
}
return (
<nav className='flex-col space-y-2'>
{links?.map((link, index) => <MenuItemCollapse key={index} link={link} />)}
</nav>
<nav className='flex-col space-y-2'>
{links?.map((link, index) => (
<MenuItemCollapse key={index} link={link} />
))}
</nav>
)
}