@@ -11,8 +11,17 @@ import Helmet from 'react-helmet';
1111import { useStaticQuery , graphql } from 'gatsby' ;
1212import favicon from './../images/favicon-new.ico' ;
1313
14- function SEO ( {
15- lang, meta, title, slug,
14+ function SEO ( { lang,
15+ meta,
16+ title,
17+ slug,
18+ canonical,
19+ meta_desc,
20+ keywords,
21+ social_share_summary,
22+ social_share_desc,
23+ social_share_image,
24+ noindex
1625 } ) {
1726 const { site } = useStaticQuery (
1827 graphql `
@@ -28,6 +37,8 @@ function SEO({
2837 ` ,
2938 ) ;
3039
40+ const isIndexed = ! noindex ? 'index, follow' : 'noindex, nofollow'
41+
3142 return (
3243 < Helmet
3344 htmlAttributes = { {
@@ -37,53 +48,73 @@ function SEO({
3748 titleTemplate = { `%s | ${ site . siteMetadata . title } ` }
3849 meta = { [
3950 {
40- name : 'google-site-verification ' ,
41- content : '58TM3lGyGn6c2Bj0PvPQSNzrd9_yBsHs2BjJ6KMHlRU' ,
51+ name : 'description ' ,
52+ content : meta_desc
4253 } ,
4354 {
44- property : 'og:url' ,
45- content : 'https://testsigma.com/docs/' ,
55+ name : 'keywords' ,
56+ content : keywords
57+ } ,
58+ {
59+ name : 'google-site-verification' ,
60+ content : '58TM3lGyGn6c2Bj0PvPQSNzrd9_yBsHs2BjJ6KMHlRU' ,
4661 } ,
4762 {
4863 property : 'og:title' ,
49- content : title ,
64+ content : title
5065 } ,
5166 {
52- property : 'og:site_name ' ,
53- content : 'Testsigma Docs' ,
67+ property : 'og:description ' ,
68+ content : social_share_desc
5469 } ,
5570 {
5671 property : 'og:image' ,
57- content : 'https://website-static.testsigma.com/assets/home/homepage-linkedin.png' ,
72+ content : social_share_image
73+ } ,
74+ {
75+ property : 'og:url' ,
76+ content : `https://testsigma.com${ slug } ` ,
5877 } ,
5978 {
6079 property : 'og:type' ,
6180 content : 'website' ,
6281 } ,
6382 {
64- name : 'twitter:card ' ,
65- content : 'summary ' ,
83+ property : 'og:site_name ' ,
84+ content : 'Testsigma Docs ' ,
6685 } ,
6786 {
6887 name : 'twitter:creator' ,
6988 content : site . siteMetadata . author ,
7089 } ,
90+ {
91+ name : 'twitter:card' ,
92+ content : social_share_summary
93+ } ,
7194 {
7295 name : 'twitter:title' ,
7396 content : title ,
7497 } ,
7598 {
76- property : 'twitter:domain ' ,
77- content : 'https://testsigma.com/docs/' ,
99+ property : 'twitter:description ' ,
100+ content : social_share_desc
78101 } ,
79102 {
80- property : 'og:image' ,
81- content : 'https://website-static.testsigma.com/assets/home/homepage-linkedin.png' ,
103+ property : 'twitter:image' ,
104+ content : social_share_image
105+ } ,
106+ {
107+ property : 'twitter:domain' ,
108+ content : `https://testsigma.com${ slug } `
82109 } ,
83110 {
84111 property : 'twitter:site' ,
85112 content : '@testsigmainc' ,
86113 } ,
114+ {
115+ name : 'robots' ,
116+ content : isIndexed
117+ } ,
87118 ] . concat ( meta ) }
88119 >
89120 { /* fav icon */ }
@@ -100,7 +131,8 @@ function SEO({
100131 { /* <link rel="dns-prefetch" href="https://stackpath.bootstrapcdn.com" /> */ }
101132 { /* <link crossOrigin rel="preconnect" href="https://stackpath.bootstrapcdn.com" /> */ }
102133 { /* <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossOrigin="anonymous" /> */ }
103- < link rel = "canonical" href = { `https://testsigma.com${ slug } ` } />
134+ { /* canonical */ }
135+ { canonical ? < link rel = "canonical" href = { canonical } /> : < link rel = "canonical" href = { `https://testsigma.com${ slug } ` } /> }
104136 { /* Algolia Instantsearch IE11 support v3 */ }
105137 { /* <script src="https://polyfill.io/v3/polyfill.min.js?features=default,Array.prototype.find,Array.prototype.includes" /> */ }
106138 { /* */ }
@@ -124,6 +156,13 @@ SEO.propTypes = {
124156 lang : PropTypes . string ,
125157 meta : PropTypes . arrayOf ( PropTypes . object ) ,
126158 title : PropTypes . string . isRequired ,
159+ canonical : PropTypes . string ,
160+ meta_desc : PropTypes . string ,
161+ keywords : PropTypes . string ,
162+ social_share_summary : PropTypes . string ,
163+ social_share_desc : PropTypes . string ,
164+ social_share_image : PropTypes . string ,
165+ noindex : PropTypes . bool
127166} ;
128167
129168export default SEO ;
0 commit comments