mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-06-08 23:16:48 +00:00
feat: add rss feed and cleanup some sitemap code
This commit is contained in:
@@ -11,10 +11,9 @@ import {
|
||||
import { PageBlock } from 'notion-types'
|
||||
|
||||
import { notion } from 'lib/notion-api'
|
||||
import { getSiteForDomain } from 'lib/get-site-for-domain'
|
||||
import { mapImageUrl } from 'lib/map-image-url'
|
||||
import * as config from 'lib/config'
|
||||
import { interRegular } from 'lib/fonts'
|
||||
import * as config from 'lib/config'
|
||||
|
||||
/**
|
||||
* Social image generation via headless chrome.
|
||||
@@ -35,7 +34,6 @@ export default withOGImage<'query', 'id'>({
|
||||
throw new Error('Invalid notion page id')
|
||||
}
|
||||
|
||||
const site = await getSiteForDomain(config.domain)
|
||||
const recordMap = await notion.getPage(pageId)
|
||||
|
||||
const keys = Object.keys(recordMap?.block || {})
|
||||
@@ -47,7 +45,7 @@ export default withOGImage<'query', 'id'>({
|
||||
|
||||
const isBlogPost =
|
||||
block.type === 'page' && block.parent_table === 'collection'
|
||||
const title = getBlockTitle(block, recordMap) || site.name
|
||||
const title = getBlockTitle(block, recordMap) || config.name
|
||||
const image = mapImageUrl(
|
||||
getPageProperty<string>('Social Image', block, recordMap) ||
|
||||
(block as PageBlock).format?.page_cover ||
|
||||
@@ -96,7 +94,7 @@ export default withOGImage<'query', 'id'>({
|
||||
month: 'long'
|
||||
})} ${dateUpdated.getFullYear()}`
|
||||
: undefined
|
||||
const detail = date || site.domain
|
||||
const detail = date || config.domain
|
||||
|
||||
return (
|
||||
<html>
|
||||
|
||||
Reference in New Issue
Block a user