This is a Hugo theme component with layouts to add a configurable sitemap to your website. Hugo itself has internal templates that add sitemaps, but this component has additional setup options per page.

Add this module
path = ""
disable = false
ignoreConfig = false
ignoreImports = false
Latest Version v1.0.1 (2022-08-10)
Fix to this version
hugo mod get[email protected]


Step 1: enable modules in your own repository:

1hugo mod init

Then add this module to your required modules in config.toml.

3path = ""

The next time you run hugo it will download the latest version of the module.


1hugo mod get -u
2hugo mod get -u # update all modules


There is no need to configure anything without having any special needs. Add the module to your repository structure and run it. Once you ran hugo you will find a file sitemap.xml in your public directory. This is the file you want to submit to search engines.

If you are using the Robots component, then your resulting robots.txt will have a pointer to the sitemap file as well.

Exclude page from sitemap

Add frontmatter to individual pages with the following setup:

2  sitemap: true

sitemap (boolean): include this page in the sitemap

Add/edit global defaults in config.toml > params or config/_defaults/params.toml:

2enabled = true

Without any configuration the default is true, meaning to include any page into the sitemap.

DEPRECATED: Frontmatter robotsdisallow from earlier hugo-robots versions did result in the page being ommited from the sitemap. This is deprecated, but currently still supported. The module will echo a note on CLI about this.

HTML Sitemap

If you want to add an HTML sitemap you can do so via shortcode:

1{{< sitemap >}}

This sitemap requires additional configuration via config.toml > params or config/_defaults/params.toml, have a look at this following sample:

 2type = ".Type"
 3section = "blog"
 4label = "Blog Posts"
 7type = ".Type"
 8section = "components"
 9label = "GoHugo Components by DNB"
12type = ".Type"
13section = "tags"
14selection = "in-pages"
15label = "Tags"
18type = ".Type"
19selection = "not-in"
20section = ["blog", "tags", "components"]
21label = "Other pages"

Each item of the htmlmap needs the following parameters:

  • type - for the “where type in something” enquiry
  • selection - in-regular, in-pages, not-in
  • section - string or slice that defines the section to load into the page object
  • label - headline label for the overview of the object, defaults to titled section string