mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-29 23:16:51 +00:00
站点信息读取Notion数据
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import LayoutBase from './LayoutBase'
|
||||
|
||||
export const Layout404 = (props) => {
|
||||
export const Layout404 = props => {
|
||||
return <LayoutBase {...props}>
|
||||
<div className='w-full h-96 py-80 flex justify-center items-center'>404 Not found.</div>
|
||||
</LayoutBase>
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import BLOG from '@/blog.config'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import Link from 'next/link'
|
||||
import LayoutBase from './LayoutBase'
|
||||
|
||||
export const LayoutArchive = props => {
|
||||
const { posts } = props
|
||||
const { locale } = useGlobal()
|
||||
const postsSortByDate = Object.create(posts)
|
||||
|
||||
postsSortByDate.sort((a, b) => {
|
||||
@@ -14,12 +12,6 @@ export const LayoutArchive = props => {
|
||||
return dateB - dateA
|
||||
})
|
||||
|
||||
const meta = {
|
||||
title: `${locale.NAV.ARCHIVE} | ${BLOG.TITLE}`,
|
||||
description: BLOG.DESCRIPTION,
|
||||
type: 'website'
|
||||
}
|
||||
|
||||
const archivePosts = {}
|
||||
|
||||
postsSortByDate.forEach(post => {
|
||||
@@ -31,7 +23,7 @@ export const LayoutArchive = props => {
|
||||
}
|
||||
})
|
||||
return (
|
||||
<LayoutBase {...props} meta={meta}>
|
||||
<LayoutBase {...props}>
|
||||
<div className="mb-10 pb-20 md:p-12 p-3 min-h-full">
|
||||
{Object.keys(archivePosts).map(archiveTitle => (
|
||||
<div key={archiveTitle}>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import LayoutBase from './LayoutBase'
|
||||
import BlogPostListScroll from './components/BlogPostListScroll'
|
||||
|
||||
export const LayoutCategory = (props) => {
|
||||
export const LayoutCategory = props => {
|
||||
const { category } = props
|
||||
const slotTop = <div className='flex items-center font-sans p-8'><div className='text-xl'><i className='mr-2 fas fa-th'/>分类:</div>{category}</div>
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import BLOG from '@/blog.config'
|
||||
import { getPageTableOfContents } from 'notion-utils'
|
||||
|
||||
import LayoutBase from './LayoutBase'
|
||||
@@ -11,12 +10,6 @@ import { ArticleLock } from './components/ArticleLock'
|
||||
|
||||
export const LayoutSlug = props => {
|
||||
const { post, lock, validPassword } = props
|
||||
const meta = {
|
||||
title: `${post.title} | ${BLOG.TITLE}`,
|
||||
description: post.summary,
|
||||
type: 'article',
|
||||
tags: post.tags
|
||||
}
|
||||
|
||||
if (!lock && post?.blockMap?.block) {
|
||||
post.content = Object.keys(post.blockMap.block)
|
||||
@@ -53,7 +46,6 @@ export const LayoutSlug = props => {
|
||||
return (
|
||||
<LayoutBase
|
||||
{...props}
|
||||
meta={meta}
|
||||
showInfoCard={true}
|
||||
slotRight={slotRight}
|
||||
>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import BLOG from '@/blog.config'
|
||||
import Link from 'next/link'
|
||||
|
||||
export default function LogoBar () {
|
||||
export default function LogoBar (props) {
|
||||
const { siteInfo } = props
|
||||
return <div id='top-wrapper' className='w-full flex items-center font-sans'>
|
||||
<Link href='/'>
|
||||
<a className='text-md md:text-xl dark:text-gray-200'>{BLOG.TITLE}</a>
|
||||
<a className='text-md md:text-xl dark:text-gray-200'>{siteInfo.title}</a>
|
||||
</Link>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function TopNavBar (props) {
|
||||
|
||||
return <div id='top-nav' className={'sticky top-0 lg:relative w-full z-40 ' + className}>
|
||||
<div className='flex w-full h-12 shadow bg-white dark:bg-gray-900 px-5 items-between'>
|
||||
<LogoBar />
|
||||
<LogoBar {...props}/>
|
||||
|
||||
{/* 顶部菜单 */}
|
||||
<div className='flex'>
|
||||
|
||||
Reference in New Issue
Block a user