added better favicons, moved from sass to glamor, moved components
and utils to src dir, and removed packages no longer being used
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
import getUrl from '../src/util/getUrl'
|
||||
import { renderStaticOptimized } from 'glamor/server'
|
||||
import Document, { Head, Main, NextScript } from 'next/document'
|
||||
import getUrl from '../util/getUrl'
|
||||
|
||||
export default class MyDocument extends Document {
|
||||
static async getInitialProps({ renderPage }) {
|
||||
const page = renderPage()
|
||||
const styles = renderStaticOptimized(() => page.html || page.errorHtml)
|
||||
return { ...page, ...styles }
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
const { __NEXT_DATA__, ids } = props
|
||||
if (ids) {
|
||||
__NEXT_DATA__.ids = this.props.ids
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const favicon = getUrl('favicon.ico')
|
||||
return (
|
||||
<html>
|
||||
<Head>
|
||||
@@ -12,9 +26,14 @@ export default class MyDocument extends Document {
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
<link rel="shortcut icon" href={favicon} type="image/x-icon" />
|
||||
<link rel="icon" href={favicon} type="image/x-icon" />
|
||||
<title>My Knowledge Base</title>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href={getUrl("/apple-touch-icon.png")}/>
|
||||
<link rel="icon" type="image/png" sizes="32x32" href={getUrl("/favicon-32x32.png")}/>
|
||||
<link rel="icon" type="image/png" sizes="16x16" href={getUrl("/favicon-16x16.png")}/>
|
||||
<link rel="manifest" href={getUrl("/site.webmanifest")}/>
|
||||
<link rel="mask-icon" href={getUrl("/safari-pinned-tab.svg")} color="#00d1b2"/>
|
||||
<meta name="msapplication-TileColor" content="#202225"/>
|
||||
<meta name="theme-color" content="#202225"/>
|
||||
<style dangerouslySetInnerHTML={{ __html: this.props.css }} data-glamor />
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: 'window.kbConf=' + JSON.stringify(app.get('kbConf')),
|
||||
|
||||
Reference in New Issue
Block a user