From 418dc38de6c1e4ef93a461d39cdc1a651c9ca8df Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 31 Mar 2022 11:30:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Hexo:=20=E8=83=8C=E6=99=AF=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/hexo/components/ArticleRecommend.js | 4 ++-- themes/hexo/components/HeaderArticle.js | 5 ++--- themes/hexo/components/LatestPostsGroup.js | 4 ++-- themes/hexo/components/SideRight.js | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/themes/hexo/components/ArticleRecommend.js b/themes/hexo/components/ArticleRecommend.js index 0640a38e..8719be05 100644 --- a/themes/hexo/components/ArticleRecommend.js +++ b/themes/hexo/components/ArticleRecommend.js @@ -8,7 +8,7 @@ import { useGlobal } from '@/lib/global' * @param {prev,next} param0 * @returns */ -export default function ArticleRecommend ({ recommendPosts }) { +export default function ArticleRecommend ({ recommendPosts, siteInfo }) { if (!CONFIG_HEXO.ARTICLE_RECOMMEND || !recommendPosts || recommendPosts.length === 0) { return <> } @@ -25,7 +25,7 @@ export default function ArticleRecommend ({ recommendPosts }) { {recommendPosts.map(post => { const headerImage = post?.page_cover ? `url("${post.page_cover}")` - : `url("/${BLOG.HOME_BANNER_IMAGE}")` + : `url("${siteInfo?.pageCover}")` return ( diff --git a/themes/hexo/components/HeaderArticle.js b/themes/hexo/components/HeaderArticle.js index 36530fd6..3a470394 100644 --- a/themes/hexo/components/HeaderArticle.js +++ b/themes/hexo/components/HeaderArticle.js @@ -2,10 +2,9 @@ import Link from 'next/link' import { useGlobal } from '@/lib/global' import formatDate from '@/lib/formatDate' import { useEffect } from 'react' -import BLOG from '@/blog.config' -export default function HeaderArticle ({ post }) { - const headerImage = post?.page_cover ? `url("${post.page_cover}")` : `url("/${BLOG.HOME_BANNER_IMAGE}")` +export default function HeaderArticle ({ post, siteInfo }) { + const headerImage = post?.page_cover ? `url("${post.page_cover}")` : `url("${siteInfo?.pageCover}")` const { isDarkMode } = useGlobal() const { locale } = useGlobal() diff --git a/themes/hexo/components/LatestPostsGroup.js b/themes/hexo/components/LatestPostsGroup.js index dc4a993d..d3a4c51d 100644 --- a/themes/hexo/components/LatestPostsGroup.js +++ b/themes/hexo/components/LatestPostsGroup.js @@ -9,7 +9,7 @@ import { useRouter } from 'next/router' * @param sliceCount 截取展示的数量 默认6 * @constructor */ -const LatestPostsGroup = ({ posts }) => { +const LatestPostsGroup = ({ posts, siteInfo }) => { if (!posts) { return <> } @@ -29,7 +29,7 @@ const LatestPostsGroup = ({ posts }) => { const selected = currentPath === `${BLOG.PATH}/article/${post.slug}` const headerImage = post?.page_cover ? `url("${post.page_cover}")` - : `url("/${BLOG.HOME_BANNER_IMAGE}")` + : `url("${siteInfo?.pageCover}")` return ( )} {CONFIG_HEXO.WIDGET_LATEST_POSTS && latestPosts && latestPosts.length > 0 && - + }
From 0ff13b715889f06d4d5aef0b34055fd9b9299d64 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 31 Mar 2022 11:41:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Footer=20=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/example/LayoutBase.js | 30 ++++++++++---------------- themes/fukasawa/components/SiteInfo.js | 4 ++-- themes/hexo/components/Footer.js | 9 ++++---- themes/medium/components/Footer.js | 7 +++--- themes/next/components/Footer.js | 9 ++++---- 5 files changed, 24 insertions(+), 35 deletions(-) diff --git a/themes/example/LayoutBase.js b/themes/example/LayoutBase.js index 36c92cd1..96f635a6 100644 --- a/themes/example/LayoutBase.js +++ b/themes/example/LayoutBase.js @@ -82,29 +82,11 @@ const LayoutBase = props => { {' '} {BLOG.AUTHOR} . -
- - Powered by{' '} - - Notion - {' '} - &{' '} - - NotionNext {BLOG.VERSION} - - . - {BLOG.BEI_AN && ( <> @@ -127,6 +109,16 @@ const LayoutBase = props => {

{meta?.title || siteInfo.title}

+ + Powered by{' '} + + NotionNext {BLOG.VERSION} + + . +
) diff --git a/themes/fukasawa/components/SiteInfo.js b/themes/fukasawa/components/SiteInfo.js index 453ec099..fa342c0d 100644 --- a/themes/fukasawa/components/SiteInfo.js +++ b/themes/fukasawa/components/SiteInfo.js @@ -8,14 +8,14 @@ function SiteInfo ({ title }) { ) diff --git a/themes/hexo/components/Footer.js b/themes/hexo/components/Footer.js index 44a19a55..1a30536f 100644 --- a/themes/hexo/components/Footer.js +++ b/themes/hexo/components/Footer.js @@ -9,19 +9,18 @@ const Footer = ({ title }) => { ) } diff --git a/themes/medium/components/Footer.js b/themes/medium/components/Footer.js index 89cf7f47..d6ae7491 100644 --- a/themes/medium/components/Footer.js +++ b/themes/medium/components/Footer.js @@ -9,18 +9,17 @@ const Footer = ({ title }) => { ) } diff --git a/themes/next/components/Footer.js b/themes/next/components/Footer.js index 74956e37..8247f344 100644 --- a/themes/next/components/Footer.js +++ b/themes/next/components/Footer.js @@ -7,20 +7,19 @@ const Footer = ({ title }) => { const startYear = BLOG.SINCE && BLOG.SINCE !== currentYear && BLOG.SINCE + '-' return ( ) }