aboutsummaryrefslogtreecommitdiff
path: root/_layouts
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-02-14 23:09:21 -0300
committerEuAndreh <eu@euandre.org>2020-02-14 23:09:21 -0300
commit59d41b136edcc728499c4bd2da3a010e34581d3f (patch)
treef55e6c8224dfc7ac0cce6e2b1d9fc85ef44c3bf7 /_layouts
parent.build.yml: Don't publish when not on master branch (diff)
parentImprove error message of tidy-content.sh (diff)
downloadeuandre.org-59d41b136edcc728499c4bd2da3a010e34581d3f.tar.gz
euandre.org-59d41b136edcc728499c4bd2da3a010e34581d3f.tar.xz
Merge branch 'tidy'
Add HTML linting and identing validation step.
Diffstat (limited to '')
-rw-r--r--_layouts/default.html36
-rw-r--r--_layouts/index.html13
2 files changed, 25 insertions, 24 deletions
diff --git a/_layouts/default.html b/_layouts/default.html
index 1ff8c1d..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] }}">
@@ -57,7 +57,7 @@
</header>
<main>
- <h1>{{ page.title }}</h1>
+ {% if page.title %}<h1>{{ page.title }}</h1>{% endif %}
{{ content }}
</main>
diff --git a/_layouts/index.html b/_layouts/index.html
index 3c145d0..037e0e3 100644
--- a/_layouts/index.html
+++ b/_layouts/index.html
@@ -2,12 +2,13 @@
layout: default
---
<h1>{{ site.t.recent_posts[page.lang] }}</h1>
-<ul>
- {%- for post in site.posts -%}
- {% if post.lang == page.lang %}
+{% assign lposts=site.posts | where:"lang", page.lang | sort: 'date' %}
+{% if lposts.size > 0 %}
+ <ul>
+ {%- for post in lposts -%}
<li>
<a href="{{ post.url }}">{{ post.title | escape }}</a> - {{ post.date | date: site.t.date_format[page.lang] }}
</li>
- {% endif %}
- {%- endfor -%}
-</ul>
+ {%- endfor -%}
+ </ul>
+{% endif %}