diff default/blog/articles.html @ 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 e4ffb56efd4e
children e1a0d5678837
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">