Skip to content

Commit

Permalink
feat: swiftype metatags for developer site
Browse files Browse the repository at this point in the history
  • Loading branch information
Cayla Hamann committed Jul 27, 2020
1 parent 4d45918 commit 02095fa
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions src/components/Seo.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ function SEO({ description, lang, meta, title }) {
const globalMetadata = [
{ name: 'description', content: metaDescription },
{ 'http-equiv': 'Content-Type', content: 'text/html', charset: 'utf-8' },
{
name: 'type',
class: 'swiftype',
'data-type': 'enum',
content: 'developer',
},

{
name: 'google-site-verification',
content: 'eT8TSNhvMuDmAtqbtq5jygZKVkhDmz565fYQ3DVop4g',
Expand All @@ -46,10 +41,41 @@ function SEO({ description, lang, meta, title }) {
{ name: 'twitter:description', content: metaDescription },
];

// if we decide we need this elsewhere, abstract into gatsby-theme-newrelic
const swiftype = [
{
name: 'type',
class: 'swiftype',
'data-type': 'enum',
content: 'developer',
},
{
name: 'title',
class: 'swiftype',
'data-type': 'string',
content: title,
},
{
name: 'document_type',
class: 'swiftype',
'data-type': 'enum',
content: 'page',
},
{
name: 'info',
class: 'swiftype',
'data-type': 'string',
content: description,
},
];

// only add metadata if we have content
const validMetadata = [...globalMetadata, ...social, ...meta].filter(
(m) => m.content !== ''
);
const validMetadata = [
...globalMetadata,
...social,
...meta,
...swiftype,
].filter((m) => m.content !== '');

return (
<Helmet
Expand Down

0 comments on commit 02095fa

Please sign in to comment.