# HG changeset patch # User Goffi # Date 1516949561 -3600 # Node ID 1d0ddeb79903e317aa1db60b1f61ece89e5d1f16 # Parent e96a3e09d4e9aab6df5b0e286257ad8031cae2dc blog/article: set "single" variable when a single article is shown, and expand items in this case diff -r e96a3e09d4e9 -r 1d0ddeb79903 default/blog/articles.html --- a/default/blog/articles.html Fri Jan 26 07:51:58 2018 +0100 +++ b/default/blog/articles.html Fri Jan 26 07:52:41 2018 +0100 @@ -1,9 +1,10 @@ {% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% set single = items|length == 1 %} {% set dates_format='relative' if single else 'short' %} {% import 'blog/macros.html' as blog with context %} {% block title scoped -%} - {%- if items|length == 1 -%} + {%- if single -%} {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} {%- else -%} {{C.APP_NAME}} @@ -15,7 +16,7 @@ {% block body %}
- {{ blog.show_items(items) }} + {{ blog.show_items(items, expanded=single) }}