diff --git a/src/components/BlogPage/BlogContainer.js b/src/components/BlogPage/BlogContainer.js index d53629d..624ce2d 100644 --- a/src/components/BlogPage/BlogContainer.js +++ b/src/components/BlogPage/BlogContainer.js @@ -7,7 +7,7 @@ import Layout from "../layout" import Banner from "../Banner/Banner" import "./BlogContainer.scss" -const Blog = () => { +const Blog = ({location}) => { const { allStrapiBlogCategory, allStrapiArticle, allStrapiBlogPage } = useBlog() const categorias = allStrapiBlogCategory.nodes const articulos = allStrapiArticle.nodes @@ -44,6 +44,7 @@ const Blog = () => { title={seo?.pageTitle} description={seo?.pageDescription} keywords={seo?.pageKeywords} + location={location} /> diff --git a/src/components/Seo/Seo.js b/src/components/Seo/Seo.js index 40a5e52..2489d91 100644 --- a/src/components/Seo/Seo.js +++ b/src/components/Seo/Seo.js @@ -3,9 +3,10 @@ import PropTypes from "prop-types" import { Helmet } from "react-helmet" import { useGlobalSeo } from "../../hooks" -function Seo({ description, lang, meta, title, keywords }) { +function Seo({ description, lang, meta, title, keywords, location }) { const data = useGlobalSeo() + const pathname = location?.pathname || "/" const { author, robots, @@ -77,17 +78,13 @@ function Seo({ description, lang, meta, title, keywords }) { }, ].concat(meta)} link={[ - { - rel: "canonical", - href: `https://bitlogic.io` - }, { rel: "alternate", - href: `https://en.bitlogic.io` + href: `https://bitlogic${pathname}` }, { rel: "alternate", - href: `https://www.bitlogic.io` + href: `https://www.bitlogic.io${pathname}` } ]} @@ -99,6 +96,7 @@ Seo.defaultProps = { lang: `en`, meta: [], description: ``, + location: null, } Seo.propTypes = { @@ -106,7 +104,8 @@ Seo.propTypes = { lang: PropTypes.string, meta: PropTypes.arrayOf(PropTypes.object), title: PropTypes.string.isRequired, - keywords: PropTypes.string + keywords: PropTypes.string, + location: PropTypes.object, } export default Seo diff --git a/src/pages/blog.js b/src/pages/blog.js index 5916ea4..8dddc72 100644 --- a/src/pages/blog.js +++ b/src/pages/blog.js @@ -1,8 +1,11 @@ import React from "react" import BlogPage from "../components/BlogPage/BlogContainer" +import PropTypes from "prop-types" -const Blog = () => { - return +const Blog = ( {location}) => + +Blog.propTypes = { + location: PropTypes.object.isRequired } export default Blog diff --git a/src/templates/LandingPage.js b/src/templates/LandingPage.js index ecc1e9b..9e5b589 100644 --- a/src/templates/LandingPage.js +++ b/src/templates/LandingPage.js @@ -20,7 +20,7 @@ const LandingPage = ({ data, location }) => { return ( - + {body?.length > 0 && navigation ? ( <>