Skip to content

Commit

Permalink
Merge pull request #14 from reflexer-labs/seo-fix
Browse files Browse the repository at this point in the history
Seo fix
  • Loading branch information
mstfash authored Jan 15, 2021
2 parents 5e0c660 + 8c660d5 commit 6dd37a2
Show file tree
Hide file tree
Showing 8 changed files with 14,835 additions and 24 deletions.
2 changes: 1 addition & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = {
},
plugins: [
"gatsby-plugin-styled-components",
"gatsby-plugin-sitemap",
{
resolve: "gatsby-source-filesystem",
options: {
Expand All @@ -34,5 +33,6 @@ module.exports = {
"gatsby-transformer-remark",
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
`gatsby-plugin-react-helmet`,
],
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@
"babel-plugin-styled-components": "^1.11.1",
"dotenv": "^8.2.0",
"gatsby": "^2.24.79",
"gatsby-plugin-react-helmet": "^3.8.0",
"gatsby-plugin-sharp": "^2.6.43",
"gatsby-plugin-sitemap": "^2.4.17",
"gatsby-plugin-styled-components": "^3.3.14",
"gatsby-source-contentful": "^3.0.3",
"gatsby-source-filesystem": "^2.3.35",
"gatsby-transformer-remark": "^2.8.46",
"gatsby-transformer-sharp": "^2.5.20",
"gh-pages": "^3.1.0",
"jsonp": "^0.2.1",
"moment": "^2.29.1",
"query-string": "^6.13.6",
"react": "^16.12.0",
"react-cookie-consent": "^5.2.0",
"react-dom": "^16.12.0",
"react-feather": "^2.0.8",
"react-helmet": "^6.1.0",
"react-helmet": "^5.2.1",
"react-stickynode": "^3.0.4",
"react-use": "^15.3.4",
"styled-components": "^5.2.0",
"gh-pages": "^3.1.0"
"styled-components": "^5.2.0"
},
"devDependencies": {
"prettier": "2.1.2"
Expand Down
32 changes: 17 additions & 15 deletions src/components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from "react"
import styled, { ThemeProvider } from "styled-components"
import Header from "./Header"
import Footer from "./Footer"
import SiteMetadata from "./SiteMetadata"
import { lightTheme } from "../utils/themes/light"
import CookieBanner from "./CookieBanner"
import SEO from "./SEO"

const Layout = ({
children,
Expand All @@ -16,20 +16,22 @@ const Layout = ({
location,
}) => {
return (
<ThemeProvider theme={lightTheme}>
<SiteMetadata customTitle={customTitle} />
<MainContainer>
<Header
headerStyle={headerStyle}
isWhiteLogo={isWhiteLogo}
smallLogo={smallLogo}
onlyBrand={onlyBrand}
/>
{children}
<Footer location={location} />
<CookieBanner />
</MainContainer>
</ThemeProvider>
<>
<SEO customTitle={customTitle} />
<ThemeProvider theme={lightTheme}>
<MainContainer>
<Header
headerStyle={headerStyle}
isWhiteLogo={isWhiteLogo}
smallLogo={smallLogo}
onlyBrand={onlyBrand}
/>
{children}
<Footer location={location} />
<CookieBanner />
</MainContainer>
</ThemeProvider>
</>
)
}

Expand Down
9 changes: 5 additions & 4 deletions src/components/SiteMetadata.js → src/components/SEO.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Helmet } from "react-helmet"
import useSiteMetadata from "../hooks/useSiteMetadata"
import getPrefixedPath from "../utils/getPrefixPath"

const SiteMetadata = ({ pathname = "", customTitle }) => {
const SEO = ({ pathname = "", customTitle }) => {
const {
siteUrl,
title: mainTitle,
Expand All @@ -16,9 +16,10 @@ const SiteMetadata = ({ pathname = "", customTitle }) => {

const href = `${siteUrl}${pathname}`
const title = customTitle ? `Reflexer Labs | ${customTitle}` : mainTitle
console.log(twitter, favicon, image, description, titleTemplate, mainTitle)

return (
<Helmet title={title} titleTemplate={titleTemplate}>
<Helmet title={title} titleTemplate={titleTemplate} defer={false}>
<link rel="canonical" href={href} />
<link rel="icon" href={`${getPrefixedPath(favicon)}`} />
<link
Expand All @@ -31,7 +32,7 @@ const SiteMetadata = ({ pathname = "", customTitle }) => {
name="viewport"
content="width=device-width,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"
/>

<meta property="og:title" content={title} />
<meta property="og:url" content={href} />
<meta property="og:type" content="website" />
<meta property="og:site_name" content={title} />
Expand All @@ -50,4 +51,4 @@ const SiteMetadata = ({ pathname = "", customTitle }) => {
)
}

export default SiteMetadata
export default SEO
2 changes: 2 additions & 0 deletions src/components/SplitView.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const SplitView = ({ data, topOffset, isAbout = false }) => {
key={iterator.link + Math.random()}
href={iterator.link}
target="_blank"
rel="noreferrer"
>
{iterator.name} <img src={getPrefixedPath("/arrow-up.svg")} alt="" />
</CustomLink>
Expand All @@ -101,6 +102,7 @@ const SplitView = ({ data, topOffset, isAbout = false }) => {
? getPrefixedPath(node.data.uri)
: node.data.uri
}
rel="noreferrer"
target={
node.data.uri.includes("mailto") ||
node.data.uri.includes("zip")
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/FAQsCollapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const FAQsCollapse = () => {
return (
<a
href={node.data.uri}
rel="noreferrer"
target={node.data.uri.includes("mailto") ? "" : "_blank"}
>
{node.content[0].value}
Expand Down
41 changes: 41 additions & 0 deletions src/hooks/useBugBounty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { graphql, useStaticQuery } from "gatsby"

export default function useBugBounty() {
const { allContentfulBugBounty } = useStaticQuery(graphql`
query BugBounty {
allContentfulBugBounty {
edges {
node {
title
content {
json
}
rewardTable {
very_low {
value
color
}
low {
value
color
}
moderate {
value
color
}
high {
value
color
}
severe {
value
color
}
}
}
}
}
}
`)
return allContentfulBugBounty.edges
}
Loading

0 comments on commit 6dd37a2

Please sign in to comment.