Skip to content

Commit

Permalink
Fix SEO
Browse files Browse the repository at this point in the history
  • Loading branch information
portableant committed Jan 5, 2023
1 parent 5bccc01 commit 59fa83b
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 75 deletions.
2 changes: 1 addition & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
description: `Crowdfuelled archaeological research - how can you get involved?.`,
twitterHandle: '@micropasts',
author: 'The MicroPasts Collective',
image: `/img.png`,
image: `/logo_social.jpg`,
og: {
siteName: 'MicroPasts - Crowd fuelled archaeology',
twitterCreator: '@micropasts',
Expand Down
45 changes: 0 additions & 45 deletions src/components/seo.js

This file was deleted.

27 changes: 16 additions & 11 deletions src/components/structure/collaborators.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ const Collaborators = () => {

<Row className="justify-content-center my-3">
<Col md={2} sm={2} className="col-md-2 text-center mx-2">
<StaticImage src={"../../images/logos/reading.jpg"} alt={"Egypt Exploration Society Logo"}
<StaticImage src={"../../images/logos/reading.jpg"} alt={"Reading University Logo"}
className="img-fluid mx-auto mb-3"
width={180} placeholder={"NONE"} quality={90} transformOptions={{ grayscale: true }} />
</Col>
<Col md={2} sm={2} className="text-center mx-2">
<StaticImage src={"../../images/logos/oxford.png"} alt={"Palestine Exploration Fund logo"}
<StaticImage src={"../../images/logos/oxford.png"} alt={"Oxford University logo"}

className="img-fluid mx-auto mb-3" width={100} placeholder={"NONE"} quality={90} />
</Col>
<Col md={2} sm={2} className="text-center mx-2">
<StaticImage src={"../../images/logos/nms.png"} alt={"Stirling University logo"}
<StaticImage src={"../../images/logos/nms.png"} alt={"National Museum of Scotland logo"}
transformOptions={{ grayscale: true }}
className="img-fluid mx-auto mb-3" width={160} placeholder={"NONE"} quality={90} />
</Col>
Expand All @@ -62,45 +62,45 @@ const Collaborators = () => {

<Row className="justify-content-center my-3">
<Col md={2} sm={2} className="col-md-2 text-center mx-2">
<StaticImage src={"../../images/logos/Durham_University_Logo.png"} alt={"Egypt Exploration Society Logo"}
<StaticImage src={"../../images/logos/Durham_University_Logo.png"} alt={"Durham University Logo"}
className="img-fluid mx-auto mb-3"
width={180} placeholder={"NONE"} quality={90} transformOptions={{ grayscale: true }} />
</Col>
<Col md={2} sm={2} className="text-center mx-2">
<StaticImage src={"../../images/logos/manchester.png"} alt={"Palestine Exploration Fund logo"}
<StaticImage src={"../../images/logos/manchester.png"} alt={"Manchester University logo"}
transformOptions={{ grayscale: true }}
className="img-fluid mx-auto mb-3" width={120} placeholder={"NONE"} quality={90} />
</Col>
<Col md={2} sm={2} className="text-center mx-2">
<StaticImage src={"../../images/logos/montpelier.jpg"} alt={"Stirling University logo"}
<StaticImage src={"../../images/logos/montpelier.jpg"} alt={"Montpelier Archaeology logo"}
transformOptions={{ grayscale: true }}
className="img-fluid mx-auto mb-3" width={160} placeholder={"NONE"} quality={90} />
</Col>
<Col md={2} sm={2} className="text-center mx-2">
<StaticImage src={"../../images/logos/fortSnelling.png"} alt={"English Heritage logo"}
<StaticImage src={"../../images/logos/fortSnelling.png"} alt={"Historic Fort Snelling logo"}
transformOptions={{ grayscale: true }}
className="img-fluid mx-auto mb-3" width={100} placeholder={"NONE"} quality={90} />
</Col>
<Col md={2} sm={2} className="text-center mx-2">
<StaticImage src={"../../images/logos/cua.png"} alt={"Denver Museum logo"}
<StaticImage src={"../../images/logos/cua.png"} alt={"Catholic University Americalogo"}
transformOptions={{ grayscale: true }}
className="img-fluid mx-auto mb-3" height={70} placeholder={"NONE"} quality={90} />
</Col>
</Row>

<Row className="justify-content-center my-3">
<Col md={2} sm={2} className="col-md-2 text-center mx-2">
<StaticImage src={"../../images/logos/Society_of_Antiquaries_of_London_logomark.png"} alt={"Egypt Exploration Society Logo"}
<StaticImage src={"../../images/logos/Society_of_Antiquaries_of_London_logomark.png"} alt={"Society of Antiquaries Logo"}
className="img-fluid mx-auto mb-3"
width={180} placeholder={"NONE"} quality={90} transformOptions={{ grayscale: true }} />
</Col>
<Col md={2} sm={2} className="text-center mx-2">
<StaticImage src={"../../images/logos/mary-rose.jpg"} alt={"Palestine Exploration Fund logo"}
<StaticImage src={"../../images/logos/mary-rose.jpg"} alt={"Mary Rose Trust logo"}
transformOptions={{ grayscale: true }}
className="img-fluid mx-auto mb-3" width={120} placeholder={"NONE"} quality={90} />
</Col>
<Col md={2} sm={2} className="text-center mx-2">
<StaticImage src={"../../images/logos/logo-museo-egizio.jpg"} alt={"Stirling University logo"}
<StaticImage src={"../../images/logos/logo-museo-egizio.jpg"} alt={"Museo Egizio logo"}
transformOptions={{ grayscale: true }}
className="img-fluid mx-auto mb-3" width={160} placeholder={"NONE"} quality={90} />
</Col>
Expand All @@ -109,6 +109,11 @@ const Collaborators = () => {
className="img-fluid mx-auto mb-3" height={70} transformOptions={{ grayscale: true }}
placeholder={"NONE"} quality={90} />
</Col>
<Col md={2} sm={2} className="text-center mx-2">
<StaticImage src={"../../images/logos/spalogocmykpaths-290x300.png"} alt={"Scottish Political Archives logo"}
className="img-fluid mx-auto mb-3" height={70} transformOptions={{ grayscale: true }}
placeholder={"NONE"} quality={90} />
</Col>

</Row>
</Col>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
import React from "react";
import { useSiteMetadata } from "../../hooks/use-site-metadata";

function createSeoImage(featured, image) {
if (featured) {
return featured?.childImageSharp.gatsbyImageData.images.fallback.src;
}
return image;
}

const Seo = ({ title, description, pathname, children, featured }) => {
const Seo = ({ title, description, pathname, children }) => {
const { title: defaultTitle, description: defaultDescription, image, siteUrl, twitterHandle } = useSiteMetadata();
console.log(featured);
const featuredImage = createSeoImage(featured, image);
const seo = {
title: title || defaultTitle,
description: description || defaultDescription,
image: `${siteUrl}${featuredImage}`,
image: `${siteUrl}${image}`,
url: `${siteUrl}${pathname || ``}`,
twitterHandle
};


return (
<>
<title>{seo.title}</title>
<meta name="description" content={seo.description} />
<meta name="image" content={seo.image} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={seo.title} />
<meta name="twitter:url" content={seo.url} />
<meta name="twitter:url" content={seo.url.toString()} />
<meta name="twitter:description" content={seo.description} />
<meta name="twitter:image" content={seo.image} />
<meta name="twitter:image" content={seo.image.toString()} />
<meta name="twitter:creator" content={seo.twitterHandle} />
<meta property="og:url" content={seo.url.toString()} />
<meta property="og:title" content={seo.title} />
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/use-site-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const useSiteMetadata = () => {
title
description
twitterHandle
image
image
siteUrl
}
}
Expand Down
Binary file added src/images/logos/spalogocmykpaths-290x300.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/pages/404.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react"

import Layout from "../components/layout"
import Seo from "../components/seo"
import Seo from "../components/structure/seo"

const NotFoundPage = () => (
<Layout>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react"
import Layout from "../components/layout"
import Seo from "../components/seo"
import Seo from "../components/structure/seo"
import CtaInvolved from "../components/structure/cta-involved";
import WhyUs from "../components/structure/why-us";
import OurTeam from "../components/structure/our-team";
Expand All @@ -23,6 +23,6 @@ const IndexPage = () => (
*
* See: https://www.gatsbyjs.com/docs/reference/built-in-components/gatsby-head/
*/
export const Head = () => <Seo title="Home" />
export const Head = () => <Seo title="Home - MicroPasts" description={'MicroPasts - a crowdfuelled archaeological and heritage citizen science platform'}/>

export default IndexPage
Binary file added static/logo_social.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 59fa83b

Please sign in to comment.