From aef5528bb0d67d544914f94b5cb9dd3abf09145c Mon Sep 17 00:00:00 2001 From: Govindas Date: Thu, 3 Feb 2022 16:35:28 +0200 Subject: [PATCH] Bugfixes to navbar styling --- gsitegen/generate.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/gsitegen/generate.py b/gsitegen/generate.py index c559d13..7a37ed3 100644 --- a/gsitegen/generate.py +++ b/gsitegen/generate.py @@ -18,23 +18,37 @@ def generateNavigationBar(lines, pagetitle): #parse navigation bar (custom format) if not rawhtml: if ";" in line: + + #experimental dropdown parsing, to be removed or used soon + #contents = [] + #if "|" in line: + # contents.append(line.split("|")) + #else: + # contents.append(line) + + #for entry in contents: title, link = line.split(";", 1) #mark currently open tab as active when it is open if link.strip() == pagetitle + ".page": navbar = navbar(HTML("
")) - link = "" + link = "#" elif link.strip() == homepage + ".page": - print(pagetitle) link = "/" else: link = link.replace(" ", "-").replace(".page", "").lower() #div class for styling - navbar = navbar(HTML("
")) + navbar = navbar(HTML("
")) #link and end of div - navbar = navbar.li(HTML("" + title + "
")) + if link == "#": + navbar = navbar.li(HTML("" + title + "
")) + else: + navbar = navbar.li(HTML("" + title + "")) + else: + print("Error: invalid navbar entry, line " + str(id + 1) + " content: " + line) + exit() return navbar def generateFooter(lines): global footer