diff default/blog/articles.html @ 111:e1a0d5678837

blog/articles: don't use super() in title block for now, it crashes if parent is not base/base.html
author Goffi <goffi@goffi.org>
date Wed, 24 Jan 2018 20:24:09 +0100
parents 7108731be0b9
children e96a3e09d4e9
line wrap: on
line diff
--- a/default/blog/articles.html	Wed Jan 24 19:43:30 2018 +0100
+++ b/default/blog/articles.html	Wed Jan 24 20:24:09 2018 +0100
@@ -2,13 +2,14 @@
 {% set dates_format='relative' %}
 {% import 'blog/macros.html' as blog with context %}
 
-{% block title -%}
-    {%- if not embedded -%}
-        {%- if items|length == 1 -%}
-            {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}}
-        {%- else -%}
-            {{- super() -}}
-        {%- endif -%}
+{% block title scoped -%}
+    {%- if items|length == 1 -%}
+        {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}}
+    {%- else -%}
+        {{C.APP_NAME}}
+        {# {{- super() -}}
+           FIXME: super() is failing if blog is embedded (i.e. base/base.html is not its direct parent)
+                  not sure what's the best way to avoid that, so just using C.APP_NAME for now #}
     {%- endif -%}
 {%- endblock title -%}