diff --git a/components/ErrorPage.tsx b/components/ErrorPage.tsx index ee34724..2f5c6d5 100644 --- a/components/ErrorPage.tsx +++ b/components/ErrorPage.tsx @@ -1,6 +1,5 @@ import React from 'react' import Head from 'next/head' -import { defaultSiteFavicon } from 'lib/config' import { PageHead } from './PageHead' import styles from './styles.module.css' @@ -13,8 +12,6 @@ export const ErrorPage: React.FC<{ statusCode: number }> = ({ statusCode }) => { - - diff --git a/components/NotionPage.tsx b/components/NotionPage.tsx index f7190bf..5e7dad5 100644 --- a/components/NotionPage.tsx +++ b/components/NotionPage.tsx @@ -14,7 +14,7 @@ import { getBlockTitle } from 'notion-utils' import * as types from 'lib/types' import { mapPageUrl, getCanonicalPageUrl } from 'lib/map-page-url' import { mapNotionImageUrl } from 'lib/map-image-url' -// import { isDev } from 'lib/config' +import { isDev } from 'lib/config' // components import { CustomFont } from './CustomFont' @@ -65,19 +65,12 @@ export const NotionPage: React.FC = ({ } const title = getBlockTitle(block, recordMap) || site.name - let notionIcon = (block.format as any)?.page_icon - - if (notionIcon && isUrl(notionIcon)) { - notionIcon = mapNotionImageUrl(notionIcon, block) - } - - const icon = notionIcon - const iconUrl = (icon && isUrl(icon)) ?? icon console.log('notion page', { - // isDev, - rootNotionPageId: site.rootNotionPageId, + isDev, + title, pageId, + rootNotionPageId: site.rootNotionPageId, recordMap }) @@ -88,20 +81,18 @@ export const NotionPage: React.FC = ({ const siteMapPageUrl = mapPageUrl(site, recordMap, searchParams) - // const canonicalPageUrl = - // !isDev && getCanonicalPageUrl(site, recordMap)(pageId) + const canonicalPageUrl = + !isDev && getCanonicalPageUrl(site, recordMap)(pageId) return ( <> - {/* {iconUrl && } */} - - {/* {canonicalPageUrl && } */} + {canonicalPageUrl && } {title} diff --git a/components/Page404.tsx b/components/Page404.tsx index e95312c..ae933e8 100644 --- a/components/Page404.tsx +++ b/components/Page404.tsx @@ -1,7 +1,6 @@ import Head from 'next/head' import * as React from 'react' import * as types from 'lib/types' -import { defaultSiteFavicon } from 'lib/config' import { PageHead } from './PageHead' import styles from './styles.module.css' @@ -14,8 +13,6 @@ export const Page404: React.FC = ({ site, pageId, error }) => { - - diff --git a/lib/config.ts b/lib/config.ts index 5bfe308..7d4e77f 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -9,9 +9,6 @@ import { getEnv } from './get-env' export const isDev = process.env.NODE_ENV === 'development' || !process.env.NODE_ENV -export const defaultSiteImage = '/social.jpg' -export const defaultSiteFavicon = '/favicon.ico' - export const fathomId = isDev ? null : getEnv('FATHOM_ID', null) export const fathomConfig = fathomId diff --git a/pages/_document.tsx b/pages/_document.tsx index 2d79703..b602082 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -1,18 +1,25 @@ import React from 'react' import Document, { Html, Head, Main, NextScript } from 'next/document' +import * as config from 'lib/env' export default class MyDocument extends Document { render() { return ( - + +