From 27bcc20b9388903d7f39287eaa88727c46d9d2a9 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Sat, 7 Aug 2021 21:31:14 +0200 Subject: [PATCH] Improve performance (defer css, resize img) --- templates/partials/base.html.twig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/partials/base.html.twig b/templates/partials/base.html.twig index 9637ab3..655330e 100644 --- a/templates/partials/base.html.twig +++ b/templates/partials/base.html.twig @@ -21,12 +21,11 @@ - {% endblock head %} -{# block stylesheets %} +{% block stylesheets %} {% do assets.addCss('theme://dist/app.css', 100) %} -{% endblock #} +{% endblock %} {% block javascripts %} {% do assets.addJs('theme://dist/app.js', 100) %} @@ -47,7 +46,10 @@ {% include 'partials/logo.html.twig' with {style: 'filter: invert(100%); margin-right: 0.5rem;'} %} {% for media_item in header_page.media.images %} - Eines der Bilder im Seiten-Header. + {% set aspect = media_item.width / media_item.height %} + {% set new_height = 100 %} + {% set new_width = new_height * aspect %} + {% endfor %}