This commit is contained in:
tangly1024.com
2024-02-04 11:59:48 +08:00
2 changed files with 3 additions and 3 deletions

View File

@@ -142,7 +142,7 @@ function getCustomNav({ allPages }) {
* @returns
*/
function getCustomMenu({ collectionData }) {
const menuPages = collectionData.filter(post => (post?.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post?.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu) && post.status === 'Published')
const menuPages = collectionData.filter(post => post.status === 'Published' && (post?.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post?.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu))
const menus = []
if (menuPages && menuPages.length > 0) {
menuPages.forEach(e => {

View File

@@ -22,7 +22,7 @@ export const MenuItem = ({ link }) => {
// #号加标题 快速跳转到指定锚点
const isAnchor = link?.to === '#'
const url = isAnchor ? link.to : `#${link.name}`
const url = isAnchor ? `#${link.name}` : link.to
return <>
{/* 菜单 */}
@@ -33,7 +33,7 @@ export const MenuItem = ({ link }) => {
{link?.subMenus
? (<>
<span className='dark:text-neutral-400 dark:hover:text-white font-bold w-full display-block'>
<i className={`text-base ${link?.icon ? link?.icon : (isAnchor ? 'fas fa-hashtag' : '')} mr-1`} />{link?.title}
<i className={`text-base ${link?.icon ? link?.icon : ''} mr-1`} />{link?.title}
</span>
<div className='inline-flex items-center select-none pointer-events-none '>
<i className={`${isOpen ? '-rotate-90' : ''} text-xs dark:text-neutral-500 text-gray-300 hover:text-black dark:hover:text-white-400 px-2 fas fa-chevron-left transition-all duration-200`}></i>