frame-work lib/db

This commit is contained in:
tangly1024
2024-03-10 14:07:06 +08:00
parent 11d9eca881
commit 1fb9ba4abf
5 changed files with 8 additions and 10 deletions

View File

@@ -12,6 +12,7 @@ import { getConfigMapFromConfigPage } from '@/lib/notion/getNotionConfig'
export { getAllTags } from '../notion/getAllTags'
export { getPostBlocks } from '../notion/getPostBlocks'
export { getPost } from '../notion/getNotionPost'
/**
* 获取博客数据; 基于Notion实现

View File

@@ -9,7 +9,7 @@ import { defaultMapImageUrl } from 'react-notion-x'
* @param {*} pageId
* @returns
*/
export async function getNotion(pageId) {
export async function getPost(pageId) {
const blockMap = await getPostBlocks(pageId, 'slug')
if (!blockMap) {
return null