From d2a37b3a179a1312fd845ab4be101efabdd27ae3 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 5 Oct 2024 15:02:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E9=9D=A2=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/db/getSiteData.js | 6 +++--- pages/sitemap.xml.js | 4 ++-- themes/magzine/components/PostItemCardTop.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/db/getSiteData.js b/lib/db/getSiteData.js index 48de0f27..266e8f87 100755 --- a/lib/db/getSiteData.js +++ b/lib/db/getSiteData.js @@ -5,7 +5,7 @@ import getAllPageIds from '@/lib/notion/getAllPageIds' import { getAllTags } from '@/lib/notion/getAllTags' import { getConfigMapFromConfigPage } from '@/lib/notion/getNotionConfig' import getPageProperties, { - adjustPageProperties + adjustPageProperties } from '@/lib/notion/getPageProperties' import { fetchInBatches, getPage } from '@/lib/notion/getPostBlocks' import { compressImage, mapImgUrl } from '@/lib/notion/mapImage' @@ -51,7 +51,7 @@ export async function getGlobalData({ } catch (error) { console.error('异常', error) } - return data + return handleDataBeforeReturn(deepClone(data)) } /** @@ -77,7 +77,7 @@ export async function getNotionPageData({ pageId, from }) { } // 返回给前端的数据做处理 - return handleDataBeforeReturn(deepClone(data)) + return data } /** diff --git a/pages/sitemap.xml.js b/pages/sitemap.xml.js index 2f6c20fe..8ecbd55c 100644 --- a/pages/sitemap.xml.js +++ b/pages/sitemap.xml.js @@ -1,7 +1,7 @@ // pages/sitemap.xml.js import BLOG from '@/blog.config' import { siteConfig } from '@/lib/config' -import { getNotionPageData } from '@/lib/db/getSiteData' +import { getGlobalData } from '@/lib/db/getSiteData' import { extractLangId, extractLangPrefix } from '@/lib/utils/pageId' import { getServerSideSitemap } from 'next-sitemap' @@ -13,7 +13,7 @@ export const getServerSideProps = async ctx => { const id = extractLangId(siteId) const locale = extractLangPrefix(siteId) // 第一个id站点默认语言 - const siteData = await getNotionPageData({ + const siteData = await getGlobalData({ pageId: id, from: 'sitemap.xml' }) diff --git a/themes/magzine/components/PostItemCardTop.js b/themes/magzine/components/PostItemCardTop.js index cecbca64..765f441d 100644 --- a/themes/magzine/components/PostItemCardTop.js +++ b/themes/magzine/components/PostItemCardTop.js @@ -24,7 +24,7 @@ const PostItemCardTop = ({ post, showSummary }) => { // data-aos-anchor-placement='top-bottom' className='mb-6 max-w-screen-3xl '>
- {siteConfig('MAGZINE_POST_LIST_COVER') && ( + {siteConfig('MAGZINE_POST_LIST_COVER') && post?.pageCoverThumbnail && (