From 024d798440689caae2ad29ee6ca9146fb66a10bd Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Tue, 23 May 2023 13:49:28 +0800 Subject: [PATCH] =?UTF-8?q?nobelium=20=E6=94=AF=E6=8C=81=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/nobelium/LayoutIndex.js | 2 ++ themes/nobelium/components/Announcement.js | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 themes/nobelium/components/Announcement.js diff --git a/themes/nobelium/LayoutIndex.js b/themes/nobelium/LayoutIndex.js index 94eaac2f..8bf7541a 100644 --- a/themes/nobelium/LayoutIndex.js +++ b/themes/nobelium/LayoutIndex.js @@ -1,5 +1,6 @@ import BLOG from '@/blog.config' +import Announcement from './components/Announcement' import { BlogListPage } from './components/BlogListPage' import { BlogListScroll } from './components/BlogListScroll' import LayoutBase from './LayoutBase' @@ -7,6 +8,7 @@ import LayoutBase from './LayoutBase' export const LayoutIndex = props => { return ( + {BLOG.POST_LIST_STYLE === 'page' ? : } ) diff --git a/themes/nobelium/components/Announcement.js b/themes/nobelium/components/Announcement.js new file mode 100644 index 00000000..088c412e --- /dev/null +++ b/themes/nobelium/components/Announcement.js @@ -0,0 +1,18 @@ +import dynamic from 'next/dynamic' + +const NotionPage = dynamic(() => import('@/components/NotionPage')) + +const Announcement = ({ notice, className }) => { + if (notice?.blockMap) { + return
+
+ {notice && (
+ +
)} +
+
+ } else { + return null + } +} +export default Announcement