{{ with $defaultSitemap }}Sitemap: {{ . | absURL }}{{ end -}}
But (with hugo server -b http://localhost:1313/ I always get Sitemap: http://localhost:1313/sitemap.xml in the output, even if in config.toml I have
disableKinds = ["sitemap","RSS"]
before any maps (like [params]). Is there a way for the robots.txt partial to detect if the sitemap is in fact generated for this site?
I’ve tried looking at .OutputFormats.Get "sitemap" and .AlternativeOutputFormats, but I haven’t found anything that will let me omit specifying a sitemap when there isn’t one.
If one of what I described ‘should work’ I’ll do up a test case, but based on going blind reading the docs, I can’t find anything that looks like it would do what I want, so I wanted ask if it is even possible.
Thank you! As a workaround that will get the job done in a better way than introducing a new param. I’d prefer not having to do a work around, but it’s not something I think worth an ‘feature request’ and then bep (most likely, if anyone) working on it.
@jmooring That’ll be nice for some uses - guess the docs haven’t caught up to the addition of that.
Unfortunately with @kaushalmodi’s workaround and baseURL set (but no <base href=...>) this returns the value of baseURL which means using an if instead of with. Not a big deal, but is less helpful than intended .
Ah well… I’m just happy I don’t have to introduce a new param, and I am grateful for the thought.