mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-23 15:10:28 +00:00
feat: add rootNotionSpaceId optional config
This commit is contained in:
@@ -5,10 +5,20 @@
|
||||
* for optional depenencies.
|
||||
*/
|
||||
|
||||
import { parsePageId } from 'notion-utils'
|
||||
import { getSiteConfig, getEnv } from './get-config-value'
|
||||
|
||||
// where it all starts -- the site's root Notion page
|
||||
export const rootNotionPageId: string = getSiteConfig('rootNotionPageId')
|
||||
export const rootNotionPageId: string = parsePageId(
|
||||
getSiteConfig('rootNotionPageId'),
|
||||
{ uuid: false }
|
||||
)
|
||||
|
||||
// if you want to restrict pages to a single notion workspace (optional)
|
||||
export const rootNotionSpaceId: string | null = parsePageId(
|
||||
getSiteConfig('rootNotionSpaceId', null),
|
||||
{ uuid: true }
|
||||
)
|
||||
|
||||
// general site config
|
||||
export const name: string = getSiteConfig('name')
|
||||
|
||||
@@ -8,6 +8,7 @@ export const getSiteForDomain = async (
|
||||
domain,
|
||||
name: config.name,
|
||||
rootNotionPageId: config.rootNotionPageId,
|
||||
rootNotionSpaceId: config.rootNotionSpaceId,
|
||||
description: config.description
|
||||
} as types.Site
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user