diff --git a/gatsby-config.js b/gatsby-config.js index fabeb3ddb..cceb1428d 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -77,18 +77,6 @@ const DISLALLOW_LIST = [ '/docs/getting-started/adding-a-catalog-item/aws-s3/', '/docs/getting-started/adding-a-catalog-item/azure-devops/', '/docs/getting-started/adding-a-catalog-item/roadie-cli/', - - // Referrals shouldn't be indexed - '/*?referringPathname=', - - // UTM tags shouldn't be indexed - '/*?*utm_campaign=', - '/*?*utm_medium=', - '/*?*utm_content=', - '/*?*utm_source=', - - // refs shouldn't be indexed. - '/*?*ref=', ]; // Only environment variables prefixed with GATSBY_ are available in the runtime. Here we turn diff --git a/src/components/seo.js b/src/components/seo.js index 27d06f0a1..887e543ae 100644 --- a/src/components/seo.js +++ b/src/components/seo.js @@ -27,45 +27,65 @@ const SEO = ({ title, description = '', lang = 'en', headerImage = '', meta = [] const metaDescription = description || site.siteMetadata.description; const twitterHandle = get(site, 'siteMetadata.social.twitter', 'roadiehq'); const ogImageUrl = headerImage || `${site.siteMetadata.siteUrl}${roadieLogo}`; - const ogImageAlt = 'The Roadie logo. A cube in isometric projection with 3 fins cut into the right face. The word Roadie is below.'; + const ogImageAlt = + 'The Roadie logo. A cube in isometric projection with 3 fins cut into the right face. The word Roadie is below.'; - const defaultMeta = [{ - name: `description`, - content: metaDescription, - }, { - property: `og:title`, - content: title, - }, { - property: `og:description`, - content: metaDescription, - }, { - property: `og:type`, - content: `website`, - }, { - property: `og:image`, - content: ogImageUrl, - }, { - name: `twitter:card`, - content: `summary`, - }, { - name: `twitter:site`, - content: twitterHandle, - }, { - name: `twitter:image`, - content: ogImageUrl, - }, { - name: `twitter:image:alt`, - content: ogImageAlt, - }, { - name: `twitter:creator`, - content: twitterHandle, - }, { - name: `twitter:title`, - content: title, - }, { - name: `twitter:description`, - content: metaDescription, - }]; + // Construct the canonical URL dynamically based on the siteUrl and current page's path + const canonicalUrl = + typeof window !== 'undefined' + ? `${site.siteMetadata.siteUrl}${window.location.pathname}` + : site.siteMetadata.siteUrl; // Fallback to siteUrl during server-side rendering + + const defaultMeta = [ + { + name: `description`, + content: metaDescription, + }, + { + property: `og:title`, + content: title, + }, + { + property: `og:description`, + content: metaDescription, + }, + { + property: `og:type`, + content: `website`, + }, + { + property: `og:image`, + content: ogImageUrl, + }, + { + name: `twitter:card`, + content: `summary`, + }, + { + name: `twitter:site`, + content: twitterHandle, + }, + { + name: `twitter:image`, + content: ogImageUrl, + }, + { + name: `twitter:image:alt`, + content: ogImageAlt, + }, + { + name: `twitter:creator`, + content: twitterHandle, + }, + { + name: `twitter:title`, + content: title, + }, + { + name: `twitter:description`, + content: metaDescription, + }, + ]; return ( + > + + ); };