aboutsummaryrefslogtreecommitdiff
path: root/_layouts
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-02-14 22:52:36 -0300
committerEuAndreh <eu@euandre.org>2020-02-14 22:56:11 -0300
commit6191fde9b2d190ae9a0d27b0c514434158e0d517 (patch)
treebb10a444203f812bf81a11892f4dcb6812cbf051 /_layouts
parentMerge branch 'master' into tidy (diff)
downloadeuandre.org-6191fde9b2d190ae9a0d27b0c514434158e0d517.tar.gz
euandre.org-6191fde9b2d190ae9a0d27b0c514434158e0d517.tar.xz
_layouts/default.html: Generate langs <ul> only when there are langs
Diffstat (limited to '')
-rw-r--r--_layouts/default.html34
1 files changed, 17 insertions, 17 deletions
diff --git a/_layouts/default.html b/_layouts/default.html
index 6416f57..6a0587b 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -28,25 +28,25 @@
<a href="{{ site.t.home_url[page.lang] }}">{{ site.t.home[page.lang] }}</a>
</div>
<div id="nav-right">
- <ul>
- {% if page.ref != nil %}
- {% assign lposts=site.posts | where:"ref", page.ref | sort: 'lang' %}
- {% for lpost in lposts %}
- <li>
- <a href="{{ lpost.url }}" class="{{ lpost.lang }}">{{ lpost.lang }}</a>
- </li>
- {% endfor %}
- {% endif %}
+ {% if page.ref != nil %}
+ {% if site.posts.size > 0 or site.pages.size > 0 %}
+ <ul>
+ {% assign lposts=site.posts | where:"ref", page.ref | sort: 'lang' %}
+ {% for lpost in lposts %}
+ <li>
+ <a href="{{ lpost.url }}" class="{{ lpost.lang }}">{{ lpost.lang }}</a>
+ </li>
+ {% endfor %}
- {% if page.ref != nil %}
- {% assign lpages=site.pages | where:"ref", page.ref | sort: 'lang' %}
- {% for lpage in lpages %}
- <li>
- <a href="{{ lpage.url }}" class="{{ lpage.lang }}">{{ lpage.lang }}</a>
- </li>
- {% endfor %}
+ {% assign lpages=site.pages | where:"ref", page.ref | sort: 'lang' %}
+ {% for lpage in lpages %}
+ <li>
+ <a href="{{ lpage.url }}" class="{{ lpage.lang }}">{{ lpage.lang }}</a>
+ </li>
+ {% endfor %}
+ </ul>
{% endif %}
- </ul>
+ {% endif %}
<a href="{{ site.t.about_url[page.lang] }}">{{ site.t.about[page.lang] }}</a>
<a href="{{ site.t.feed_url[page.lang] }}">