Skip to content

Commit

Permalink
little fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Jan 30, 2024
1 parent 6d600ec commit c7324c2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion themes/nav/components/BlogPostCard.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import Link from 'next/link'
import NotionIcon from './NotionIcon'
import { useRouter } from 'next/router'
import { siteConfig } from '@/lib/config'

const BlogPostCard = ({ post, className }) => {
const router = useRouter()
const currentSelected = router.asPath.split('?')[0] === '/' + post.slug
let pageIcon = post.pageIcon !== '' ? post.pageIcon : BLOG.IMG_LAZY_LOAD_PLACEHOLDER
let pageIcon = post.pageIcon !== '' ? post.pageIcon : siteConfig('IMG_LAZY_LOAD_PLACEHOLDER')
pageIcon = post.pageIcon.indexOf('amazonaws.com') !== -1 ? post.pageIcon + '&width=88' : post.pageIcon
return (
<Link href={`${removeHttp(post.slug)}`} target={(checkRemoveHttp(post.slug) ? '_blank' : '_self')} passHref>
Expand Down
1 change: 1 addition & 0 deletions themes/nav/components/MenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const MenuItem = ({ link }) => {
<Collapse isOpen={isOpen} key='collapse'>
{
link?.subMenus?.map((sLink, index) => {
// #号加标题 快速跳转到指定锚点
const sUrl = sLink?.to && sLink?.to.length > 0 ? sLink.to : '#' + sLink?.title
return <div key={index} className='nav-submenu'>
<Link href={sUrl}>
Expand Down
3 changes: 1 addition & 2 deletions themes/nav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ import BlogPostListAll from './components/BlogPostListAll'
import BlogPostCard from './components/BlogPostCard'
import Link from 'next/link'
import dynamic from 'next/dynamic'

import { MenuItem } from './components/MenuItem'
import LogoBar from './components/LogoBar'

import { siteConfig } from '@/lib/config'

const WWAds = dynamic(() => import('@/components/WWAds'), { ssr: false })

// 主题全局变量
Expand Down

0 comments on commit c7324c2

Please sign in to comment.