Merge branch 'main' of https://github.com/tangly1024/NotionNext into feature/user-auth-clerk

This commit is contained in:
tangly1024.com
2024-09-06 16:50:57 +08:00
78 changed files with 3874 additions and 1094 deletions

View File

@@ -1,5 +1,6 @@
import BLOG from '@/blog.config'
import useNotification from '@/components/Notification'
import OpenWrite from '@/components/OpenWrite'
import { siteConfig } from '@/lib/config'
import { getGlobalData, getPost, getPostBlocks } from '@/lib/db/getSiteData'
import { useGlobal } from '@/lib/global'
@@ -95,8 +96,12 @@ const Slug = props => {
})
return (
<>
{/* 文章布局 */}
<Layout {...props} />
{/* 解锁密码提示框 */}
{post?.password && post?.password !== '' && !lock && <Notification />}
{/* 导流工具 */}
<OpenWrite />
</>
)
}

View File

@@ -3,6 +3,7 @@ import { siteConfig } from '@/lib/config'
import { getGlobalData, getPostBlocks } from '@/lib/db/getSiteData'
import { generateRobotsTxt } from '@/lib/robots.txt'
import { generateRss } from '@/lib/rss'
import { generateSitemapXml } from '@/lib/sitemap.xml'
import { getLayoutByTheme } from '@/themes/theme'
import { useRouter } from 'next/router'
@@ -62,6 +63,8 @@ export async function getStaticProps(req) {
generateRobotsTxt(props)
// 生成Feed订阅
generateRss(props)
// 生成
generateSitemapXml(props)
// 生成全文索引 - 仅在 yarn build 时执行 && process.env.npm_lifecycle_event === 'build'