diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index c6ae00d..aa70b49 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -11,7 +11,7 @@ from jinja2 import Environment, FileSystemLoader templates = Environment(loader=FileSystemLoader([os.path.realpath(os.path.join(os.getcwd(), "templates")), os.path.join(os.path.split(os.path.realpath(__file__))[0], "templates")])) index_template = templates.get_template("index.html") gallery_index_template = templates.get_template("gallery-index.html") - +menu_template = templates.get_template("menu.html") class Cache(object): cache_file_path = os.path.join(os.getcwd(), ".prosopopee_cache") @@ -147,6 +147,11 @@ def main(): front_page_galleries_cover = reversed(sorted(front_page_galleries_cover, key=lambda x: x["date"])) + if settings.get('menu'): + for item in settings["menu"]: + item_file = item.replace(" ", "_").lower() + open(os.path.join("build", item_file+".html"), "w").write(menu_template.render(settings=yaml.safe_load(open(item_file+".yaml", "r")), galleries=front_page_galleries_cover, helpers=TemplateFunctions(os.getcwd(), os.path.join(os.getcwd(), "build"), has_gm=has_gm)).encode("Utf-8")) + open(os.path.join("build", "index.html"), "w").write(index_template.render(settings=settings, galleries=front_page_galleries_cover, helpers=TemplateFunctions(os.getcwd(), os.path.join(os.getcwd(), "build"), has_gm=has_gm)).encode("Utf-8")) diff --git a/prosopopee/static/css/style.css b/prosopopee/static/css/style.css index e08e151..fc5ca08 100644 --- a/prosopopee/static/css/style.css +++ b/prosopopee/static/css/style.css @@ -5,6 +5,10 @@ body { margin: 0; } +a { + text-decoration: none; +} + .galleries-grid { width: 100%; height: 100%; @@ -95,6 +99,10 @@ body { margin-bottom: 6.5em; } +.static-header { + margin-bottom: 0px; +} + #logo { width: 10%; } @@ -167,3 +175,61 @@ footer a { font-family: 'montserrat', sans-serif; color: #111; } + +nav { + background-color: #FBFBFB; + width: 100%; + height: 56px; + line-height: 56px; +} + +nav .nav-wrapper { + position: relative; + height: 100%; + margin: 0px auto; + max-width: 1280px; +} + +nav ul { + margin: 0; +} + +nav ul li { + padding: 0; + list-style-type: none; + display:inline-block; +} + +nav a.first-item-menu { + margin-left: -42px; +} + +nav ul li.active { + background-color: rgba(0, 0, 0, 0.1); +} + +nav ul a { + transition: background-color .3s; + font-size: 1rem; + display: block; + padding: 0 15px; + cursor: pointer; + text-transform: uppercase; + margin: 0px; + letter-spacing: 1px; + font-weight: 700; + color: #424242; + font-style: normal !important; +} + +.center, .center-align { + text-align: center; +} + +nav ul li > a.item-menu::before { + content: "/"; + margin-right: 22px; + font-size: 18px; + line-height: 1; + color: #ebebeb; +} diff --git a/prosopopee/templates/index.html b/prosopopee/templates/index.html index 4869b10..b49ac2c 100644 --- a/prosopopee/templates/index.html +++ b/prosopopee/templates/index.html @@ -15,10 +15,26 @@