Skip to content

Commit 4158a4c

Browse files
committed
main.py: cards: get right version from abs_url
1 parent 5997c42 commit 4158a4c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def cards(pages, columns=1, style="cards", force_version=False):
4848
canonical = current_page.canonical_url
4949
url_parts = re.search("//([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/", canonical)
5050
(site, project, edition, language, version) = url_parts.groups()
51+
url_parts = re.search("^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/", absolute_url)
52+
(project, edition, language, version) = url_parts.groups()
5153
version = force_version or version
5254

5355
if isinstance(pages, str):
@@ -87,4 +89,4 @@ def cards(pages, columns=1, style="cards", force_version=False):
8789
)
8890
)
8991

90-
return """<div class="%s col-%s">%s</div>""" % (style, columns, "\n".join(cards))
92+
return """<div class="%s col-%s">%s %s %s</div>""" % (style, columns, "\n".join(cards), current_page.abs_url, current_page.canonical_url)

0 commit comments

Comments
 (0)