Mercurial > libervia-templates
changeset 114:1d0ddeb79903
blog/article: set "single" variable when a single article is shown, and expand items in this case
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 26 Jan 2018 07:52:41 +0100 |
parents | e96a3e09d4e9 |
children | 5d9e2270ceb4 |
files | default/blog/articles.html |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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 %} <div id="blog_items"> - {{ blog.show_items(items) }} + {{ blog.show_items(items, expanded=single) }} </div> <nav class="bottom_links"> <ul>