Skip to content

Commit c90f2a5

Browse files
committed
Fix root pages url path
1 parent 47ae731 commit c90f2a5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plain-pages/plain/pages/pages.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ def get_url_path(self) -> str | None:
8181
if os.path.basename(url_path) == "index":
8282
url_path = os.path.dirname(url_path)
8383

84-
return url_path + "/" # With trailing slash
84+
# The root url should stay an empty string
85+
if not url_path:
86+
return ""
87+
88+
# Everything else should get a trailing slash
89+
return url_path + "/"
8590

8691
def get_template_name(self):
8792
if template_name := self.vars.get("template_name"):

0 commit comments

Comments
 (0)