1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2025-01-03 10:25:00 +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", "gatsby-transformer-json": "^1.0.16",
"react-helmet": "^5.2.0", "react-helmet": "^5.2.0",
"react-markdown": "^3.3.0", "react-markdown": "^3.3.0",
"react-transition-group": "^2.3.1", "react-transition-group": "^2.3.1"
"webfontloader": "^1.6.28"
}, },
"devDependencies": { "devDependencies": {
"babel-eslint": "^8.2.3", "babel-eslint": "^8.2.3",

View File

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

View File

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