mirror of
https://github.com/kremalicious/portfolio.git
synced 2024-12-22 17:23:22 +01:00
change where typekit is loaded
This commit is contained in:
parent
e9073bf677
commit
5e20db2f72
@ -1,27 +1,20 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import Helmet from 'react-helmet'
|
import Helmet from 'react-helmet'
|
||||||
import WebFont from 'webfontloader'
|
|
||||||
|
|
||||||
class Head extends React.Component {
|
const Head = ({ meta }) => {
|
||||||
componentDidMount() {
|
const { title, tagline, description } = meta
|
||||||
WebFont.load({ typekit: { id: this.props.meta.typekit } })
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
return (
|
||||||
const { title, tagline, description } = this.props.meta
|
<Helmet
|
||||||
|
defaultTitle={`${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
|
||||||
|
titleTemplate={`%s // ${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
|
||||||
|
>
|
||||||
|
<meta name="description" content={description} />
|
||||||
|
|
||||||
return (
|
<meta content="noindex,nofollow" name="robots" />
|
||||||
<Helmet
|
</Helmet>
|
||||||
defaultTitle={`${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
|
)
|
||||||
titleTemplate={`%s // ${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
|
|
||||||
>
|
|
||||||
<meta name="description" content={description} />
|
|
||||||
|
|
||||||
<meta content="noindex,nofollow" name="robots" />
|
|
||||||
</Helmet>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Head.propTypes = {
|
Head.propTypes = {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
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'
|
||||||
@ -12,6 +13,8 @@ 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()}
|
||||||
|
Loading…
Reference in New Issue
Block a user