feat: minor fixes

This commit is contained in:
Travis Fischer
2021-01-15 12:51:25 -05:00
parent a5d799fdca
commit 32b845af2b
8 changed files with 20 additions and 26 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

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