mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 15:09:47 +00:00
minor kittens
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import * as types from 'lib/types'
|
||||
import { getTextContent } from 'notion-utils'
|
||||
|
||||
export function getPageDescription(
|
||||
block: types.Block,
|
||||
@@ -12,7 +13,7 @@ export function getPageDescription(
|
||||
)
|
||||
|
||||
if (descriptionKey) {
|
||||
return block.properties[descriptionKey]
|
||||
return getTextContent(block.properties[descriptionKey])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import * as types from './types'
|
||||
import { isDev } from './config'
|
||||
import { getCanonicalPageId, uuidToId, parsePageId } from 'notion-utils'
|
||||
|
||||
// include UUIDs in page URLs during local development but not in production
|
||||
// (they're nice for debugging and speed up local dev)
|
||||
const uuid = !!isDev
|
||||
|
||||
export const mapPageUrl = (
|
||||
site: types.Site,
|
||||
recordMap: types.ExtendedRecordMap,
|
||||
@@ -10,7 +15,7 @@ export const mapPageUrl = (
|
||||
return createUrl('/', searchParams)
|
||||
} else {
|
||||
return createUrl(
|
||||
`/${getCanonicalPageId(pageId, recordMap, { uuid: false })}`,
|
||||
`/${getCanonicalPageId(pageId, recordMap, { uuid })}`,
|
||||
searchParams
|
||||
)
|
||||
}
|
||||
@@ -26,7 +31,7 @@ export const getCanonicalPageUrl = (
|
||||
return `https://${site.domain}`
|
||||
} else {
|
||||
return `https://${site.domain}/${getCanonicalPageId(pageUuid, recordMap, {
|
||||
uuid: false
|
||||
uuid
|
||||
})}`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"got": "^11.8.1",
|
||||
"isomorphic-unfetch": "^3.1.0",
|
||||
"lqip-modern": "^1.1.3",
|
||||
"next": "^10.0.6-canary.4",
|
||||
"next": "^10.0.5",
|
||||
"notion-client": "^3.2.4",
|
||||
"notion-types": "^3.1.1",
|
||||
"notion-utils": "^3.2.4",
|
||||
|
||||
Reference in New Issue
Block a user