Skip to content

Commit 069e461

Browse files
committed
Make changes according to review
1 parent 8029089 commit 069e461

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sphinxext/opengraph/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def get_tags(
128128
):
129129
image_url = first_image["uri"]
130130
ogp_image_alt = first_image.get("alt", None)
131+
else:
132+
first_image = None
131133

132134
if image_url:
133135
# temporarily disable relative image paths with field lists
@@ -137,7 +139,7 @@ def get_tags(
137139
# Relative image path detected, relative to the source. Make absolute.
138140
if first_image:
139141
root = page_url
140-
else:
142+
else: # workaround for ogp_image
141143
# ogp_image is defined as being relative to the site root.
142144
# This workaround is to keep that functionality from breaking.
143145
root = config["ogp_site_url"]

0 commit comments

Comments
 (0)