diff --git a/gatsby-config.js b/gatsby-config.js
index 84e0562..746abe7 100644
--- a/gatsby-config.js
+++ b/gatsby-config.js
@@ -13,12 +13,6 @@ module.exports = {
siteUrl,
},
plugins: [
- {
- resolve: 'gatsby-plugin-canonical-urls',
- options: {
- siteUrl,
- },
- },
{
resolve: 'gatsby-plugin-alias-imports',
options: {
diff --git a/package.json b/package.json
index e4c41f0..bf7fd68 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,6 @@
"gatsby": "^2.19.45",
"gatsby-image": "^2.2.44",
"gatsby-plugin-alias-imports": "^1.0.5",
- "gatsby-plugin-canonical-urls": "^2.2.1",
"gatsby-plugin-google-analytics": "^2.2.2",
"gatsby-plugin-manifest": "^2.2.48",
"gatsby-plugin-material-ui": "^2.1.6",
diff --git a/src/components/SEO.jsx b/src/components/SEO.jsx
index 1e62c0b..730c573 100644
--- a/src/components/SEO.jsx
+++ b/src/components/SEO.jsx
@@ -6,14 +6,15 @@
*/
import React from 'react';
-import { arrayOf, object, string } from 'prop-types';
+import { node, string } from 'prop-types';
import Helmet from 'react-helmet';
import { useStaticQuery, graphql } from 'gatsby';
const SEO = ({
+ children,
description,
lang,
- meta,
+ location,
title,
}) => {
const { site, metaImageDefault } = useStaticQuery(
@@ -41,63 +42,41 @@ const SEO = ({
const metaDescription = description || site.siteMetadata.description;
- // the image url has to be an absolute url with http:// or https://
- // relative links do not work
- const metaImage = site.siteMetadata.siteUrl.concat(metaImageDefault.childImageSharp.fixed.src);
+ const canonical = `${site.siteMetadata.siteUrl}${location.pathname}`;
+ const metaImage = `${site.siteMetadata.siteUrl}${metaImageDefault.childImageSharp.fixed.src}`;
return (
-
You just hit a route that doesn't exist....
diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 37ec475..62c64e5 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -10,12 +10,12 @@ import PageWrapper from 'Layouts/PageWrapper'; import useStyles from 'Styles/pages/home'; -const IndexPage = () => { +const IndexPage = ({ location }) => { const classes = useStyles(); return (