1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 09:13:19 +01:00

load typekit the default way

This commit is contained in:
Matthias Kretschmann 2018-04-21 20:10:23 +02:00
parent 5e20db2f72
commit 3d38f1d170
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 3 additions and 6 deletions

View File

@ -14,8 +14,7 @@
"gatsby-transformer-json": "^1.0.16",
"react-helmet": "^5.2.0",
"react-markdown": "^3.3.0",
"react-transition-group": "^2.3.1",
"webfontloader": "^1.6.28"
"react-transition-group": "^2.3.1"
},
"devDependencies": {
"babel-eslint": "^8.2.3",

View File

@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import Helmet from 'react-helmet'
const Head = ({ meta }) => {
const { title, tagline, description } = meta
const { title, tagline, description, typekit } = meta
return (
<Helmet
@ -11,6 +11,7 @@ const Head = ({ meta }) => {
titleTemplate={`%s // ${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
>
<meta name="description" content={description} />
<link rel="stylesheet" href={`https://use.typekit.net/${typekit}.css`} />
<meta content="noindex,nofollow" name="robots" />
</Helmet>

View File

@ -1,6 +1,5 @@
import React from 'react'
import PropTypes from 'prop-types'
import WebFont from 'webfontloader'
import Head from '../components/atoms/Head'
import Header from '../components/organisms/Header'
import Footer from '../components/organisms/Footer'
@ -13,8 +12,6 @@ const TemplateWrapper = ({ data, location, children }) => {
return (
<div className="app">
<Head meta={meta} />
{WebFont.load({ typekit: { id: meta.typekit } })}
<Header meta={meta} isHomepage={isHomepage} />
{children()}