mirror of
https://github.com/kremalicious/portfolio.git
synced 2024-12-22 17:23:22 +01:00
fix project nav
This commit is contained in:
parent
dc8d67b758
commit
df60dcacf3
@ -44,7 +44,7 @@ exports.createPages = ({ boundActionCreators, graphql }) => {
|
||||
const slug = node.slug
|
||||
|
||||
createPage({
|
||||
path: `/${slug}/`,
|
||||
path: slug,
|
||||
component: template,
|
||||
context: {
|
||||
slug,
|
||||
|
@ -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",
|
||||
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
}
|
@ -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()}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user