From bd7937abcfce1f279adad52b61578fca404278a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Tue, 12 Dec 2023 18:33:45 +0100 Subject: [PATCH] New structure Add description Cleanup --- Resources/views/_base.html.twig | 138 ++++++++++++++++---------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/Resources/views/_base.html.twig b/Resources/views/_base.html.twig index b32551f..7e2c170 100644 --- a/Resources/views/_base.html.twig +++ b/Resources/views/_base.html.twig @@ -1,19 +1,18 @@ - - - {% block metas %} + + + {% block head %} - {{ head['title'] }} + {{ head.title }} -{#TODO: deal with unset head['description'] and set description #} - {% if head['description'] is defined and head['description'] %} - + {% if head.description is defined and head.description %} + {% endif %} - {% if head['keywords'] is defined and head['keywords'] %} - + {% if head.keywords is defined and head.keywords %} + {% endif %} - {% if head['facebook'] is defined and head['facebook'] %} - {% for property, contents in head['facebook'] %} + {% if head.facebook is defined and head.facebook %} + {% for property, contents in head.facebook %} {% if contents is iterable %} {% for content in contents %} @@ -23,64 +22,68 @@ {% endif %} {% endfor %} {% endif %} - {% endblock %} - {% block links %} - {% if site is defined and site is not empty %} - - - {% for size, icon in site.icon.png %} - {# Apple #} - {% if size in [120, 152, 167, 180] %} - {% if size == 180 %} - + {% block link %} + {% if head.icon.ico is defined and head.icon.ico is not empty %} + + {% endif %} + {% if head.icon.png is defined and head.icon.png is not empty %} + {% for size, icon in head.icon.png %} + {# Apple #} + {% if size in [120, 152, 167, 180] %} + {% if size == 180 %} + + {% endif %} + + {# Windows #} + {% elseif size in [70, 150, 310] %} + + {# Others #} + {% else %} + {% endif %} - - {# Windows #} - {% elseif size in [70, 150, 310] %} - - {# Others #} - {% else %} - - {% endif %} - {% endfor %} - {% endif %} - {# stylesheet '//fonts.googleapis.com/css?family=Irish+Grover' '//fonts.googleapis.com/css?family=La+Belle+Aurore' '@RapsysBlogBundle/Resources/public/css/{reset,screen}.css' #} - {% stylesheet '@RapsysBlog/css/{reset,droidsans,lemon,notoemoji,screen}.css' %} - - {% endstylesheet %} - {% stopwatch 'stylesheet' %} - {% endstopwatch %} - {% if head["canonical"] is defined and head['canonical'] %} - - {% endif %} - {% if head['alternates'] is defined and head['alternates'] %} - {% for lang, alternate in head['alternates'] %} - - {% endfor %} - {% endif %} - {% if head.prev is defined and head.prev %} - - {% endif %} - {% if head.next is defined and head.next %} - - {% endif %} + {% endfor %} + {% endif %} + {% if head.icon.svg is defined and head.icon.svg is not empty %} + + {% endif %} + {# stylesheet '//fonts.googleapis.com/css?family=Irish+Grover' '//fonts.googleapis.com/css?family=La+Belle+Aurore' '@RapsysBlogBundle/Resources/public/css/{reset,screen}.css' #} + {% stylesheet '@RapsysBlog/css/{reset,droidsans,lemon,notoemoji,screen}.css' %} + + {% endstylesheet %} + {% stopwatch 'stylesheet' %} + {% endstopwatch %} + {% if head.canonical is defined and head.canonical %} + + {% endif %} + {% if head.alternates is defined and head.alternates %} + {% for lang, alternate in head.alternates %} + + {% endfor %} + {% endif %} + {% if head.prev is defined and head.prev %} + + {% endif %} + {% if head.next is defined and head.next %} + + {% endif %} + {% endblock %} {% endblock %} {% block body %} {% block header %} {% endblock %} {% block message %} {# pass an array argument to get the messages of those types (['warning', 'error']) #} {% for label, messages in app.flashes %} {% if messages %} -
+
    {% for message in messages %}
  • {{ message }}
  • {% endfor %}
-
+ {% endif %} {% endfor %} {% endblock %} {% endblock %} -{# - {% block sidebar %}{% endblock %} -#} + {#{% block sidebar %}{% endblock %}#} {% block content %}
{% block title %}

{{ title }}

{% endblock %}> +

{{ description }}

{% endblock %} @@ -135,17 +135,17 @@
{{ copy.long }}{{ copy.short }}
{% endif %} {#{% trans %}Terms of service{% endtrans %}#} - {% if alternates is defined and alternates %} - {% set langs = alternates|keys|filter(v => v|length == 5) %} + {% if head.alternates is defined and head.alternates %} + {% set langs = head.alternates|keys|filter(v => v|length == 5) %} {% if langs|length > 1 %} {% else %} {% set lang = langs|first %} - {{ alternates[lang].translated }} + {{ head.alternates[lang].translated }} {% endif %} {% else %}   -- 2.41.1