From 0bbd9228800793ad157b54062c0aff15a7f00b32 Mon Sep 17 00:00:00 2001 From: eclipse Date: Tue, 18 Feb 2025 22:35:25 +0100 Subject: [PATCH] added 2nd level menus to main navbar --- pelicanconf.py | 19 ++++++++++++++--- theme/static/css/custom.css | 32 ++++++++++++++++++++++------ theme/templates/includes/navbar.html | 23 ++++++++++++++------ 3 files changed, 58 insertions(+), 16 deletions(-) diff --git a/pelicanconf.py b/pelicanconf.py index 9a1c45e..df5642d 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -42,11 +42,24 @@ RELATIVE_URLS = True DISPLAY_PAGES_ON_MENU = DISPLAY_CATEGORIES_ON_MENU = False MENUITEMS = ( - ("Werke", "werke/"), + ("Werke", ( + ("", "werke/"), + ("Romane", "romane/"), + ("Kurzprosa", "kurzprosa"), + ("Lyrik", "lyrik/") + )), ("Neues", "neues/"), - ("Termine", "termine/"), + ("Termine", ( + ("", "termine/"), + ("Lesereihen", "lesereihen") + )), ("Autor", "autor/"), - ("Kontakt", "kontakt/") + ("Kontakt", ( + ("", "kontakt/"), + ("Newsletter", "newsletter/"), + ("Datenschutz", "datenschutz/"), + ("Impressum", "impressum/"), + )) ) IGNORE_FILES = ['**/.*'] diff --git a/theme/static/css/custom.css b/theme/static/css/custom.css index 4f7c919..34dfae7 100644 --- a/theme/static/css/custom.css +++ b/theme/static/css/custom.css @@ -179,22 +179,42 @@ a { margin-left: 0; margin-right: 0; - li:last-child { + li.sun-moon-li { padding-right: 0; } li[aria-current=page] a { text-decoration: underline; } - } - a { - font-size: calc(var(--pico-font-size) * 0.9); - font-weight: bold; - text-align: right; + a { + font-size: calc(var(--pico-font-size) * 0.9); + font-weight: bold; + text-align: right; + } + + details.dropdown { + margin-block-end: calc(var(--pico-spacing) * -1); + + >summary:not([role]) a, + li a { + color: var(--pico-primary); + } + + >summary:not([role]) { + background-color: inherit; + border: none; + } + } + + li a { + text-align: left; + } } } + + /* make hamburger icon bigger */ #hamburger-label { font-size: calc(var(--pico-font-size) * 2); diff --git a/theme/templates/includes/navbar.html b/theme/templates/includes/navbar.html index a693e75..9ece676 100644 --- a/theme/templates/includes/navbar.html +++ b/theme/templates/includes/navbar.html @@ -8,16 +8,25 @@