theme-simple

This commit is contained in:
tangly1024.com
2024-03-11 12:54:42 +08:00
parent c4382e7b8e
commit c6e0b6cf78
3 changed files with 22 additions and 11 deletions

View File

@@ -6,13 +6,15 @@ import { siteConfig } from '@/lib/config'
import LazyImage from '@/components/LazyImage'
import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils'
import NotionIcon from '@/components/NotionIcon'
import NotionPage from '@/components/NotionPage'
export const BlogItem = props => {
const { post } = props
const showPageCover = siteConfig('SIMPLE_POST_COVER_ENABLE', false, CONFIG)
const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}`
const { post } = props
const showPageCover = siteConfig('SIMPLE_POST_COVER_ENABLE', false, CONFIG)
const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}`
const showPreview = siteConfig('POST_LIST_PREVIEW') && post.blockMap
return <div key={post.id} className="h-42 my-6 pb-12 border-b dark:border-gray-800" >
return <div key={post.id} className="h-42 my-6 pb-12 border-b dark:border-gray-800" >
{/* 文章标题 */}
<div className='flex'>
@@ -56,9 +58,18 @@ export const BlogItem = props => {
</header>
<main className="text-gray-700 dark:text-gray-300 leading-normal mb-6">
{post.summary}
{post.summary && <span>...</span>}
{!showPreview && <>
{post.summary}
{post.summary && <span>...</span>}
</>}
{showPreview && post?.blockMap && (
<div className="overflow-ellipsis truncate">
<NotionPage post={post} />
<hr className='border-dashed py-4' />
</div>
)}
</main>
</article>
</div>

View File

@@ -44,9 +44,9 @@ export const MenuItemCollapse = (props) => {
{/* 折叠子菜单 */}
{hasSubMenu && <Collapse isOpen={isOpen} onHeightChange={props.onHeightChange}>
{link.subMenus.map((sLink, index) => {
return <div key={index} className='font-extralight dark:bg-black text-left px-10 justify-start text-blue-400 bg-gray-50 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 border-b dark:border-gray-800 py-3 pr-6'>
return <div key={index} className='dark:bg-black text-left px-10 justify-start text-blue-600 dark:text-blue-300 bg-gray-50 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 border-b dark:border-gray-800 py-3 pr-6'>
<Link href={sLink.to} target={link?.to?.indexOf('http') === 0 ? '_blank' : '_self'}>
<span className='ml-4 text-xs'>{sLink?.icon && <span className='mr-2 w-4'><i className={sLink.icon}/></span>}{sLink.title}</span>
<span className='ml-4 text-sm'>{sLink?.icon && <span className='mr-2 w-4'><i className={sLink.icon}/></span>}{sLink.title}</span>
</Link>
</div>
})}

View File

@@ -16,7 +16,7 @@ export const MenuItemDrop = ({ link }) => {
href={link?.to} target={link?.to?.indexOf('http') === 0 ? '_blank' : '_self'}
className=" menu-link pl-2 pr-4 text-gray-700 dark:text-gray-200 no-underline tracking-widest pb-1">
{link?.icon && <span className='mr-2'><i className={link.icon} /></span>}{link?.name}
{hasSubMenu && <i className='px-2 fa fa-angle-down'></i>}
{hasSubMenu && <i className='px-2 fa fa-angle-down'></i>}
</Link>}
{hasSubMenu && <>
@@ -29,9 +29,9 @@ export const MenuItemDrop = ({ link }) => {
{/* 子菜单 */}
{hasSubMenu && <ul className={`${show ? 'visible opacity-100 top-12' : 'invisible opacity-0 top-10'} border-gray-100 bg-white dark:bg-black dark:border-gray-800 transition-all duration-300 z-20 absolute block drop-shadow-lg `}>
{link.subMenus.map((sLink, index) => {
return <li key={index} className='not:last-child:border-b-0 border-b text-blue-500 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 dark:border-gray-800 py-3 pr-6 pl-2'>
return <li key={index} className='not:last-child:border-b-0 border-b text-blue-600 dark:text-blue-300 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 dark:border-gray-800 py-3 pr-6 pl-2'>
<Link href={sLink.to} target={link?.to?.indexOf('http') === 0 ? '_blank' : '_self'}>
<span className='text-sm text-nowrap font-extralight'>{sLink?.icon && <i className={sLink?.icon} > &nbsp; </i>}{sLink.title}</span>
<span className='text-sm text-nowrap'>{sLink?.icon && <i className={sLink?.icon} > &nbsp; </i>}{sLink.title}</span>
</Link>
</li>
})}