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

fix project nav

This commit is contained in:
Matthias Kretschmann 2018-04-22 18:56:31 +02:00
parent dc8d67b758
commit df60dcacf3
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 14 additions and 42 deletions

View File

@ -44,7 +44,7 @@ exports.createPages = ({ boundActionCreators, graphql }) => {
const slug = node.slug
createPage({
path: `/${slug}/`,
path: slug,
component: template,
context: {
slug,

View File

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

View File

@ -1,22 +1,18 @@
import React, { Fragment } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import Helmet from 'react-helmet'
import Typekit from './Typekit'
const Head = ({ meta }) => {
const { title, tagline, description, typekit } = meta
const { title, tagline, description } = meta
return (
<Fragment>
<Helmet
defaultTitle={`${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
titleTemplate={`%s // ${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
>
<meta name="description" content={description} />
<meta content="noindex,nofollow" name="robots" />
</Helmet>
<Typekit id={typekit} />
</Fragment>
<Helmet
defaultTitle={`${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
titleTemplate={`%s // ${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
>
<meta name="description" content={description} />
<meta content="noindex,nofollow" name="robots" />
</Helmet>
)
}

View File

@ -1,26 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import Helmet from 'react-helmet'
const TypekitScript = ({ id }) => (
<script>
{`
(function(d) {
var config = {
kitId: '${id}',
scriptTimeout: 3000,
async: true
},
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
})(document);
`}
</script>
)
const Typekit = props => <Helmet>{TypekitScript(props)}</Helmet>
export default Typekit
TypekitScript.propTypes = {
id: PropTypes.string.isRequired,
}

View File

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

View File

@ -25,7 +25,6 @@ body {
line-height: $line-height;
color: $font-color-base;
text-rendering: optimizeLegibility;
font-display: swap;
font-feature-settings: 'liga', 'kern';
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;