Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit d8dfb68

Browse files
authored
SEO - Audit and refresh (#208)
* Improvement to twitter / sharing image * New keyword structure * Keyword audit * remove extra spaces * 2 more minor
1 parent 4f2952e commit d8dfb68

21 files changed

Lines changed: 162 additions & 86 deletions

src/components/HelmetPlus.js

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,33 @@
33
import * as React from 'react'
44
import Helmet from 'react-helmet'
55

6+
// keywords on every page.
7+
const keywordsBase = [
8+
'bitcoin developer tools',
9+
'bitcoin cash developer resource',
10+
'bitcoin cash',
11+
'BCH SDK',
12+
'bitcoin sdk',
13+
'bitcoin cash api',
14+
'development tools',
15+
'blockchain development',
16+
'bitcoin development',
17+
'bch developer',
18+
]
19+
620
type Props = {
721
title: string,
822
description?: string,
923
image?: string,
10-
keywords?: string,
11-
location: { pathname: string },
24+
keywords?: string[],
25+
location: { pathname: string, origin: string },
1226
children?: React.Node,
1327
}
1428
class HelmetPlus extends React.PureComponent<Props> {
29+
static defaultProps = {
30+
keywords: [],
31+
}
32+
1533
render() {
1634
const {
1735
title,
@@ -24,12 +42,21 @@ class HelmetPlus extends React.PureComponent<Props> {
2442

2543
return (
2644
<Helmet>
45+
{/* General tags */}
46+
<meta charSet="utf-8" />
2747
{title && <title>{title}</title>}
2848
{description && <meta name="description" content={description} />}
29-
{keywords && <meta name="keywords" content={keywords} />}
30-
{image && <meta name="image" content={image} />}
31-
32-
{/* og meta */}
49+
{keywords ? (
50+
<meta
51+
name="keywords"
52+
content={[...keywords, ...keywordsBase].join(', ')}
53+
/>
54+
) : (
55+
<meta name="keywords" content={keywordsBase.join(', ')} />
56+
)}
57+
<meta name="image" content={`${location.origin}/favicon.png`} />}
58+
{image && <meta name="image" content={`${location.origin}${image}`} />}
59+
{/* OpenGraph OG meta */}
3360
{location && (
3461
<meta
3562
property="og:url"
@@ -40,16 +67,21 @@ class HelmetPlus extends React.PureComponent<Props> {
4067
{description && (
4168
<meta property="og:description" content={description} />
4269
)}
43-
{image && <meta property="og:image" content={image} />}
44-
70+
<meta name="og:image" content={`${location.origin}/favicon.png`} />}
71+
{image && (
72+
<meta property="og:image" content={`${location.origin}${image}`} />
73+
)}
4574
{/* twitter meta */}
4675
<meta name="twitter:card" content="summary" />
4776
{title && <meta name="twitter:title" content={title} />}
4877
{description && (
4978
<meta name="twitter:description" content={description} />
5079
)}
51-
{image && <meta name="twitter:image" content={image} />}
52-
80+
<meta name="twitter:image" content={`${location.origin}/favicon.png`} />
81+
}
82+
{image && (
83+
<meta name="twitter:image" content={`${location.origin}${image}`} />
84+
)}
5385
{children}
5486
</Helmet>
5587
)

src/components/layouts/DefaultLayout.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@ const DefaultLayout = ({ children, location }: Props) => (
4242
<HelmetPlus
4343
title={data.site.siteMetadata.title}
4444
description={
45-
'BITBOX based bitcoin.com developer platform and resources'
46-
}
47-
keywords={
48-
'bitbox, developer tools, bitcoin, bitcoin cash, BCH, sdk, api, slp, development tools'
45+
'bitcoin.com developer platform, sdk and resources. Build on Bitcoin Cash (BCH)'
4946
}
5047
location={location}
51-
image={Favicon}
5248
>
5349
<meta charSet="utf-8" />
5450
<script>

src/pages/about.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ const About = ({ location, data }: Props) => (
5353
<HelmetPlus
5454
title={`About - ${data.site.siteMetadata.title}`}
5555
description={
56-
'Bitcoin.com developer platform. Developer Tooling, Resources, Cloud, and Marker'
57-
}
58-
keywords={
59-
'about, bitbox, tutorials, developer tools, bitcoin, bitcoin cash, BCH, sdk, api'
56+
'Bitcoin.com developer platform. Developer Tooling, Resources, Cloud, and Market'
6057
}
58+
keywords={['about page']}
6159
location={location}
6260
/>
6361
<Hero image={data.heroImage}>

src/pages/badger.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,19 @@ const BadgerPage = ({ location, data }: Props) => (
8989
description={
9090
'Badger documentation, your gateway to the world of Bitcoin Cash (BCH) applications'
9191
}
92-
keywords={
93-
'bagder, bitbox, developer tools, bitcoin, bitcoin cash, BCH, sdk, api'
94-
}
92+
keywords={[
93+
'badger',
94+
'badger sdk',
95+
'badger wallet',
96+
'SLP tokens',
97+
'simple ledger protocol',
98+
]}
9599
location={location}
96100
/>
97101
<Hero image={data.heroImage}>
98102
<HeroLayout>
99103
<H3 primary thin>
100-
The easiest way to use BCH apps
104+
The easiest way to build BCH apps
101105
</H3>
102106
<H1 background>Badger SDK</H1>
103107
<H3 background thin>

src/pages/bitbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const BitboxPage = ({ location, data }: Props) => (
7878
<HelmetPlus
7979
title={`Bitbox - ${data.site.siteMetadata.title}`}
8080
description={'Bitbox based bitcoin.com developer platform and resources'}
81-
keywords={'bitbox, developer tools, bitcoin, bitcoin cash, BCH, sdk, api'}
81+
keywords={['bitbox', 'bitbox sdk', 'learn bitbox', 'bitbox development']}
8282
location={location}
8383
/>
8484
<Hero image={data.heroImage}>

src/pages/develop.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ const DevelopPage = ({ location, data }: Props) => (
4343
description={
4444
'Development hub for all your development needs to be successful on Bitcoin Cash (BCH)'
4545
}
46-
keywords={
47-
'bitbox, tutorials, developer tools, bitcoin, bitcoin cash, BCH, sdk, api'
48-
}
46+
keywords={[
47+
'develop on bitcoin',
48+
'develop on bitcoin cash',
49+
'bitcoin cash resources',
50+
]}
4951
location={location}
5052
/>
5153
<Hero image={data.heroImage}>

src/pages/faq.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ const FAQ = ({ location, data }: Props) => (
5555
description={
5656
'Bitcoin.com developer platform. Developer Tooling, Resources, Cloud, and Marker'
5757
}
58-
keywords={
59-
'about, bitbox, tutorials, developer tools, bitcoin, bitcoin cash, BCH, sdk, api'
60-
}
6158
location={location}
6259
/>
6360
<Hero image={data.heroImage}>

src/pages/faucets.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ const Faucet = ({ location, data }: Props) => (
4242
<HelmetPlus
4343
title={`Faucet - ${data.site.siteMetadata.title}`}
4444
description={'Testnet BCH for developers'}
45-
keywords={
46-
'faucet, bitbox, tutorials, developer tools, bitcoin, bitcoin cash, BCH, sdk, api'
47-
}
45+
keywords={[
46+
'bch faucet',
47+
'bitcoin cash faucet',
48+
'testnet faucet',
49+
'bitcoin cash testnet faucet',
50+
'testnet bch',
51+
]}
4852
location={location}
4953
/>
5054
<Hero image={data.heroImage}>

src/pages/faucets/bch.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ const Faucet = ({ location, data }: Props) => (
3131
<HelmetPlus
3232
title={`Testnet BCH Faucet - ${data.site.siteMetadata.title}`}
3333
description={'Testnet BCH for developers'}
34-
keywords={
35-
'faucet, bitbox, tutorials, developer tools, bitcoin, bitcoin cash, BCH, sdk, api'
36-
}
34+
keywords={[
35+
'bch faucet',
36+
'bitcoin cash faucet',
37+
'testnet faucet',
38+
'bitcoin cash testnet faucet',
39+
'testnet bch',
40+
]}
3741
location={location}
3842
/>
3943
<Hero image={data.heroImage}>

src/pages/gui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const GuiPage = ({ location, data }: Props) => (
7878
<HelmetPlus
7979
title={`GUI - ${data.site.siteMetadata.title}`}
8080
description={'GUI based bitcoin.com developer platform and resources'}
81-
keywords={'GUI, developer tools, bitcoin, bitcoin cash, BCH, sdk, api'}
81+
keywords={['gui']}
8282
location={location}
8383
/>
8484
<Hero image={data.heroImage}>

0 commit comments

Comments
 (0)