# HG changeset patch # User Goffi # Date 1516382226 -3600 # Node ID e4ffb56efd4e961773e9cba3e7e00da980c59ac3 # Parent 304cbb690f152b4b02b116d7f84831609c4e9b34 blog/articles: if only one item is shown, use it's title or content as page title. diff -r 304cbb690f15 -r e4ffb56efd4e default/blog/articles.html --- a/default/blog/articles.html Fri Jan 19 18:15:37 2018 +0100 +++ b/default/blog/articles.html Fri Jan 19 18:17:06 2018 +0100 @@ -2,6 +2,14 @@ {% set dates_format='relative' %} {% import 'blog/macros.html' as blog with context %} +{% block title -%} + {%- if items|length == 1 -%} + {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} + {%- else -%} + {{- super() -}} + {%- endif -%} +{%- endblock %} + {% block body %}
{{ blog.show_items(items) }}