From a0a45d2512f3c300198df02ee59ebeb05f2ce019 Mon Sep 17 00:00:00 2001 From: emengweb Date: Mon, 24 Apr 2023 10:29:17 +0000 Subject: [PATCH 01/17] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E4=BE=A7=E8=BE=B9=E6=A0=8F=E5=A2=9E=E5=8A=A0=E5=85=AC?= =?UTF-8?q?=E5=91=8A=E6=A0=8F=EF=BC=8C=E6=96=87=E7=AB=A0=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/fukasawa/LayoutTag.js | 1 + themes/fukasawa/LayoutTagIndex.js | 15 +++++++---- themes/fukasawa/components/Announcement.js | 21 ++++++++++++++++ themes/fukasawa/components/ArticleDetail.js | 17 ++++++++----- themes/fukasawa/components/AsideLeft.js | 28 +++++++++++++-------- themes/fukasawa/components/BlogCard.js | 24 +++++++++++++++++- 6 files changed, 83 insertions(+), 23 deletions(-) create mode 100755 themes/fukasawa/components/Announcement.js diff --git a/themes/fukasawa/LayoutTag.js b/themes/fukasawa/LayoutTag.js index 3a546fad..46e9e0fd 100644 --- a/themes/fukasawa/LayoutTag.js +++ b/themes/fukasawa/LayoutTag.js @@ -1,6 +1,7 @@ import BLOG from '@/blog.config' import BlogListPage from './components/BlogListPage' import BlogListScroll from './components/BlogListScroll' +import TagItemMini from './components/TagItemMini' import LayoutBase from './LayoutBase' export const LayoutTag = (props) => { diff --git a/themes/fukasawa/LayoutTagIndex.js b/themes/fukasawa/LayoutTagIndex.js index eb1d690b..df43fdeb 100644 --- a/themes/fukasawa/LayoutTagIndex.js +++ b/themes/fukasawa/LayoutTagIndex.js @@ -1,5 +1,6 @@ import { useGlobal } from '@/lib/global' import TagItem from './components/TagItem' +import TagItemMini from './components/TagItemMini' import LayoutBase from './LayoutBase' export const LayoutTagIndex = (props) => { @@ -8,11 +9,15 @@ export const LayoutTagIndex = (props) => { return
{locale.COMMON.TAGS}:
-
- { tagOptions.map(tag => { - return
- }) } -
+
+ {tagOptions.map(tag => { + return ( +
+ +
+ ) + })} +
} diff --git a/themes/fukasawa/components/Announcement.js b/themes/fukasawa/components/Announcement.js new file mode 100755 index 00000000..dbc24db0 --- /dev/null +++ b/themes/fukasawa/components/Announcement.js @@ -0,0 +1,21 @@ +import { useGlobal } from '@/lib/global' +import dynamic from 'next/dynamic' + +const NotionPage = dynamic(() => import('@/components/NotionPage')) + +const Announcement = ({ post, className }) => { + const { locale } = useGlobal() + if (post?.blockMap) { + return
+
+
{locale.COMMON.ANNOUNCEMENT}
+ {post && (
+ +
)} +
+
+ } else { + return <> + } +} +export default Announcement diff --git a/themes/fukasawa/components/ArticleDetail.js b/themes/fukasawa/components/ArticleDetail.js index 65af8400..96a35161 100644 --- a/themes/fukasawa/components/ArticleDetail.js +++ b/themes/fukasawa/components/ArticleDetail.js @@ -1,3 +1,4 @@ +import TagItemMini from './TagItemMini' import Comment from '@/components/Comment' import NotionPage from '@/components/NotionPage' import formatDate from '@/lib/formatDate' @@ -33,7 +34,7 @@ export default function ArticleDetail(props) {
{/* 文章Title */} -
+
{post.title}
@@ -68,11 +69,15 @@ export default function ArticleDetail(props) { )} -
- -   - -
+
+ {post.tagItems && ( +
+ {post.tagItems.map(tag => ( + + ))} +
+ )} +
diff --git a/themes/fukasawa/components/AsideLeft.js b/themes/fukasawa/components/AsideLeft.js index ef67cc44..0f929bae 100644 --- a/themes/fukasawa/components/AsideLeft.js +++ b/themes/fukasawa/components/AsideLeft.js @@ -5,42 +5,48 @@ import GroupTag from './GroupTag' import SearchInput from './SearchInput' import SiteInfo from './SiteInfo' import Catalog from './Catalog' +import Announcement from './Announcement' import { useRouter } from 'next/router' import DarkModeButton from '@/components/DarkModeButton' function AsideLeft (props) { - const { tagOptions, currentTag, categoryOptions, currentCategory, post, slot, siteInfo } = props + const { tagOptions, currentTag, categoryOptions, currentCategory, post, slot, siteInfo, notice } = props const router = useRouter() - return
+ return
+ +
+ { siteInfo?.description } +
-
+
-
+
-
-
- { siteInfo?.description } -
+
+
+ +
+ {router.asPath !== '/tag' &&
-
+
} {router.asPath !== '/category' &&
-
+
}
-
+
diff --git a/themes/fukasawa/components/BlogCard.js b/themes/fukasawa/components/BlogCard.js index 1d382cf7..86c4ea7f 100644 --- a/themes/fukasawa/components/BlogCard.js +++ b/themes/fukasawa/components/BlogCard.js @@ -1,5 +1,6 @@ import BLOG from '@/blog.config' import Link from 'next/link' +import TagItemMini from './TagItemMini' import React from 'react' import CONFIG_FUKA from '../config_fuka' @@ -28,10 +29,31 @@ const BlogCard = ({ index, post, showSummary, siteInfo }) => { {(!showPreview || showSummary) && ( -

+

{post.summary}

)} + + {/* 分类标签 */} +
+ + + + {post.category} + + +
+
+ {' '} + {post.tagItems.map(tag => ( + + ))} +
+
+
{showPageCover && ( From 67072250d8a4c947856faea6ec57551af6e5c3ed Mon Sep 17 00:00:00 2001 From: emengweb Date: Mon, 24 Apr 2023 10:48:44 +0000 Subject: [PATCH 02/17] =?UTF-8?q?=E4=BC=98=E5=8C=96tag=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/matery/LayoutTag.js | 1 + themes/matery/LayoutTagIndex.js | 1 + 2 files changed, 2 insertions(+) diff --git a/themes/matery/LayoutTag.js b/themes/matery/LayoutTag.js index 3572d019..4f0ac66b 100644 --- a/themes/matery/LayoutTag.js +++ b/themes/matery/LayoutTag.js @@ -6,6 +6,7 @@ import React from 'react' import HeaderArticle from './components/HeaderArticle' import { useGlobal } from '@/lib/global' import TagItemMiddle from './components/TagItemMiddle' +import TagItemMini from './components/TagItemMini' export const LayoutTag = (props) => { const { tagOptions, tag } = props diff --git a/themes/matery/LayoutTagIndex.js b/themes/matery/LayoutTagIndex.js index bfcb41b1..d1d19835 100644 --- a/themes/matery/LayoutTagIndex.js +++ b/themes/matery/LayoutTagIndex.js @@ -1,6 +1,7 @@ import { useGlobal } from '@/lib/global' import HeaderArticle from './components/HeaderArticle' import TagItemMiddle from './components/TagItemMiddle' +import TagItemMini from './components/TagItemMini' import LayoutBase from './LayoutBase' export const LayoutTagIndex = props => { From 84fe9e5e633aba4deab48de07608be27d981bb38 Mon Sep 17 00:00:00 2001 From: emengweb Date: Mon, 24 Apr 2023 10:51:56 +0000 Subject: [PATCH 03/17] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=BB=E9=A2=98hexo?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=87=A0=E5=A4=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E5=8C=85=E6=8B=AC=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=88=86=E7=B1=BB=E6=8C=89=E9=92=AE=E5=B0=BA=E5=AF=B8?= =?UTF-8?q?=E8=BF=87=E5=B0=8F=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=A4=9A=E5=87=BAhr=E5=88=86=E5=89=B2=E7=BA=BF?= =?UTF-8?q?=E7=BE=8E=E5=8C=96=E6=9A=97=E8=89=B2=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E6=95=88=E6=9E=9C=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/hexo/LayoutSlug.js | 2 +- themes/hexo/components/Announcement.js | 2 +- themes/hexo/components/ArticleAdjacent.js | 2 +- themes/hexo/components/ArticleCopyright.js | 2 +- themes/hexo/components/ArticleRecommend.js | 4 ++-- themes/hexo/components/Footer.js | 5 ++--- themes/hexo/components/Header.js | 11 ++++++----- themes/hexo/components/HeaderArticle.js | 20 ++++++++++++++++---- themes/hexo/components/InfoCard.js | 4 ++-- themes/hexo/components/Logo.js | 2 +- themes/hexo/components/NavButtonGroup.js | 4 ++-- themes/hexo/components/SideBar.js | 1 - themes/hexo/config_hexo.js | 4 ++-- 13 files changed, 37 insertions(+), 26 deletions(-) diff --git a/themes/hexo/LayoutSlug.js b/themes/hexo/LayoutSlug.js index b47478e8..17850e55 100644 --- a/themes/hexo/LayoutSlug.js +++ b/themes/hexo/LayoutSlug.js @@ -74,7 +74,7 @@ export const LayoutSlug = props => { -
+
{/* 评论互动 */}
diff --git a/themes/hexo/components/Announcement.js b/themes/hexo/components/Announcement.js index 677cb467..02270982 100644 --- a/themes/hexo/components/Announcement.js +++ b/themes/hexo/components/Announcement.js @@ -10,7 +10,7 @@ const Announcement = ({ post, className }) => {
{locale.COMMON.ANNOUNCEMENT}
{post && (
- +
)}
diff --git a/themes/hexo/components/ArticleAdjacent.js b/themes/hexo/components/ArticleAdjacent.js index 6e1face7..3f4a929a 100644 --- a/themes/hexo/components/ArticleAdjacent.js +++ b/themes/hexo/components/ArticleAdjacent.js @@ -11,7 +11,7 @@ export default function ArticleAdjacent ({ prev, next }) { return <> } return ( -
+
  • {locale.COMMON.URL}: - + {path}
  • diff --git a/themes/hexo/components/ArticleRecommend.js b/themes/hexo/components/ArticleRecommend.js index 30373f67..d2354cd3 100644 --- a/themes/hexo/components/ArticleRecommend.js +++ b/themes/hexo/components/ArticleRecommend.js @@ -30,8 +30,8 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
    {recommendPosts.map(post => { const headerImage = post?.page_cover - ? `url("${post.page_cover}")` - : `url("${siteInfo?.pageCover}")` + ? `url("${post.page_cover}&w=240")` + : `url("${siteInfo?.pageCover}&w=240")` return ( ( { -
    -

    {title}

    - Powered by NotionNext {BLOG.VERSION}.
    +

    {title} | {BLOG.BIO}

    +

    Powered by NotionNext {BLOG.VERSION}.


    ) diff --git a/themes/hexo/components/Header.js b/themes/hexo/components/Header.js index 60edd4e8..db656c31 100644 --- a/themes/hexo/components/Header.js +++ b/themes/hexo/components/Header.js @@ -7,7 +7,7 @@ import throttle from 'lodash.throttle' let wrapperTop = 0 let windowTop = 0 -let autoScroll = false +let autoScroll = true const enableAutoScroll = false // 是否开启自动吸附滚动 /** @@ -85,12 +85,12 @@ const Header = props => { return ( ) diff --git a/themes/hexo/components/HeaderArticle.js b/themes/hexo/components/HeaderArticle.js index 2abfc9b7..8c0f2a0e 100644 --- a/themes/hexo/components/HeaderArticle.js +++ b/themes/hexo/components/HeaderArticle.js @@ -1,4 +1,5 @@ import Link from 'next/link' +import TagItemMini from './TagItemMini' import { useGlobal } from '@/lib/global' import formatDate from '@/lib/formatDate' import BLOG from '@/blog.config' @@ -9,7 +10,7 @@ export default function HeaderArticle({ post, siteInfo }) { if (!post) { return <> } - const headerImage = post?.page_cover ? `url("${post.page_cover}")` : `url("${siteInfo?.pageCover}")` + const headerImage = post?.page_cover ? `url("${post.page_cover}&w=1600")` : `url("${siteInfo?.pageCover}&w=1600")` const date = formatDate( post?.date?.start_date || post?.createdTime, @@ -31,11 +32,11 @@ export default function HeaderArticle({ post, siteInfo }) {
    {/* 文章Title */} -
    +
    {post.title}
    -
    +
    {post.category && <> @@ -46,7 +47,7 @@ export default function HeaderArticle({ post, siteInfo }) { }
    -
    +
    {post?.type !== 'Page' && ( <>
    + {BLOG.ANALYTICS_BUSUANZI_ENABLE &&
    {locale.COMMON.VIEWS}
    }
    + +
    + {post.tagItems && ( +
    + {post.tagItems.map(tag => ( + + ))} +
    + )} +
    diff --git a/themes/hexo/components/InfoCard.js b/themes/hexo/components/InfoCard.js index 1393211a..3a978d68 100644 --- a/themes/hexo/components/InfoCard.js +++ b/themes/hexo/components/InfoCard.js @@ -8,7 +8,7 @@ export function InfoCard (props) { const router = useRouter() return
    { router.push('/') }} @@ -16,7 +16,7 @@ export function InfoCard (props) { {/* eslint-disable-next-line @next/next/no-img-element */} {BLOG.AUTHOR}/
    -
    {BLOG.AUTHOR}
    +
    {BLOG.AUTHOR}
    {BLOG.BIO}
    diff --git a/themes/hexo/components/Logo.js b/themes/hexo/components/Logo.js index 61408026..de407279 100644 --- a/themes/hexo/components/Logo.js +++ b/themes/hexo/components/Logo.js @@ -7,7 +7,7 @@ const Logo = props => { return (
    -
    {siteInfo?.title || BLOG.TITLE}
    +
    {siteInfo?.title || BLOG.TITLE}
    ); diff --git a/themes/hexo/components/NavButtonGroup.js b/themes/hexo/components/NavButtonGroup.js index f1ca4297..d32a25f1 100644 --- a/themes/hexo/components/NavButtonGroup.js +++ b/themes/hexo/components/NavButtonGroup.js @@ -14,7 +14,7 @@ const NavButtonGroup = (props) => { } return ( -