Skip to content

Commit 4834cdc

Browse files
committed
When overriding the description inside a given page, it also affects the image
1 parent 731c52f commit 4834cdc

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
@@ -204,7 +204,7 @@ def get_tags(
204204
app=builder.app,
205205
site_name=site_name,
206206
page_title=title,
207-
description=description,
207+
description=fields.get('og:description', description),
208208
page_path=Path(context['pagename']),
209209
site_url=ogp_canonical_url,
210210
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)