mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-17 15:10:13 +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} />
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 (
|
||||
<Html lang='en'>
|
||||
<Head>
|
||||
<link rel='shortcut icon' href='/favicon.ico' />
|
||||
<link rel='shortcut icon' href={config.siteFavicon} />
|
||||
|
||||
<link
|
||||
rel='apple-touch-icon'
|
||||
sizes='180x180'
|
||||
href='/apple-touch-icon.png'
|
||||
/>
|
||||
<link
|
||||
rel='icon'
|
||||
type='image/png'
|
||||
sizes='96x96'
|
||||
href='/favicon-96x96.png'
|
||||
/>
|
||||
<link
|
||||
rel='icon'
|
||||
type='image/png'
|
||||
|
||||
BIN
public/favicon-96x96.png
Normal file
BIN
public/favicon-96x96.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
BIN
public/favicon.png
Normal file
BIN
public/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -12,6 +12,11 @@
|
||||
"type": "image/png",
|
||||
"sizes": "32x32"
|
||||
},
|
||||
{
|
||||
"src": "/favicon-96x96.png",
|
||||
"type": "image/png",
|
||||
"sizes": "96x96"
|
||||
},
|
||||
{
|
||||
"src": "/apple-touch-icon.png",
|
||||
"type": "image/png",
|
||||
|
||||
Reference in New Issue
Block a user