wpilibsuite / sphinxext-opengraph

Sphinx extension to generate unique OpenGraph metadata
https://sphinxext-opengraph.readthedocs.io
Other
69 stars 25 forks source link

Add exception for SVG images #97

Closed choldgraf closed 1 year ago

choldgraf commented 1 year ago

I think this is a minimal patch to avoid breaking when a user has an SVG image. Ideally we would catch this and raise a warning in Sphinx, but I wanted to show the minimal patch to avoid the bug if you wanna make a patch release. I likely don't have time to do a proper implementation w/ a warning and such (am expecting a baby any day now)

choldgraf commented 1 year ago

Just signal-boosting this. I'd recommend a patch release just after. As-is, anybody that was using an .svg file for their html_logo will have a broken Sphinx build when they upgrade to the latest sphinxext-opengraph.

choldgraf commented 1 year ago

Just signal-boosting this. I'd recommend a patch release just after. As-is, anybody that was using an .svg file for their html_logo will have a broken Sphinx build when they upgrade to the latest sphinxext-opengraph.

Daltz333 commented 1 year ago

Can we have a test for this so anything similar doesn't bit us in the future?

choldgraf commented 1 year ago

OK the latest push adds a test that fails on main but passes with this change. I couldn't find a way to catch the warning messages in Sphinx but at least this will fail if we regress the check for SVG. I also added a check to make sure the path exists for good measure.