-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from bradgarropy/seo
🔍 seo
- Loading branch information
Showing
30 changed files
with
203 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,20 @@ const dtxcChannelId = "UCpbIlFaiv-3188nAWtgL0Iw" | |
|
||
module.exports = { | ||
siteMetadata: { | ||
siteUrl: "https://dailytexascountry.com", | ||
title: "DTXC", | ||
description: "🤠 daily texas country", | ||
keywords: ["gatsby", "react", "scss", "eslint"], | ||
url: "https://dailytexascountry.com", | ||
title: "Daily Texas Country", | ||
description: "🤠 Daily Texas Country", | ||
keywords: [ | ||
"dtxc", | ||
"dailytexascountry", | ||
"daily texas country", | ||
"texas", | ||
"country", | ||
"music", | ||
"texas country", | ||
"country music", | ||
"texas country music", | ||
], | ||
email: "[email protected]", | ||
twitter: "dailytxcountry", | ||
youtube: dtxcChannelId, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,24 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
import {useStaticQuery, graphql} from "gatsby" | ||
import Helmet from "react-helmet" | ||
import icon from "../../../static/icon.png" | ||
|
||
const Meta = ({title}) => { | ||
const data = useStaticQuery(graphql` | ||
{ | ||
site { | ||
siteMetadata { | ||
description | ||
keywords | ||
} | ||
} | ||
} | ||
`) | ||
|
||
const {description, keywords} = data.site.siteMetadata | ||
import PropTypes from "prop-types" | ||
|
||
const Meta = ({title = "", description = "", keywords = [], icon = ""}) => { | ||
return ( | ||
<Helmet> | ||
<html lang="en"/> | ||
<html lang="en" /> | ||
<title>{title}</title> | ||
<meta name="description" content={description}/> | ||
<meta name="keywords" content={keywords}/> | ||
<link rel="icon" type="image/png" href={icon}/> | ||
<meta name="description" content={description} /> | ||
<meta name="keywords" content={keywords.join(",")} /> | ||
<link rel="icon" type="image/png" href={icon} /> | ||
</Helmet> | ||
) | ||
} | ||
|
||
Meta.propTypes = { | ||
title: PropTypes.string, | ||
description: PropTypes.string, | ||
keywords: PropTypes.arrayOf(PropTypes.string), | ||
icon: PropTypes.string, | ||
} | ||
|
||
export default Meta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
import Meta from "./Meta" | ||
import Twitter from "./Twitter" | ||
import Facebook from "./Facebook" | ||
import {useSiteMetadata} from "../../hooks" | ||
|
||
const SEO = ({path = "", title = "", description = "", image = ""}) => { | ||
const meta = useSiteMetadata() | ||
|
||
const defaultUrl = meta.url | ||
const defaultTitle = meta.title | ||
const defaultTwitterImage = `${meta.url}/twitter.png` | ||
const defaultFacebookImage = `${meta.url}/facebook.png` | ||
|
||
const seoImage = `${meta.url}${image}` | ||
const seoUrl = `${meta.url}${path}` | ||
|
||
return ( | ||
<> | ||
<Meta | ||
title={title || defaultTitle} | ||
description={description} | ||
keywords={meta.keywords} | ||
icon={`${meta.url}/favicon.png`} | ||
/> | ||
|
||
url={path ? seoUrl : defaultUrl} | ||
title={title || defaultTitle} | ||
description={description} | ||
image={image ? seoImage : defaultFacebookImage} | ||
/> | ||
|
||
site={meta.twitter} | ||
title={title || defaultTitle} | ||
description={description} | ||
image={image ? seoImage : defaultTwitterImage} | ||
/> | ||
</> | ||
) | ||
} | ||
|
||
SEO.propTypes = { | ||
path: PropTypes.string, | ||
title: PropTypes.string, | ||
description: PropTypes.string, | ||
image: PropTypes.string, | ||
} | ||
|
||
export default SEO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export {default as SEO} from "./SEO" | ||
export {default as Meta} from "./Meta" | ||
export {default as Twitter} from "./Twitter" | ||
export {default as Facebook} from "./Facebook" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ const useSiteMetadata = () => { | |
{ | ||
site { | ||
siteMetadata { | ||
siteUrl | ||
url | ||
title | ||
description | ||
keywords | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
import {SEO} from "../components/SEO" | ||
import Container from "../styles/Container" | ||
import {Meta, Twitter, Facebook} from "../components/SEO" | ||
|
||
const NotFoundPage = () => { | ||
const NotFoundPage = ({uri}) => { | ||
return ( | ||
<Container> | ||
<Meta title="not found" /> | ||
<Facebook /> | ||
<Twitter /> | ||
<SEO path={uri} title="404" /> | ||
|
||
<h1>NOT FOUND</h1> | ||
<p>You just hit a route that doesn't exist... the sadness.</p> | ||
<h1>Ya'll go to hell, and I'll go to Texas.</h1> | ||
<h1>- Davy Crockett</h1> | ||
</Container> | ||
) | ||
} | ||
|
||
NotFoundPage.propTypes = { | ||
uri: PropTypes.string.isRequired, | ||
} | ||
|
||
export default NotFoundPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
import {useAbout} from "../hooks" | ||
import {SEO} from "../components/SEO" | ||
import Container from "../styles/Container" | ||
import {Meta, Twitter, Facebook} from "../components/SEO" | ||
|
||
const AboutPage = () => { | ||
const AboutPage = ({uri}) => { | ||
const {html} = useAbout() | ||
|
||
return ( | ||
<Container> | ||
<Meta title="about" /> | ||
<Facebook /> | ||
<Twitter /> | ||
<SEO path={uri} title="About" /> | ||
|
||
<div dangerouslySetInnerHTML={{__html: html}} /> | ||
</Container> | ||
) | ||
} | ||
|
||
AboutPage.propTypes = { | ||
uri: PropTypes.string.isRequired, | ||
} | ||
|
||
export default AboutPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
import {useEpisodes} from "../hooks" | ||
import {SEO} from "../components/SEO" | ||
import Container from "../styles/Container" | ||
import Episodes from "../components/Episodes/Episodes" | ||
import {Meta, Twitter, Facebook} from "../components/SEO" | ||
|
||
const EpisodesPage = () => { | ||
const EpisodesPage = ({uri}) => { | ||
const episodes = useEpisodes({limit: 5}) | ||
|
||
return ( | ||
<Container> | ||
<Meta title="episodes" /> | ||
<Facebook /> | ||
<Twitter /> | ||
<SEO path={uri} title="Episodes" /> | ||
|
||
<h1>episodes</h1> | ||
<Episodes episodes={episodes} /> | ||
</Container> | ||
) | ||
} | ||
|
||
EpisodesPage.propTypes = { | ||
uri: PropTypes.string.isRequired, | ||
} | ||
|
||
export default EpisodesPage |
Oops, something went wrong.