Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Apr 13, 2024
2 parents 496732e + c91a2e0 commit 69617e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lib/db/getSiteData.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getPostBlocks, getSingleBlock } from '@/lib/notion/getPostBlocks'
import { compressImage, mapImgUrl } from '@/lib/notion/mapImage'
import { deepClone } from '@/lib/utils'
import { idToUuid } from 'notion-utils'
import { siteConfig } from '../config'
import { extractLangId, extractLangPrefix } from '../utils/pageId'

export { getAllTags } from '../notion/getAllTags'
Expand Down Expand Up @@ -181,7 +182,7 @@ function getCustomNav({ allPages }) {
* @param {*} allPages
* @returns
*/
function getCustomMenu({ collectionData }) {
function getCustomMenu({ collectionData, NOTION_CONFIG }) {
const menuPages = collectionData.filter(
post =>
post.status === 'Published' &&
Expand All @@ -192,7 +193,10 @@ function getCustomMenu({ collectionData }) {
if (menuPages && menuPages.length > 0) {
menuPages.forEach(e => {
e.show = true
if (e?.slug?.indexOf('http') === 0 && e?.slug?.indexOf(BLOG.LINK) < 0) {
if (
e?.slug?.indexOf('http') === 0 &&
e?.slug?.indexOf(siteConfig('LINK', BLOG.LINK, NOTION_CONFIG)) < 0
) {
e.target = '_blank'
e.to = e.slug
} else {
Expand Down Expand Up @@ -508,7 +512,7 @@ async function getDataBaseInfoByNotionAPI({ pageId, from }) {
)
})
// 新的菜单
const customMenu = await getCustomMenu({ collectionData })
const customMenu = await getCustomMenu({ collectionData, NOTION_CONFIG })
const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 6 })
const allNavPages = getNavPages({ allPages })

Expand Down
2 changes: 1 addition & 1 deletion themes/game/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function Header(props) {
const { setSideBarVisible } = useGameGlobal()
return (
<header className='z-20'>
<div className='w-full h-16 rounded-md bg-white shadow-md hover:shadow-xl transition-shadow duration-200 dark:bg-[#1F2030] flex justify-between items-center px-4'>
<div className='w-full py-2 rounded-md bg-white shadow-md hover:shadow-xl transition-shadow duration-200 dark:bg-[#1F2030] flex justify-between items-center px-4'>
<Logo siteInfo={siteInfo} />

<button
Expand Down

0 comments on commit 69617e8

Please sign in to comment.