HUGO

Sitemap.xml Priority not overwritten by "Front Matter Variables"

The config (according to Configure sitemap.xml) is like this:

[sitemap]
    changefreq = "weekly"
    filename = "sitemap.xml"
    priority = 0.5

The config works fine and displays the sitemap like this:
image

But thats just the default according to the docs:

Defaults for <changefreq> , <priority> and filename values can be set in the site’s config file, e.g.:

The Mainpage should be set to:
Frequently: daily
Priority: 1

As Configure sitemap.xml also states:

The same fields can be specified in an individual content file’s front matter in order to override the value assigned to that piece of content at render time.

So I searched for Front Matter Formats
which did not give me anything I could use to overwrite the default values I have set.

Anyway in the pages front matter I tried:
weight: 1
&
priority: 1

but both did not change anything at the actual frequenc NOR at the priority. The sitemap is still the very same.

So my question is:
after setting the defaults, how can I overwrite them within the pages front matter?

+++
title = "Test"
date = 2021-05-01T20:27:16-07:00
draft = false
[sitemap]
  changefreq = "yearly"
  priority = 0.1
+++
1 Like

Thanks, that was the solution!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.