Skip to content

Commit c86edb9

Browse files
committed
feature: fix test logic
Signed-off-by: Anne Chew <[email protected]>
1 parent 4209655 commit c86edb9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

sphinxext/opengraph/__init__.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,14 @@ def get_tags(
154154

155155
# Check for meta description override
156156
meta_description_exists = get_meta_description(context['metatags'])
157-
copy_og_desc = getattr(config, 'ogp_copy_og_description_to_meta', False)
158-
if (
159-
config.ogp_enable_meta_description
160-
and not meta_description_exists
161-
and copy_og_desc
162-
and og_description
163-
):
157+
if og_description and not meta_description_exists:
164158
meta_tags['description'] = og_description
165159
elif (
166160
config.ogp_enable_meta_description
167161
and not meta_description_exists
168162
and description
169163
and not og_description
164+
and getattr(config, 'ogp_copy_og_description_to_meta', False)
170165
):
171166
meta_tags['description'] = description
172167

0 commit comments

Comments
 (0)