Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Generating a sitemap

Alan Harnum edited this page Jun 9, 2023 · 2 revisions
  • 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 crawl your site more efficiently.
  • sitemap.njk is a new boilerplate template file created in the /src directory, the same location as the English and French starter files, when a new jamstack application is initialized.
  • It is created with "https://www.ontario.ca" as the domain URL. This value is used to create absolute URLs, which is necessary for the sitemap.xml file.
    • This value can be modified if you are not hosting your jamstack application on ontario.ca. Navigate to src/sitemap.njk and edit the value of the variable domainUrl in the front matter (top of the page, above the ---)
  • Any pages that you create that you do not want indexed using the sitemap.xml will require a new front matter variable: eleventyExcludeFromCollections: true
  • To add a sitemap to an existing downstream site, update your project with node jam-on.mjs update and follow the prompts