From b46b283bf2177a10f7d33f5fd7eae43a80402e0a Mon Sep 17 00:00:00 2001 From: Govindas Date: Wed, 2 Feb 2022 16:51:46 +0200 Subject: [PATCH] Experimental styling support for navigation bar --- example/footer | 1 + gsitegen/About.page | 4 ++++ gsitegen/Home.page | 3 +++ gsitegen/generate.py | 10 +++++++++- gsitegen/navbar | 4 ++-- 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 example/footer diff --git a/example/footer b/example/footer new file mode 100644 index 0000000..8b8564c --- /dev/null +++ b/example/footer @@ -0,0 +1 @@ +[Privacy Policy](/privacy-policy) diff --git a/gsitegen/About.page b/gsitegen/About.page index e718280..f83d9a3 100644 --- a/gsitegen/About.page +++ b/gsitegen/About.page @@ -1 +1,5 @@ +> + + About page +ee diff --git a/gsitegen/Home.page b/gsitegen/Home.page index 758a5f4..97a5aa7 100644 --- a/gsitegen/Home.page +++ b/gsitegen/Home.page @@ -1,3 +1,6 @@ +> + + # Welcome! This is the homepage of our website..... > diff --git a/gsitegen/generate.py b/gsitegen/generate.py index 7cc4853..ac78d11 100644 --- a/gsitegen/generate.py +++ b/gsitegen/generate.py @@ -17,7 +17,14 @@ def generateNavigationBar(lines): #parse markdown if not rawhtml: - navbar = navbar.li(HTML(parseMarkdown(navbar, line))) + if ";" in line: + title, link = line.split(";", 1) + + #div class for styling + navbar = navbar(HTML("
")) + + #link and end of div + navbar = navbar.li(HTML("" + title + "
")) def generateFooter(lines): global footer @@ -55,6 +62,7 @@ def parseRawHTML(doc, line, htmlstring, rawhtml, id, maxlines): rawhtml = False doc.div(HTML(htmlstring)) htmlstring = "" + return rawhtml, doc, htmlstring def parseMarkdown(doc, line): diff --git a/gsitegen/navbar b/gsitegen/navbar index 5498e0e..5be290d 100644 --- a/gsitegen/navbar +++ b/gsitegen/navbar @@ -1,2 +1,2 @@ -[Home](/) -[About](/about) +About;/about +Home;/