canonical / canonical-sphinx

Extension and theme to create great Canonical-branded documentation
GNU Lesser General Public License v3.0
1 stars 3 forks source link

Locally overriding the product tag doesn't work as expected #24

Open ru-fu opened 3 weeks ago

ru-fu commented 3 weeks ago

When I specify html_static_path = ['.sphinx/_static'] in my configuration and add my own tag.png to .sphinx/_static, it isn't used. It works if I name the file differently.

I'm not quite sure of the reason. I think it's partly because of appending (instead of prepending) to html_static_path: https://github.com/canonical/canonical-sphinx/blob/697aec9ea14c6e95f56961e2b019efb9e4d50bf9/canonical_sphinx/config.py#L127

But the same issue does NOT occur for templates_path, or for the favicon, so I assume it's also somehow related to how files are copied within Sphinx (my suspicion is that Sphinx starts by copying all files from the folders in html_static_path first, which would give us the tag from the extension since it's last in the path, and then it overrides all files that are explicitly specified, like the favicon).

tigarmo commented 3 weeks ago

Oh that's a very good hypothesis. I'll take a look (or please feel free to play around with the existing test if you want)