import React from 'react' import { useGlobal } from '@/lib/global' import CONFIG_HEXO from '../config_hexo' import BLOG from '@/blog.config' import { MenuItemDrop } from './MenuItemDrop' const MenuList = (props) => { const { postCount, customNav, customMenu } = props const { locale } = useGlobal() const archiveSlot =
{postCount}
let links = [ { icon: 'fas fa-home', name: locale.NAV.INDEX, to: '/' || '/', show: true }, { icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_HEXO.MENU_CATEGORY }, { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_HEXO.MENU_TAG }, { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', slot: archiveSlot, show: CONFIG_HEXO.MENU_ARCHIVE }, { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_HEXO.MENU_SEARCH } ] if (customNav) { links = links.concat(customNav) } // 如果 开启自定义菜单,则覆盖Page生成的菜单 if (BLOG.CUSTOM_MENU) { links = customMenu } return ( ) } export default MenuList