diff --git a/blog.config.js b/blog.config.js index ae020dac..80b8ddbd 100644 --- a/blog.config.js +++ b/blog.config.js @@ -5,7 +5,7 @@ const BLOG = { process.env.NOTION_PAGE_ID || '02ab3b8678004aa69e9e415905ef32a5', PSEUDO_STATIC: process.env.NEXT_PUBLIC_PSEUDO_STATIC || false, // 伪静态路径,开启后所有文章URL都以 .html 结尾。 NEXT_REVALIDATE_SECOND: process.env.NEXT_PUBLIC_REVALIDATE_SECOND || 5, // 更新内容缓存间隔 单位(秒);即每个页面有5秒的纯静态期、此期间无论多少次访问都不会抓取notion数据;调大该值有助于节省Vercel资源、同时提升访问速率,但也会使文章更新有延迟。 - THEME: process.env.NEXT_PUBLIC_THEME || 'hexo', // 当前主题,在themes文件夹下可找到所有支持的主题;主题名称就是文件夹名,例如 example,fukasawa,gitbook,heo,hexo,landing,matery,medium,next,nobelium,plog,simple + THEME: process.env.NEXT_PUBLIC_THEME || 'simple', // 当前主题,在themes文件夹下可找到所有支持的主题;主题名称就是文件夹名,例如 example,fukasawa,gitbook,heo,hexo,landing,matery,medium,next,nobelium,plog,simple THEME_SWITCH: process.env.NEXT_PUBLIC_THEME_SWITCH || false, // 是否显示切换主题按钮 LANG: process.env.NEXT_PUBLIC_LANG || 'zh-CN', // e.g 'zh-CN','en-US' see /lib/lang.js for more. SINCE: 2021, // e.g if leave this empty, current year will be used. diff --git a/lib/notion/getNotionConfig.js b/lib/notion/getNotionConfig.js index e87f8378..ef319105 100644 --- a/lib/notion/getNotionConfig.js +++ b/lib/notion/getNotionConfig.js @@ -21,7 +21,7 @@ export async function getConfigMapFromConfigPage(allPages) { const notionConfig = BLOG if (!allPages || !Array.isArray(allPages) || allPages.length === 0) { - console.warn('[Notion配置] 忽略的配置', allPages, typeof allPages) + console.warn('[Notion配置] 忽略的配置') return null } const configPage = allPages?.find(post => { @@ -29,7 +29,7 @@ export async function getConfigMapFromConfigPage(allPages) { }) if (!configPage) { - console.warn('[Notion配置]未找到配置页面', allPages, typeof allPages) + console.warn('[Notion配置] 未找到配置页面') return null } const configPageId = configPage.id @@ -40,7 +40,7 @@ export async function getConfigMapFromConfigPage(allPages) { const content = pageRecordMap.block[configPageId].value.content if (!content) { - console.warn('[Notion配置]未找到配置表格', pageRecordMap.block[configPageId], pageRecordMap.block[configPageId].value) + console.warn('[Notion配置] 未找到配置表格', pageRecordMap.block[configPageId], pageRecordMap.block[configPageId].value) return null } diff --git a/themes/commerce/components/ArticleCopyright.js b/themes/commerce/components/ArticleCopyright.js index 9cf537a1..67c65bab 100644 --- a/themes/commerce/components/ArticleCopyright.js +++ b/themes/commerce/components/ArticleCopyright.js @@ -1,4 +1,3 @@ -import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' import Link from 'next/link' import { useRouter } from 'next/router' @@ -8,7 +7,7 @@ import { siteConfig } from '@/lib/config' export default function ArticleCopyright () { const router = useRouter() - const [path, setPath] = useState(BLOG.LINK + router.asPath) + const [path, setPath] = useState(siteConfig('LINK') + router.asPath) useEffect(() => { setPath(window.location.href) }) diff --git a/themes/commerce/components/ArticleRecommend.js b/themes/commerce/components/ArticleRecommend.js index dc5ef58e..0feff96d 100644 --- a/themes/commerce/components/ArticleRecommend.js +++ b/themes/commerce/components/ArticleRecommend.js @@ -1,6 +1,6 @@ import Link from 'next/link' import CONFIG from '../config' -import BLOG from '@/blog.config' +import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import LazyImage from '@/components/LazyImage' @@ -38,7 +38,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) { ( diff --git a/themes/commerce/components/BlogPostArchive.js b/themes/commerce/components/BlogPostArchive.js index 7de25e1a..860e8c6a 100644 --- a/themes/commerce/components/BlogPostArchive.js +++ b/themes/commerce/components/BlogPostArchive.js @@ -1,5 +1,6 @@ import Link from 'next/link' -import BLOG from '@/blog.config' +import { siteConfig } from '@/lib/config' + /** * 博客归档列表 * @param posts 所有文章 @@ -29,7 +30,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => { {post.date?.start_date}{' '} diff --git a/themes/commerce/components/BlogPostCardInfo.js b/themes/commerce/components/BlogPostCardInfo.js index eb2b5676..23dd2ad2 100644 --- a/themes/commerce/components/BlogPostCardInfo.js +++ b/themes/commerce/components/BlogPostCardInfo.js @@ -2,7 +2,7 @@ import NotionPage from '@/components/NotionPage' import Link from 'next/link' import TagItemMini from './TagItemMini' import TwikooCommentCount from '@/components/TwikooCommentCount' -import BLOG from '@/blog.config' +import { siteConfig } from '@/lib/config' import { formatDateFmt } from '@/lib/formatDate' /** @@ -15,7 +15,7 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary