Configurable extenion in links

This commit is contained in:
Martynas Mickevičius 2022-03-31 17:16:00 +03:00
parent 46c77076ab
commit 8ec0d23a3b
No known key found for this signature in database
GPG Key ID: E735DF276C508071

View File

@ -683,10 +683,11 @@ class Parser:
)
continue
else:
extension_in_links = self.config.get("extension_in_links", True)
a["href"] = (
self.get_page_slug(sub_page_href)
self.get_page_slug(sub_page_href, extension=extension_in_links)
if sub_page_href != self.index_url
else "index.html"
else ("index.html" if extension_in_links else "")
)
subpages.append(sub_page_href)
log.debug(f"Found link to page {a['href']}")