Skip to content

Commit

Permalink
fix favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
Emily Plummer committed Jun 26, 2019
1 parent 3f197c4 commit 6e72743
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react'
import Document, {Head, Main, NextScript} from 'next/document'
import {ServerStyleSheet} from 'styled-components'
import {getAssetPath} from '../src/utils'


export default class MyDocument extends Document {
static getInitialProps({renderPage}) {
Expand All @@ -25,6 +27,7 @@ export default class MyDocument extends Document {
<meta property="og:url" content="https://primer.style" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta property="og:description" content="The design system that powers GitHub" />
<link rel="icon" href={getAssetPath('favicon.png')} />
<meta
property="og:image"
content="https://user-images.githubusercontent.com/10384315/53922681-2f6d3100-402a-11e9-9719-5d1811c8110a.png"
Expand Down
7 changes: 7 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'
import getConfig from 'next/config'

export const config = getConfig().publicRuntimeConfig || {}
export const assetPrefix = config.assetPrefix || ''
export const assetPath = `${assetPrefix}/static/`
export const getAssetPath = path => `${assetPath}${path}`
Binary file added static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6e72743

Please sign in to comment.