1
1
# A ` react-seo-component `
2
2
3
- [ ![ CodeFactor] ( https://www.codefactor.io/repository/github/spences10/react-seo-component/badge )] ( https://www.codefactor.io/repository/github/spences10/react-seo-component ) ![ bundlephobia min] ( https://badgen.net/bundlephobia/min/react-seo-component ) ![ bundlephobia minzip] ( https://badgen.net/bundlephobia/minzip/react )
3
+ [ ![ CodeFactor] ( https://www.codefactor.io/repository/github/spences10/react-seo-component/badge )] ( https://www.codefactor.io/repository/github/spences10/react-seo-component )
4
+ ![ bundlephobia min] ( https://badgen.net/bundlephobia/min/react-seo-component )
5
+ ![ bundlephobia minzip] ( https://badgen.net/bundlephobia/minzip/react )
4
6
5
7
Use it for adding canonical links, metadata and OpenGraph information
6
- to your react projects!
8
+ to your React projects!
7
9
8
10
## Use it!
9
11
10
12
Install it from npm!
11
13
12
14
``` bash
13
15
yarn add react-seo-component
16
+ # peer dependency of react helmet
17
+ yarn add react-helmet
14
18
```
15
19
16
- If you are using it with Gatsby you will need to install
17
- ` gatsby-plugin-react-helmet ` to have the meta tags generated at build
18
- time.
20
+ If you are using it with Gatsby you will also need to install the
21
+ Gatsby plugin:
22
+
23
+ ``` bash
24
+ yarn add react-seo-component
25
+ yarn add react-helmet
26
+ yarn add gatsby-plugin-react-helmet
27
+ # or in one command
28
+ yarn add react-seo-component react-helmet gatsby-plugin-react-helmet
29
+ ```
30
+
31
+ This will create the meta tags at build time.
19
32
20
33
** Examples:**
21
34
@@ -53,14 +66,6 @@ For a blog post:
53
66
/ >
54
67
```
55
68
56
- ## Dependencies
57
-
58
- Presumes you already have the following installed:
59
-
60
- - ` prop-types `
61
- - ` react `
62
- - ` react-helmet `
63
-
64
69
## Props
65
70
66
71
| Prop | Type | Default |
@@ -78,10 +83,28 @@ Presumes you already have the following installed:
78
83
| datePublished | ISO date string | ` Date.now() ` |
79
84
| dateModified | ISO date string | ` Date.now() ` |
80
85
81
- ## Thanks
86
+ ## To test locally
87
+
88
+ Use ` npm pack ` or ` yarn pack ` to create a ` .tgz ` of the project you
89
+ can install locally on your project to test with.
90
+
91
+ ``` bash
92
+ # from here
93
+ yarn pack
94
+ # copy to project to test
95
+ cp react-seo-component-2.0.1.tgz ../project-to-test-with/
96
+ # ~/project-to-test-with
97
+ yarn add file:react-seo-component-2.0.1.tgz
98
+ ```
99
+
100
+ ## Thanks:
101
+
102
+ - ** [ LekoArts] ** for the initial components detailed in his Gatsby
103
+ [ Prismic starter] .
104
+
105
+ - ** [ Leigh Halliday] ** for the [ primer video] on using [ TSDX]
82
106
83
- Thanks to [ @LekoArts ] for the initial components detailed in his
84
- Gatsby [ Prismic starter] .
107
+ - ** [ Jared Palmer] ** for [ TSDX]
85
108
86
109
## Resources
87
110
@@ -91,5 +114,9 @@ https://github.com/recraftrelic/dummy-react-npm-module/blob/master/package.json
91
114
92
115
<!-- Links -->
93
116
94
- [ @ lekoarts] : https://github.com/LekoArts
117
+ [ lekoarts ] : https://github.com/LekoArts
95
118
[ prismic starter ] : https://github.com/LekoArts/gatsby-starter-prismic
119
+ [ jared palmer ] : https://github.com/jaredpalmer
120
+ [ leigh halliday ] : https://github.com/leighhalliday
121
+ [ tsdx ] : https://github.com/jaredpalmer/tsdx
122
+ [ primer video ] : https://www.youtube.com/watch?v=V3XZYC8zmvo
0 commit comments