1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-06-29 00:57:41 +02: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 const slug = node.slug
createPage({ createPage({
path: `/${slug}/`, path: slug,
component: template, component: template,
context: { context: {
slug, slug,

View File

@ -24,7 +24,8 @@
"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",
"react-typekit": "^1.1.3"
}, },
"devDependencies": { "devDependencies": {
"babel-eslint": "^8.2.3", "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 PropTypes from 'prop-types'
import Helmet from 'react-helmet' import Helmet from 'react-helmet'
import Typekit from './Typekit'
const Head = ({ meta }) => { const Head = ({ meta }) => {
const { title, tagline, description, typekit } = meta const { title, tagline, description } = meta
return ( return (
<Fragment> <Helmet
<Helmet defaultTitle={`${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
defaultTitle={`${title.toLowerCase()} { ${tagline.toLowerCase()} }`} titleTemplate={`%s // ${title.toLowerCase()} { ${tagline.toLowerCase()} }`}
titleTemplate={`%s // ${title.toLowerCase()} { ${tagline.toLowerCase()} }`} >
> <meta name="description" content={description} />
<meta name="description" content={description} /> <meta content="noindex,nofollow" name="robots" />
<meta content="noindex,nofollow" name="robots" /> </Helmet>
</Helmet>
<Typekit id={typekit} />
</Fragment>
) )
} }

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 React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Typekit from 'react-typekit'
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,7 @@ const TemplateWrapper = ({ data, location, children }) => {
return ( return (
<div className="app"> <div className="app">
<Head meta={meta} /> <Head meta={meta} />
<Typekit kitId={meta.typekit} />
<Header meta={meta} isHomepage={isHomepage} /> <Header meta={meta} isHomepage={isHomepage} />
{children()} {children()}

View File

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