mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 15:09:47 +00:00
fix: social images
This commit is contained in:
@@ -3,7 +3,7 @@ import { getAllPagesInSpace } from 'notion-utils'
|
||||
|
||||
import * as types from './types'
|
||||
import { includeNotionIdInUrls } from './config'
|
||||
import { notion } from './notion'
|
||||
import { notion } from './notion-api'
|
||||
import { getCanonicalPageId } from './get-canonical-page-id'
|
||||
|
||||
const uuid = !!includeNotionIdInUrls
|
||||
|
||||
5
lib/notion-api.ts
Normal file
5
lib/notion-api.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { NotionAPI } from 'notion-client'
|
||||
|
||||
export const notion = new NotionAPI({
|
||||
apiBaseUrl: process.env.NOTION_API_BASE_URL
|
||||
})
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NotionAPI } from 'notion-client'
|
||||
import { ExtendedRecordMap, SearchParams, SearchResults } from 'notion-types'
|
||||
|
||||
import { notion } from './notion-api'
|
||||
import { getPreviewImageMap } from './preview-images'
|
||||
import { getTweetAstMap } from './tweet-embeds'
|
||||
import {
|
||||
@@ -8,10 +8,6 @@ import {
|
||||
isTweetEmbedSupportEnabled
|
||||
} from './config'
|
||||
|
||||
export const notion = new NotionAPI({
|
||||
apiBaseUrl: process.env.NOTION_API_BASE_URL
|
||||
})
|
||||
|
||||
export async function getPage(pageId: string): Promise<ExtendedRecordMap> {
|
||||
const recordMap = await notion.getPage(pageId)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user