Bugfixes to navbar styling
This commit is contained in:
parent
e4b5175a68
commit
aef5528bb0
@ -18,23 +18,37 @@ def generateNavigationBar(lines, pagetitle):
|
|||||||
#parse navigation bar (custom format)
|
#parse navigation bar (custom format)
|
||||||
if not rawhtml:
|
if not rawhtml:
|
||||||
if ";" in line:
|
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)
|
title, link = line.split(";", 1)
|
||||||
|
|
||||||
#mark currently open tab as active when it is open
|
#mark currently open tab as active when it is open
|
||||||
if link.strip() == pagetitle + ".page":
|
if link.strip() == pagetitle + ".page":
|
||||||
navbar = navbar(HTML("<div class='" + "active" + "'>"))
|
navbar = navbar(HTML("<div class='" + "active" + "'>"))
|
||||||
link = ""
|
link = "#"
|
||||||
elif link.strip() == homepage + ".page":
|
elif link.strip() == homepage + ".page":
|
||||||
print(pagetitle)
|
|
||||||
link = "/"
|
link = "/"
|
||||||
else:
|
else:
|
||||||
link = link.replace(" ", "-").replace(".page", "").lower()
|
link = link.replace(" ", "-").replace(".page", "").lower()
|
||||||
|
|
||||||
#div class for styling
|
#div class for styling
|
||||||
navbar = navbar(HTML("<div class='" + pagetitle.replace(" ", "-").lower() + "'>"))
|
navbar = navbar(HTML("<div class='" + title.replace(" ", "-").lower() + "'>"))
|
||||||
|
|
||||||
#link and end of div
|
#link and end of div
|
||||||
navbar = navbar.li(HTML("<a href='" + link.strip() + "'>" + title + "</a></div></div>"))
|
if link == "#":
|
||||||
|
navbar = navbar.li(HTML("<a href='" + link.strip() + "'>" + title + "</a></div></div>"))
|
||||||
|
else:
|
||||||
|
navbar = navbar.li(HTML("<a href='" + link.strip() + "'>" + title + "</a></div>"))
|
||||||
|
else:
|
||||||
|
print("Error: invalid navbar entry, line " + str(id + 1) + " content: " + line)
|
||||||
|
exit()
|
||||||
return navbar
|
return navbar
|
||||||
def generateFooter(lines):
|
def generateFooter(lines):
|
||||||
global footer
|
global footer
|
||||||
|
Loading…
Reference in New Issue
Block a user