fix: social images

This commit is contained in:
Travis Fischer
2022-04-06 09:37:01 -04:00
parent 0b7d6187c0
commit ee1333c6c8
6 changed files with 18 additions and 17 deletions

View File

@@ -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
View File

@@ -0,0 +1,5 @@
import { NotionAPI } from 'notion-client'
export const notion = new NotionAPI({
apiBaseUrl: process.env.NOTION_API_BASE_URL
})

View File

@@ -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)