mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 23:16:47 +00:00
Merge branch 'main' of https://github.com/tangly1024/NotionNext
This commit is contained in:
@@ -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 => {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user