Skip to content

Commit 7583b17

Browse files
authoredApr 5, 2025··
Define ogp_site_url for social media cards (#252)
1 parent 6902d1c commit 7583b17

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

Diff for: ‎build_docs.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,15 @@ def build(self):
751751
blurb = self.venv / "bin" / "blurb"
752752

753753
if self.includes_html:
754+
site_url = self.version.url
755+
if self.language.tag != "en":
756+
site_url += f"{self.language.tag}/"
754757
# Define a tag to enable opengraph socialcards previews
755758
# (used in Doc/conf.py and requires matplotlib)
756-
sphinxopts.append("-t create-social-cards")
759+
sphinxopts += (
760+
"-t create-social-cards",
761+
f"-D ogp_site_url={site_url}",
762+
)
757763

758764
# Disable CPython switchers, we handle them now:
759765
run(

0 commit comments

Comments
 (0)
Please sign in to comment.