diff --git a/components/ExternalPlugins.js b/components/ExternalPlugins.js index ce0b5e63..d798a940 100644 --- a/components/ExternalPlugins.js +++ b/components/ExternalPlugins.js @@ -63,7 +63,8 @@ const ExternalPlugin = props => { const MOUSE_FOLLOW = siteConfig('MOUSE_FOLLOW') const CUSTOM_EXTERNAL_CSS = siteConfig('CUSTOM_EXTERNAL_CSS') const CUSTOM_EXTERNAL_JS = siteConfig('CUSTOM_EXTERNAL_JS') - const ENABLE_NPROGRSS = siteConfig('ENABLE_NPROGRSS', true) + // 默认关闭NProgress + const ENABLE_NPROGRSS = siteConfig('ENABLE_NPROGRSS', false) // 自定义样式css和js引入 if (isBrowser) { diff --git a/components/OpenWrite.js b/components/OpenWrite.js index 973931a8..5caf5d7b 100644 --- a/components/OpenWrite.js +++ b/components/OpenWrite.js @@ -73,8 +73,11 @@ const OpenWrite = () => { console.error('OpenWrite 加载异常', error) } } - useEffect(() => { + if (process.env.NODE_ENV === 'development') { + console.log('开发环境:屏蔽OpenWrite') + return + } if (isBrowser && blogId) { // Check if the element with id 'read-more-wrap' already exists const readMoreWrap = document.getElementById('read-more-wrap') diff --git a/lib/cache/cache_manager.js b/lib/cache/cache_manager.js index 6070958c..bbfbfdac 100644 --- a/lib/cache/cache_manager.js +++ b/lib/cache/cache_manager.js @@ -8,7 +8,7 @@ import MemoryCache from './memory_cache' * @returns */ export async function getDataFromCache(key, force) { - if (JSON.parse(BLOG.ENABLE_CACHE) || force) { + if (BLOG.ENABLE_CACHE || force) { const dataFromCache = await getApi().getCache(key) if (JSON.stringify(dataFromCache) === '[]') { return null diff --git a/themes/magzine/components/Announcement.js b/themes/magzine/components/Announcement.js index 522f0784..62ab01d0 100644 --- a/themes/magzine/components/Announcement.js +++ b/themes/magzine/components/Announcement.js @@ -3,6 +3,9 @@ import dynamic from 'next/dynamic' const NotionPage = dynamic(() => import('@/components/NotionPage')) +/** + * Magzine主题的公告 + */ const Announcement = ({ post, className }) => { // const { locale } = useGlobal() if (post?.blockMap) { diff --git a/themes/magzine/components/ArticleInfo.js b/themes/magzine/components/ArticleInfo.js index e2f79ea3..02461b8d 100644 --- a/themes/magzine/components/ArticleInfo.js +++ b/themes/magzine/components/ArticleInfo.js @@ -2,6 +2,8 @@ import LazyImage from '@/components/LazyImage' import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' import Link from 'next/link' +import CategoryItem from './CategoryItem' +import TagItemMini from './TagItemMini' /** * 文章详情页介绍 @@ -13,11 +15,42 @@ export default function ArticleInfo(props) { return ( <> - {/* title */} -

- {siteConfig('POST_TITLE_ICON') && } - {post?.title} -

+
+
+ {siteConfig('MAGZINE_POST_LIST_CATEGORY') && ( + + )} +
+ {siteConfig('MAGZINE_POST_LIST_TAG') && + post?.tagItems?.map(tag => ( + + ))} +
+
+ + {/* title */} +

+ {siteConfig('POST_TITLE_ICON') && ( + + )} + {post?.title} +

+ +
{post?.summary}
+
+ + {post?.type && !post?.type !== 'Page' && post?.pageCover && ( +
+ +
+ )} {/* meta */}
diff --git a/themes/magzine/components/Footer.js b/themes/magzine/components/Footer.js index aaf801f8..b3672dda 100644 --- a/themes/magzine/components/Footer.js +++ b/themes/magzine/components/Footer.js @@ -1,56 +1,113 @@ import DarkModeButton from '@/components/DarkModeButton' +import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' +import { useGlobal } from '@/lib/global' +import Link from 'next/link' import SocialButton from './SocialButton' +/** + * 网页底脚 + */ const Footer = ({ title }) => { const d = new Date() const currentYear = d.getFullYear() const since = siteConfig('SINCE') const copyrightDate = parseInt(since) < currentYear ? since + '-' + currentYear : currentYear + const { siteInfo } = useGlobal() + const MAGZINE_FOOTER_LINKS = siteConfig('MAGZINE_FOOTER_LINKS', []) + console.log('菜单', MAGZINE_FOOTER_LINKS) return ( -