Skip to content

Commit d22fe53

Browse files
committed
When overriding the description inside a given page, it also affects the image
1 parent efb37a0 commit d22fe53

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sphinxext/opengraph/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def get_tags(
205205
app=builder.app,
206206
site_name=site_name,
207207
page_title=title,
208-
description=description,
208+
description=fields.get('og:description', description),
209209
page_path=Path(context['pagename']),
210210
site_url=ogp_canonical_url,
211211
config=config,

sphinxext/opengraph/_social_cards_matplotlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def from_values(cls, values: dict) -> MatplotlibSocialCardSettings:
7171
values['image_mini'] = Path(values['image_mini'])
7272

7373
if isinstance(values.get('site_url'), str):
74-
values['override_site_url'] = values.get('site_url')
74+
values['override_site_url'] = values.pop('site_url')
7575

7676
return cls(**values)
7777

0 commit comments

Comments
 (0)