diff --git a/themes/simple/components/BlogItem.js b/themes/simple/components/BlogItem.js index 65f5b3e5..fe24c21a 100644 --- a/themes/simple/components/BlogItem.js +++ b/themes/simple/components/BlogItem.js @@ -1,82 +1,122 @@ -import Link from 'next/link' -import CONFIG from '../config' -import TwikooCommentCount from '@/components/TwikooCommentCount' -import { formatDateFmt } from '@/lib/utils/formatDate' -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' +import TwikooCommentCount from '@/components/TwikooCommentCount' +import { siteConfig } from '@/lib/config' +import { formatDateFmt } from '@/lib/utils/formatDate' +import Link from 'next/link' +import CONFIG from '../config' 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 showPreview = siteConfig('POST_LIST_PREVIEW') && post.blockMap - return
- {/* 文章标题 */} + return ( +
+ {/* 文章标题 */} -
-
- {/* 图片封面 */} - {showPageCover && ( -
- - - -
- )} +
+
+ {/* 图片封面 */} + {showPageCover && ( +
+ + + +
+ )} +
+ +
+

+ + {siteConfig('POST_TITLE_ICON') && ( + + )} + {post.title} + +

+ + {/* 文章信息 */} +
+
+ + {' '} + + {siteConfig('AUTHOR')} + + + + + {' '} + {post.date?.start_date || post.createdTime} + + + + +
-
+
+ {post.category && ( + + {' '} + + + {post.category} + + + )} + {post?.tags && + post?.tags?.length > 0 && + post?.tags.map(t => ( + + /{t} + + ))} +
+
-

- - {siteConfig('POST_TITLE_ICON') && }{post.title} - -

+
+ {!showPreview && ( + <> + {post.summary} + {post.summary && ...} + + )} + {showPreview && post?.blockMap && ( +
+ +
+
+ )} +
+
+
- {/* 文章信息 */} -
-
- {siteConfig('AUTHOR')} - - - {post.date?.start_date || post.createdTime} - - - -
- -
- {post.category && {post.category}} - {post?.tags && post?.tags?.length > 0 && post?.tags.map(t => /{t})} -
-
- -
- {!showPreview && <> - {post.summary} - {post.summary && ...} - } - {showPreview && post?.blockMap && ( -
- -
-
- )} -
- - -
- -
- - Continue Reading - -
+
+ + Continue Reading{' '} + + +
+ ) } diff --git a/themes/simple/components/MenuItemCollapse.js b/themes/simple/components/MenuItemCollapse.js index 7bd2cc13..50174dc3 100644 --- a/themes/simple/components/MenuItemCollapse.js +++ b/themes/simple/components/MenuItemCollapse.js @@ -33,7 +33,7 @@ export const MenuItemCollapse = props => { onClick={toggleShow}> {!hasSubMenu && ( @@ -72,7 +72,7 @@ export const MenuItemCollapse = props => {
- + {sLink?.icon && ( diff --git a/themes/simple/components/MenuItemDrop.js b/themes/simple/components/MenuItemDrop.js index 316dc0da..7a5bbff8 100644 --- a/themes/simple/components/MenuItemDrop.js +++ b/themes/simple/components/MenuItemDrop.js @@ -15,7 +15,7 @@ export const MenuItemDrop = ({ link }) => { onMouseOut={() => changeShow(false)}> {!hasSubMenu && ( {link?.icon && ( @@ -52,7 +52,7 @@ export const MenuItemDrop = ({ link }) => {
  • - + {sLink?.icon &&   } {sLink.title} diff --git a/themes/simple/components/MenuList.js b/themes/simple/components/MenuList.js index ec9700bf..be13b7b6 100644 --- a/themes/simple/components/MenuList.js +++ b/themes/simple/components/MenuList.js @@ -18,7 +18,7 @@ export const MenuList = ({ customNav, customMenu }) => { const toggleIsOpen = () => { changeIsOpen(!isOpen) } - const closeMenu = (e) => { + const closeMenu = e => { changeIsOpen(false) } const router = useRouter() @@ -29,10 +29,30 @@ export const MenuList = ({ customNav, customMenu }) => { }) let links = [ - { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: siteConfig('SIMPLE_MENU_SEARCH', null, CONFIG) }, - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: siteConfig('SIMPLE_MENU_ARCHIVE', null, CONFIG) }, - { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('SIMPLE_MENU_CATEGORY', null, CONFIG) }, - { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('SIMPLE_MENU_TAG', null, CONFIG) } + { + icon: 'fas fa-search', + name: locale.NAV.SEARCH, + href: '/search', + show: siteConfig('SIMPLE_MENU_SEARCH', null, CONFIG) + }, + { + icon: 'fas fa-archive', + name: locale.NAV.ARCHIVE, + href: '/archive', + show: siteConfig('SIMPLE_MENU_ARCHIVE', null, CONFIG) + }, + { + icon: 'fas fa-folder', + name: locale.COMMON.CATEGORY, + href: '/category', + show: siteConfig('SIMPLE_MENU_CATEGORY', null, CONFIG) + }, + { + icon: 'fas fa-tag', + name: locale.COMMON.TAGS, + href: '/tag', + show: siteConfig('SIMPLE_MENU_TAG', null, CONFIG) + } ] if (customNav) { @@ -48,25 +68,46 @@ export const MenuList = ({ customNav, customMenu }) => { return null } - return (<> - {/* 大屏模式菜单 */} -