Add a sitemap to your Gatsby site
By: Daniel Jimenez | Published on: Apr 05 2020
#Gatsby
A sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them. Search engines like Google read this file to more intelligently crawl your site. A sitemap tells Google which pages and files you think are important in your site, and also provides valuable information about these files: for example, for pages, when the page was last updated, how often the page is changed, and any alternate language versions of a page.
Read more: https://support.google.com/webmasters/answer/156184?hl=en
How to add a Sitemap on Gatsby
The site map will only generate when run in production
Install
npm install --save gatsby-plugin-sitemap
On your gatsby-config.js
siteMetadata: {
siteUrl: `https://your_site.com`,
},
plugins: [`gatsby-plugin-sitemap`]
This is the basic configuration of gatsby-plugin-sitemap read more about the other available options.
Share:
