Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/BlogPage/BlogContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -44,6 +44,7 @@ const Blog = () => {
title={seo?.pageTitle}
description={seo?.pageDescription}
keywords={seo?.pageKeywords}
location={location}
/>
<Banner data={banner} />

Expand Down
15 changes: 7 additions & 8 deletions src/components/Seo/Seo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}`
}

]}
Expand All @@ -99,14 +96,16 @@ Seo.defaultProps = {
lang: `en`,
meta: [],
description: ``,
location: null,
}

Seo.propTypes = {
description: PropTypes.string,
lang: PropTypes.string,
meta: PropTypes.arrayOf(PropTypes.object),
title: PropTypes.string.isRequired,
keywords: PropTypes.string
keywords: PropTypes.string,
location: PropTypes.object,
}

export default Seo
7 changes: 5 additions & 2 deletions src/pages/blog.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from "react"
import BlogPage from "../components/BlogPage/BlogContainer"
import PropTypes from "prop-types"

const Blog = () => {
return <BlogPage />
const Blog = ( {location}) => <BlogPage location={location} />

Blog.propTypes = {
location: PropTypes.object.isRequired
}

export default Blog
2 changes: 1 addition & 1 deletion src/templates/LandingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const LandingPage = ({ data, location }) => {

return (
<Layout location={location} options={{ hasHeader: true }}>
<Seo title={pageTitle} description={pageDescription} keywords={pageKeywords} />
<Seo title={pageTitle} description={pageDescription} keywords={pageKeywords} location={location} />
{body?.length > 0 && navigation ? (
<>
<CustomSection sections={body.slice(0, 1)} />
Expand Down