mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 15:10:14 +00:00
nobelium 支持公告
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
import BLOG from '@/blog.config'
|
import BLOG from '@/blog.config'
|
||||||
|
import Announcement from './components/Announcement'
|
||||||
import { BlogListPage } from './components/BlogListPage'
|
import { BlogListPage } from './components/BlogListPage'
|
||||||
import { BlogListScroll } from './components/BlogListScroll'
|
import { BlogListScroll } from './components/BlogListScroll'
|
||||||
import LayoutBase from './LayoutBase'
|
import LayoutBase from './LayoutBase'
|
||||||
@@ -7,6 +8,7 @@ import LayoutBase from './LayoutBase'
|
|||||||
export const LayoutIndex = props => {
|
export const LayoutIndex = props => {
|
||||||
return (
|
return (
|
||||||
<LayoutBase {...props}>
|
<LayoutBase {...props}>
|
||||||
|
<Announcement {...props} />
|
||||||
{BLOG.POST_LIST_STYLE === 'page' ? <BlogListPage {...props} /> : <BlogListScroll {...props} />}
|
{BLOG.POST_LIST_STYLE === 'page' ? <BlogListPage {...props} /> : <BlogListScroll {...props} />}
|
||||||
</LayoutBase>
|
</LayoutBase>
|
||||||
)
|
)
|
||||||
|
|||||||
18
themes/nobelium/components/Announcement.js
Normal file
18
themes/nobelium/components/Announcement.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
const NotionPage = dynamic(() => import('@/components/NotionPage'))
|
||||||
|
|
||||||
|
const Announcement = ({ notice, className }) => {
|
||||||
|
if (notice?.blockMap) {
|
||||||
|
return <div className={className}>
|
||||||
|
<section id='announcement-wrapper' className='mb-10'>
|
||||||
|
{notice && (<div id="announcement-content">
|
||||||
|
<NotionPage post={notice} className='text-center ' />
|
||||||
|
</div>)}
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export default Announcement
|
||||||
Reference in New Issue
Block a user