Skip to content

Commit 3fa158c

Browse files
committed
[Cards] Take current doc version from ReadTheDocs if available
1 parent 1a05c58 commit 3fa158c

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
@@ -42,7 +42,9 @@ def cards(pages, columns=1, style="cards", force_version=False):
4242
absolute_url = current_page.abs_url
4343
url_parts = re.search("^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/", absolute_url)
4444
(project, edition, language, version) = url_parts.groups()
45+
4546
version = force_version or version
47+
version = os.getenv("READTHEDOCS_VERSION_NAME", version)
4648

4749
if isinstance(pages, str):
4850
pages = [pages]

0 commit comments

Comments
 (0)