feat: add rss feed and cleanup some sitemap code

This commit is contained in:
Travis Fischer
2022-04-21 20:46:51 -04:00
parent facc4e301b
commit 69b631e57a
14 changed files with 162 additions and 114 deletions

View File

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