From 02095fa47bc198e4ea6e3ff0c3199f9e92b707c8 Mon Sep 17 00:00:00 2001 From: Cayla Hamann Date: Mon, 27 Jul 2020 13:48:28 -0400 Subject: [PATCH] feat: swiftype metatags for developer site --- src/components/Seo.js | 44 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/src/components/Seo.js b/src/components/Seo.js index 8a9ff885f..c68c8db17 100644 --- a/src/components/Seo.js +++ b/src/components/Seo.js @@ -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', @@ -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 (