diff --git a/gatsby-config.js b/gatsby-config.js index a5fa093..7bb8013 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -8,12 +8,9 @@ module.exports = { plugins: [ 'gatsby-plugin-react-next', 'gatsby-plugin-react-helmet', - 'gatsby-plugin-sitemap', 'gatsby-transformer-json', - 'gatsby-transformer-sharp', - 'gatsby-plugin-sharp', 'gatsby-plugin-offline', - 'gatsby-plugin-sitemap', + 'gatsby-plugin-remove-trailing-slashes', { resolve: 'gatsby-plugin-sass', options: { @@ -30,13 +27,6 @@ module.exports = { path: `${__dirname}/data/`, } }, - { - resolve: 'gatsby-source-filesystem', - options: { - name: 'images', - path: `${__dirname}/src/images`, - } - }, { resolve: 'gatsby-plugin-google-analytics', options: { diff --git a/gatsby-node.js b/gatsby-node.js index ee6643b..90278a1 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -4,7 +4,7 @@ exports.createPages = ({ boundActionCreators, graphql }) => { const { createPage } = boundActionCreators return new Promise((resolve, reject) => { - const template = path.resolve('src/components/organisms/Project.js') + const template = path.resolve('src/templates/Project.js') resolve(graphql(` { @@ -40,27 +40,14 @@ exports.createPages = ({ boundActionCreators, graphql }) => { reject(result.errors) } - result.data.allProjectsJson.edges.forEach( - ({ node, previous, next }) => { + result.data.allProjectsJson.edges.forEach(({ node, previous, next }) => { const slug = node.slug - const title = node.title - const img = node.img - const img_more = node.img_more - const description = node.description - const links = node.links - const techstack = node.techstack createPage({ - path: slug, + path: `/${slug}/`, component: template, context: { - title, slug, - img, - img_more, - description, - techstack, - links, previous, next, }, @@ -73,6 +60,20 @@ exports.createPages = ({ boundActionCreators, graphql }) => { }) } +// https://github.com/saschajullmann/gatsby-starter-gatsbythemes/blob/master/gatsby-node.js +exports.modifyWebpackConfig = ({ config, stage }) => { + switch (stage) { + case 'develop': + config.preLoader('eslint-loader', { + test: /\.(js|jsx)$/, + exclude: /node_modules/, + }) + + break + } + return config +} + // https://github.com/gatsbyjs/gatsby/issues/2285#issuecomment-333343938 exports.modifyWebpackConfig = ({ config, stage }) => { if (stage === 'build-html') { diff --git a/package.json b/package.json index c433613..518bb5e 100644 --- a/package.json +++ b/package.json @@ -4,18 +4,15 @@ "private": true, "dependencies": { "gatsby": "^1.9.253", - "gatsby-image": "^1.0.47", "gatsby-link": "^1.6.41", "gatsby-plugin-google-analytics": "^1.0.31", "gatsby-plugin-offline": "^1.0.15", "gatsby-plugin-react-helmet": "^2.0.11", "gatsby-plugin-react-next": "^1.0.11", + "gatsby-plugin-remove-trailing-slashes": "^1.0.9", "gatsby-plugin-sass": "^1.0.26", - "gatsby-plugin-sharp": "^1.6.43", - "gatsby-plugin-sitemap": "^1.2.22", "gatsby-source-filesystem": "^1.5.33", "gatsby-transformer-json": "^1.0.16", - "gatsby-transformer-sharp": "^1.6.23", "react-helmet": "^5.2.0", "react-markdown": "^3.3.0", "react-transition-group": "^2.3.1", diff --git a/src/components/atoms/Head.js b/src/components/atoms/Head.js index 80d685d..66023d8 100644 --- a/src/components/atoms/Head.js +++ b/src/components/atoms/Head.js @@ -9,14 +9,13 @@ class Head extends React.Component { } render() { - const { title, tagline, description, url } = this.props.meta + const { title, tagline, description } = this.props.meta return ( - diff --git a/src/components/molecules/Availability.js b/src/components/molecules/Availability.js index e5da2bc..f7021c2 100644 --- a/src/components/molecules/Availability.js +++ b/src/components/molecules/Availability.js @@ -6,18 +6,27 @@ import './Availability.scss' const Availability = ({ meta, hide }) => { const { availability, social } = meta - const available = `👔 Available for new projects. Let’s talk!` + const available = `👔 Available for new projects. Let’s talk!` const unavailable = 'Not available for new projects.' return ( {!hide && ( -