Merge pull request #102 from 2m/fix/extension-2m

Configurable extension in links
This commit is contained in:
Leonardo Cavaletti 2022-04-03 17:59:29 +01:00 committed by GitHub
commit 3df2bdefdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -671,10 +671,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']}")