wpilibsuite / sphinxext-opengraph

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

Take default og:site_name from sphinx `project` config value #83

Closed rkdarst closed 1 year ago

rkdarst commented 1 year ago

Perhaps I should have asked before doing this, since the last point may be a blocker. But it was easier to do than think too much...

rkdarst commented 1 year ago

The reason I think this is useful is that I can add this extension to any site and it's closer to being functional even without any configuration.

Would we want a way to tell it to disable the og:site_name property? Right now, site_name can't be unset (assuming most sphinx projects have project set).

TheTripleV commented 1 year ago

Yes, there should be a way to turn this off, similar to ogp_image_alt.

Default ogp_site_name to None.

if ogp_site_name is None:
  use project
elif ogp_site_name == False:
  omit og:site_name
else:
  use config site_name
rkdarst commented 1 year ago

Updated and works in my local test.