diff --git a/src/components/Seo.js b/src/components/Seo.js
index 1a9287717..dcd318910 100644
--- a/src/components/Seo.js
+++ b/src/components/Seo.js
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { Helmet } from 'react-helmet';
import { useStaticQuery, graphql, withPrefix } from 'gatsby';
-function SEO({ description, lang, meta, title }) {
+function SEO({ description, lang, meta, title, tags }) {
const { site } = useStaticQuery(
graphql`
query {
@@ -67,6 +67,12 @@ function SEO({ description, lang, meta, title }) {
'data-type': 'string',
content: description,
},
+ ...(tags ?? []).map((tag) => ({
+ name: 'tags',
+ class: 'swiftype',
+ 'data-type': 'string',
+ content: tag,
+ })),
];
// only add metadata if we have content
@@ -100,6 +106,7 @@ SEO.propTypes = {
lang: PropTypes.string,
meta: PropTypes.arrayOf(PropTypes.object),
title: PropTypes.string,
+ tags: PropTypes.arrayOf(PropTypes.string),
};
export default SEO;
diff --git a/src/templates/GuideTemplate.js b/src/templates/GuideTemplate.js
index 39d8fcb65..e6a6dff7f 100644
--- a/src/templates/GuideTemplate.js
+++ b/src/templates/GuideTemplate.js
@@ -15,11 +15,11 @@ import SEO from '../components/Seo';
const GuideTemplate = ({ data }) => {
const { mdx } = data;
const { frontmatter, body } = mdx;
- const { title, description, duration } = frontmatter;
+ const { title, description, duration, tags } = frontmatter;
return (
<>
-
+
{duration && (
@@ -64,6 +64,7 @@ export const pageQuery = graphql`
path
title
description
+ tags
}
...Resources_page