Hugo: Can't specify sitemap variables via front matter

Created on 4 Jul 2016  路  3Comments  路  Source: gohugoio/hugo

The Sitemap Template doc says, "The same fields can be specified in an individual page鈥檚 front matter in order to override the value for that page." I added the following to the front matter of my content page:

[...]
changefreq = "monthly"
priority = "0.5"
+++

After doing so and rebuilding, the <changefreq> and <priority> elements did not render for the page when using the default sitemap.xml template.

Most helpful comment

Just try including your changes under sitemap header as follows:
+++
sitemap:
changefreq: "monthly"
priority: 0.5
+++
This worked for me under hugo v0.16
Hope this solves your problem @ianbrandt

All 3 comments

Just try including your changes under sitemap header as follows:
+++
sitemap:
changefreq: "monthly"
priority: 0.5
+++
This worked for me under hugo v0.16
Hope this solves your problem @ianbrandt

Does that solve your issue @ianbrandt ?

@bep That did it, with minor syntax corrections for TOML:

[sitemap]
changefreq = "monthly"
priority = 0.5
+++

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kaushalmodi picture kaushalmodi  路  3Comments

crash-dive picture crash-dive  路  3Comments

VoidingWarranties picture VoidingWarranties  路  3Comments

antifuchs picture antifuchs  路  3Comments

artelse picture artelse  路  3Comments