Skip to content

Commit fbb55a2

Browse files
authored
[Cards] Take current doc version from ReadTheDocs if available (#2934)
1 parent 0e83752 commit fbb55a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ def cards(pages, columns=1, style="cards", force_version=False):
5050
canonical = current_page.canonical_url
5151
url_parts = re.search("//([^/]+)/([^/]+)/([^/]+)/", canonical)
5252
(site, language, version) = url_parts.groups()
53+
5354
version = force_version or version
55+
version = os.getenv("READTHEDOCS_VERSION_NAME", version)
5456

5557
if isinstance(pages, str):
5658
pages = [pages]

0 commit comments

Comments
 (0)