mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-06-02 07:26:45 +00:00
feat: minor fixes
This commit is contained in:
@@ -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 }) => {
|
||||
<PageHead />
|
||||
|
||||
<Head>
|
||||
<link rel='shortcut icon' href={defaultSiteFavicon} />
|
||||
|
||||
<meta property='og:site_name' content={title} />
|
||||
<meta property='og:title' content={title} />
|
||||
|
||||
|
||||
@@ -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<types.PageProps> = ({
|
||||
}
|
||||
|
||||
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<types.PageProps> = ({
|
||||
|
||||
const siteMapPageUrl = mapPageUrl(site, recordMap, searchParams)
|
||||
|
||||
// const canonicalPageUrl =
|
||||
// !isDev && getCanonicalPageUrl(site, recordMap)(pageId)
|
||||
const canonicalPageUrl =
|
||||
!isDev && getCanonicalPageUrl(site, recordMap)(pageId)
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageHead site={site} />
|
||||
|
||||
<Head>
|
||||
{/* {iconUrl && <link rel='shortcut icon' href={iconUrl} />} */}
|
||||
|
||||
<meta property='og:title' content={title} />
|
||||
<meta property='og:site_name' content={site.name} />
|
||||
|
||||
{/* {canonicalPageUrl && <link rel='canonical' href={canonicalPageUrl} />} */}
|
||||
{canonicalPageUrl && <link rel='canonical' href={canonicalPageUrl} />}
|
||||
|
||||
<title>{title}</title>
|
||||
</Head>
|
||||
|
||||
@@ -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<types.PageProps> = ({ site, pageId, error }) => {
|
||||
<PageHead site={site} />
|
||||
|
||||
<Head>
|
||||
<link rel='shortcut icon' href={defaultSiteFavicon} />
|
||||
|
||||
<meta property='og:site_name' content={title} />
|
||||
<meta property='og:title' content={title} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user