Merge pull request #34 from Permissionless-Software-Foundation/ct-unstable

fix(seo): Removing SEO component and unneeded pages
This commit is contained in:
Chris Troutner
2020-07-08 17:57:32 -07:00
committed by GitHub
4 changed files with 0 additions and 140 deletions
-88
View File
@@ -1,88 +0,0 @@
/**
* SEO component that queries for data with
* Gatsby's useStaticQuery React hook
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React from 'react'
import PropTypes from 'prop-types'
import { Helmet } from 'react-helmet'
import { useStaticQuery, graphql } from 'gatsby'
function SEO ({ description, lang, meta, title }) {
const { site } = useStaticQuery(
graphql`
query {
site {
siteMetadata {
title
description
author
}
}
}
`
)
const metaDescription = description || site.siteMetadata.description
return (
<Helmet
htmlAttributes={{
lang
}}
title={title}
titleTemplate={`%s | ${site.siteMetadata.title}`}
meta={[
{
name: 'description',
content: metaDescription
},
{
property: 'og:title',
content: title
},
{
property: 'og:description',
content: metaDescription
},
{
property: 'og:type',
content: 'website'
},
{
name: 'twitter:card',
content: 'summary'
},
{
name: 'twitter:creator',
content: site.siteMetadata.author
},
{
name: 'twitter:title',
content: title
},
{
name: 'twitter:description',
content: metaDescription
}
].concat(meta)}
/>
)
}
SEO.defaultProps = {
lang: 'en',
meta: [],
description: ''
}
SEO.propTypes = {
description: PropTypes.string,
lang: PropTypes.string,
meta: PropTypes.arrayOf(PropTypes.object),
title: PropTypes.string.isRequired
}
export default SEO
-2
View File
@@ -1,11 +1,9 @@
import React from 'react'
import Layout from '../components/layout'
import Seo from '../components/seo'
const NotFoundPage = () => (
<Layout>
<Seo title='404: Not found' />
<h1>NOT FOUND</h1>
<p>You just hit a route that doesn&#39;t exist... the sadness.</p>
</Layout>
-16
View File
@@ -1,16 +0,0 @@
import React from 'react'
import { Link } from 'gatsby'
import Layout from '../components/layout'
import Seo from '../components/seo'
const SecondPage = () => (
<Layout>
<Seo title='Page two' />
<h1>Hi from the second page</h1>
<p>Welcome to page 2</p>
<Link to='/'>Go back to the homepage</Link>
</Layout>
)
export default SecondPage
-34
View File
@@ -1,34 +0,0 @@
// If you don't want to use TypeScript you can delete this file!
import React from "react"
import { PageProps, Link, graphql } from "gatsby"
import Layout from "../components/layout"
import SEO from "../components/seo"
type DataProps = {
site: {
buildTime: string
}
}
const UsingTypescript: React.FC<PageProps<DataProps>> = ({ data, path }) => (
<Layout>
<SEO title="Using TypeScript" />
<h1>Gatsby supports TypeScript by default!</h1>
<p>This means that you can create and write <em>.ts/.tsx</em> files for your pages, components etc. Please note that the <em>gatsby-*.js</em> files (like gatsby-node.js) currently don't support TypeScript yet.</p>
<p>For type checking you'll want to install <em>typescript</em> via npm and run <em>tsc --init</em> to create a <em>.tsconfig</em> file.</p>
<p>You're currently on the page "{path}" which was built on {data.site.buildTime}.</p>
<p>To learn more, head over to our <a href="https://www.gatsbyjs.org/docs/typescript/">documentation about TypeScript</a>.</p>
<Link to="/">Go back to the homepage</Link>
</Layout>
)
export default UsingTypescript
export const query = graphql`
{
site {
buildTime(formatString: "YYYY-MM-DD hh:mm a z")
}
}
`