feat: add rootNotionSpaceId optional config

This commit is contained in:
Travis Fischer
2021-02-01 18:42:05 -05:00
parent 09bb0cefef
commit 49a8cca397
3 changed files with 15 additions and 1 deletions

View File

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

View File

@@ -8,6 +8,7 @@ export const getSiteForDomain = async (
domain,
name: config.name,
rootNotionPageId: config.rootNotionPageId,
rootNotionSpaceId: config.rootNotionSpaceId,
description: config.description
} as types.Site
}

View File

@@ -2,6 +2,9 @@ module.exports = {
// where it all starts -- the site's root Notion page (required)
rootNotionPageId: '78fc5a4b88d74b0e824e29407e9f1ec1',
// if you want to restrict pages to a single notion workspace (optional)
rootNotionSpaceId: null,
// basic site info (required)
name: 'Transitive Bullshit',
domain: 'transitivebullsh.it',