
gatsby-theme-seo
This theme adds SEO related packages and configuration. The following packages are enabled by default:
- gatsby-plugin-react-helmet
- gatsby-plugin-catch-links
- gatsby-plugin-robots-txt
- gatsby-plugin-advanced-sitemap
These packages are also included, but not enabled by default:
- gatsby-plugin-google-tagmanager
- gatsby-plugin-force-trailing-slashes
Install
npm install @benrobertson/gatsby-theme-seo
Configure
In your gatsby-config.js
:
module.exports = {
plugins: [{
resolve: 'gatsby-theme-seo',
options: {
requiredEnvVars: [
'URL'
],
forceTrailingSlash: false,
gtmId: 'TEST-ID',
robotsOptions: {
host: 'https://www.example-override.com',
sitemap: 'https://www.example.com/sitemap.xml',
policy: [{ userAgent: '*', allow: '/' }]
},
sitemapOptions: {
exclude: [
'/404.html',
'/404',
'/dev-404-page',
'/maintenance'
}
}
}],
}