hexo 主题 菜单风格

This commit is contained in:
tangly1024.com
2024-04-29 10:22:19 +08:00
parent d68a97bc9b
commit a81c1426b5
6 changed files with 111 additions and 40 deletions

View File

@@ -1,17 +1,41 @@
import { useGlobal } from '@/lib/global'
import { siteConfig } from '@/lib/config'
import { MenuItemCollapse } from './MenuItemCollapse'
import { useGlobal } from '@/lib/global'
import CONFIG from '../config'
export const MenuListSide = (props) => {
import { MenuItemCollapse } from './MenuItemCollapse'
/**
* 侧拉抽屉菜单
* @param {*} props
* @returns
*/
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('HEXO_MENU_ARCHIVE', null, CONFIG) },
{ icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: siteConfig('HEXO_MENU_SEARCH', null, CONFIG) },
{ icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('HEXO_MENU_CATEGORY', null, CONFIG) },
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('HEXO_MENU_TAG', null, CONFIG) }
{
icon: 'fas fa-archive',
name: locale.NAV.ARCHIVE,
to: '/archive',
show: siteConfig('HEXO_MENU_ARCHIVE', null, CONFIG)
},
{
icon: 'fas fa-search',
name: locale.NAV.SEARCH,
to: '/search',
show: siteConfig('HEXO_MENU_SEARCH', null, CONFIG)
},
{
icon: 'fas fa-folder',
name: locale.COMMON.CATEGORY,
to: '/category',
show: siteConfig('HEXO_MENU_CATEGORY', null, CONFIG)
},
{
icon: 'fas fa-tag',
name: locale.COMMON.TAGS,
to: '/tag',
show: siteConfig('HEXO_MENU_TAG', null, CONFIG)
}
]
if (customNav) {
@@ -34,8 +58,10 @@ export const MenuListSide = (props) => {
}
return (
<nav>
{links?.map((link, index) => <MenuItemCollapse key={index} link={link} />)}
</nav>
<nav>
{links?.map((link, index) => (
<MenuItemCollapse key={index} link={link} />
))}
</nav>
)
}