From 0edc6405afe76d7e3586905cb05f434fe326cd63 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 25 Dec 2022 16:18:36 +0800 Subject: [PATCH] matery --- components/ThemeSwitch.js | 4 ++-- themes/hexo/components/FloatDarkModeButton.js | 3 ++- themes/matery/LayoutBase.js | 2 +- themes/matery/LayoutSlug.js | 4 +++- themes/matery/components/BlogPostCard.js | 9 ++++----- themes/matery/components/FloatDarkModeButton.js | 11 ++++------- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/components/ThemeSwitch.js b/components/ThemeSwitch.js index af14904d..9ec3394d 100644 --- a/components/ThemeSwitch.js +++ b/components/ThemeSwitch.js @@ -13,8 +13,8 @@ export function ThemeSwitch() {
-
{theme} -
+
{theme}
+
diff --git a/themes/hexo/components/FloatDarkModeButton.js b/themes/hexo/components/FloatDarkModeButton.js index b6122ba9..c23f32bd 100644 --- a/themes/hexo/components/FloatDarkModeButton.js +++ b/themes/hexo/components/FloatDarkModeButton.js @@ -3,11 +3,12 @@ import { saveDarkModeToCookies } from '@/lib/theme' import CONFIG_HEXO from '../config_hexo' export default function FloatDarkModeButton () { + const { isDarkMode, updateDarkMode } = useGlobal() + if (!CONFIG_HEXO.WIDGET_DARK_MODE) { return <> } - const { isDarkMode, updateDarkMode } = useGlobal() // 用户手动设置主题 const handleChangeDarkMode = () => { const newStatus = !isDarkMode diff --git a/themes/matery/LayoutBase.js b/themes/matery/LayoutBase.js index 18387469..4b9e949e 100644 --- a/themes/matery/LayoutBase.js +++ b/themes/matery/LayoutBase.js @@ -56,7 +56,7 @@ const LayoutBase = props => { {headerSlot}
-
+
{onLoading ? : children}
diff --git a/themes/matery/LayoutSlug.js b/themes/matery/LayoutSlug.js index 71122962..2d5dbc61 100644 --- a/themes/matery/LayoutSlug.js +++ b/themes/matery/LayoutSlug.js @@ -46,17 +46,19 @@ export const LayoutSlug = props => { showTag={false} floatSlot={floatSlot} > -
+
{lock && } {!lock &&
{/*

+ }
{/* Notion文章主体 */} diff --git a/themes/matery/components/BlogPostCard.js b/themes/matery/components/BlogPostCard.js index ba4e9c4b..81f76800 100644 --- a/themes/matery/components/BlogPostCard.js +++ b/themes/matery/components/BlogPostCard.js @@ -6,7 +6,6 @@ import CONFIG_MATERY from '../config_matery' const BlogPostCard = ({ post, showSummary }) => { const showPreview = CONFIG_MATERY.POST_LIST_PREVIEW && post.blockMap - console.log('文章', post) return (
{
{/* 描述 */} -
+
{(!showPreview || showSummary) && !post.results && post.summary && (

+ className="replace my-2 text-sm font-light leading-7"> {post.summary}

)} {/* 搜索结果 */} {post.results && ( -

+

{post.results.map(r => ( {r} ))}

)} -
+
- +
+
) }