diff --git a/.gitignore b/.gitignore index 872dc15..8ed8b4c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ website-output __pycache__ coverage.xml /gsitegen/*.page -resources +/gsitegen/resources diff --git a/example/resources/About/test.txt b/example/resources/About/test.txt new file mode 100644 index 0000000..e69de29 diff --git a/example/resources/style.css b/example/resources/style.css new file mode 100644 index 0000000..6c88f2d --- /dev/null +++ b/example/resources/style.css @@ -0,0 +1,35 @@ +ul { + list-style-type: none; + margin: 2px; + padding: 0; + overflow: hidden; + background-color: #333; + border-radius: 25px; + float: center; +} + +li { + float: left; +} + +li a { + display: block; + color: white; + text-align: center; + padding: 15px 35px; + text-decoration: none; + font-size: 3.0vmin; +} +@media only screen and (max-width: 1000px) { + li a { + display: block; + color: white; + text-align: center; + padding: 15px 35px; + text-decoration: none; + font-size: 3.0vmax; + } +} +.active li a { + background-color: #04AA6D; +} diff --git a/gsitegen/About.page b/gsitegen/About.page index f83d9a3..39db5aa 100644 --- a/gsitegen/About.page +++ b/gsitegen/About.page @@ -1,5 +1,3 @@ > - About page -ee diff --git a/gsitegen/Home.page b/gsitegen/Home.page index 97a5aa7..39d5cda 100644 --- a/gsitegen/Home.page +++ b/gsitegen/Home.page @@ -1,8 +1,7 @@ > - # Welcome! -This is the homepage of our website..... +This is the homepage of our website. > HTML Hello Another markdown line diff --git a/gsitegen/generate.py b/gsitegen/generate.py index ac78d11..c559d13 100644 --- a/gsitegen/generate.py +++ b/gsitegen/generate.py @@ -5,7 +5,7 @@ import html from pathlib import Path #TODO re-think navigation bar. Think of way to add option to display navigation bar entry differently if you're currently on that page. -def generateNavigationBar(lines): +def generateNavigationBar(lines, pagetitle): global navbar navbar = E rawhtml = False @@ -15,17 +15,27 @@ def generateNavigationBar(lines): #parse raw HTML rawhtml, navbar, htmlstring = parseRawHTML(navbar, line, htmlstring, rawhtml, id, len(lines)) - #parse markdown + #parse navigation bar (custom format) if not rawhtml: if ";" in line: title, link = line.split(";", 1) - #div class for styling - navbar = navbar(HTML("