diff options
author | David Robillard <d@drobilla.net> | 2022-07-13 15:13:06 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-07-13 15:13:06 -0400 |
commit | 8d5a512a829fa1fa761ba3804ca3f32bbdbc3459 (patch) | |
tree | a1879ced8dcc7b3f58712e2a887a93755517c23b | |
parent | 7a987f1af58964826d2ae15fe44684ce0167e438 (diff) | |
download | lv2site-8d5a512a829fa1fa761ba3804ca3f32bbdbc3459.tar.xz |
Hide menu entirely if there is nothing to show in it
-rw-r--r-- | themes/lv2/templates/base.html | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/themes/lv2/templates/base.html b/themes/lv2/templates/base.html index 45b8809..8c1525b 100644 --- a/themes/lv2/templates/base.html +++ b/themes/lv2/templates/base.html @@ -30,35 +30,37 @@ <body> <!-- {% include 'github.html' %} --> - <nav> - <ul> - <li> - {% if SITELOGO %} - <a href="{{ SITEURL }}/" class="navbar-brand"> - <img id="logo" alt="{{ SITENAME }}" - width="{{ SITELOGO_WIDTH }}" height="{{ SITELOGO_HEIGHT}}" - src="{{ SITEURL }}/{{ SITELOGO }}" /> - </a> - {% else %} - <a href="{{ SITEURL }}/">{{ SITENAME }}</a> - {% endif %} - </li> + {% if MENUITEMS or DISPLAY_PAGES_ON_MENU or DISPLAY_CATEGORIES_ON_MENU %} + <nav> + <ul> + <li> + {% if SITELOGO %} + <a href="{{ SITEURL }}/" class="navbar-brand"> + <img id="logo" alt="{{ SITENAME }}" + width="{{ SITELOGO_WIDTH }}" height="{{ SITELOGO_HEIGHT}}" + src="{{ SITEURL }}/{{ SITELOGO }}" /> + </a> + {% else %} + <a href="{{ SITEURL }}/">{{ SITENAME }}</a> + {% endif %} + </li> - {% for title, link in MENUITEMS %} - <li><a href="{{ link }}">{{ title }}</a></li> - {% endfor %} - {% if DISPLAY_PAGES_ON_MENU %} - {% for page in PAGES %} - <li><a href="{{ SITEURL }}/{{ page.url }}">{{ page.title }}</a>{% if not loop.last %} :{% endif %}</li> + {% for title, link in MENUITEMS %} + <li><a href="{{ link }}">{{ title }}</a></li> {% endfor %} - {% endif %} - {% if DISPLAY_CATEGORIES_ON_MENU %} - {% if categories|length > 1 %} - <li>: <a href="{{ SITEURL }}/categories.html">Categories</a></li> + {% if DISPLAY_PAGES_ON_MENU %} + {% for page in PAGES %} + <li><a href="{{ SITEURL }}/{{ page.url }}">{{ page.title }}</a>{% if not loop.last %} :{% endif %}</li> + {% endfor %} + {% endif %} + {% if DISPLAY_CATEGORIES_ON_MENU %} + {% if categories|length > 1 %} + <li>: <a href="{{ SITEURL }}/categories.html">Categories</a></li> + {% endif %} {% endif %} - {% endif %} - </ul> - </nav> + </ul> + </nav> + {% endif %} <div id="content"> {% block content %} |