changeset 102:7108731be0b9

blog/articles: don't set content in title block if embedded, to avoid exception with missing parent title
author Goffi <goffi@goffi.org>
date Mon, 22 Jan 2018 08:46:07 +0100
parents 920f03abba53
children ff7bd09911f7
files default/blog/articles.html
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/default/blog/articles.html	Sun Jan 21 21:08:06 2018 +0100
+++ b/default/blog/articles.html	Mon Jan 22 08:46:07 2018 +0100
@@ -3,12 +3,14 @@
 {% 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() -}}
+    {%- if not embedded -%}
+        {%- if items|length == 1 -%}
+            {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}}
+        {%- else -%}
+            {{- super() -}}
+        {%- endif -%}
     {%- endif -%}
-{%- endblock %}
+{%- endblock title -%}
 
 {% block body %}
 <div id="blog_items">