diff --git a/main.py b/main.py index 2b140533b4..6091cfe254 100644 --- a/main.py +++ b/main.py @@ -50,6 +50,9 @@ def cards(pages, columns=1, style="cards", force_version=False): canonical = current_page.canonical_url url_parts = re.search("//([^/]+)/([^/]+)/([^/]+)/", canonical) (site, language, version) = url_parts.groups() + url_parts = re.search("^/([^/]+)/([^/]+)/", absolute_url) + (language, version) = url_parts.groups() + version = force_version or version if isinstance(pages, str):