From 8ec0d23a3bf35a2ffc1140e0b4c267f59935543e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Mickevi=C4=8Dius?= Date: Thu, 31 Mar 2022 17:16:00 +0300 Subject: [PATCH] Configurable extenion in links --- loconotion/modules/notionparser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/loconotion/modules/notionparser.py b/loconotion/modules/notionparser.py index 2069d13..4446dc6 100644 --- a/loconotion/modules/notionparser.py +++ b/loconotion/modules/notionparser.py @@ -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']}")