Favicon generators like https://realfavicongenerator.net will create these files for you. They control the “theme color” for the site (among other things), used for bookmark and scroll colors in some browsers. This color is hard-coded, e.g. in browserconfig.xml:
#1 For generating dynamic favicons, you could save the high resolution image on assets folder (as a site resource), and then using Hugo image processing method to resize it into multiple sizes.
Yes. For single files like this it can also be practical to just use resources.ExecuteAsTemplate etc. Custom Output Formats is more useful for use cases ala “output every section to both HTML and RSS”.
I should mention that /site.webmanifest and /browserconfig.xml aren’t mentioned by any other file, so currently they’re in /static. Even favicon.ico is mentioned in HTML, so I know how to parameterize/process in that case.
@razon For #1, dynamic favicons isn’t a concern in my case. For #2, I don’t see there how to, for example, make /static/browserconfig.xml (or any other file, like /assets/browserconfig.xml) into a template that renders to web path /browserconfig.xml. The XML file type is already known to Hugo, but there’s no possible corresponding “page” for browserconfig.xml in /content that I’m aware of.
@bep I assume you mean move browserconfig.xml into /assets, then resources.Get it, then pass it to resources.ExecuteAsTemplate? That has to run inside a template; which one would it be?
I took another look at my code, and realized I was wrong, those files are indeed referenced within templates, so it was a simple matter of using resources.ExecuteAsTemplate, as you both said. Thanks for helping me figure this out!