Improve performance (defer css, resize img)

This commit is contained in:
Tobias Reisinger 2021-08-07 21:31:14 +02:00
parent 3c23aa2fcb
commit 27bcc20b93
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE

View file

@ -21,12 +21,11 @@
<meta name="msapplication-config" content="{{ url('theme://images/icons/browserconfig.xml') }}"> <meta name="msapplication-config" content="{{ url('theme://images/icons/browserconfig.xml') }}">
<meta name="theme-color" content="#ffffff"> <meta name="theme-color" content="#ffffff">
<link rel="canonical" href="{{ page.url(true, true) }}" /> <link rel="canonical" href="{{ page.url(true, true) }}" />
<link rel="stylesheet" href="{{ url('theme://dist/app.css') }}" />
{% endblock head %} {% endblock head %}
{# block stylesheets %} {% block stylesheets %}
{% do assets.addCss('theme://dist/app.css', 100) %} {% do assets.addCss('theme://dist/app.css', 100) %}
{% endblock #} {% endblock %}
{% block javascripts %} {% block javascripts %}
{% do assets.addJs('theme://dist/app.js', 100) %} {% do assets.addJs('theme://dist/app.js', 100) %}
@ -47,7 +46,10 @@
<a href="/" class="col-12"> <a href="/" class="col-12">
{% include 'partials/logo.html.twig' with {style: 'filter: invert(100%); margin-right: 0.5rem;'} %} {% include 'partials/logo.html.twig' with {style: 'filter: invert(100%); margin-right: 0.5rem;'} %}
{% for media_item in header_page.media.images %} {% for media_item in header_page.media.images %}
<img alt="Eines der Bilder im Seiten-Header." src="{{ media_item.quality(15).url }}" /> {% set aspect = media_item.width / media_item.height %}
{% set new_height = 100 %}
{% set new_width = new_height * aspect %}
<img alt="" src="{{ media_item.cropResize(new_width,new_height).quality(75).url }}" />
{% endfor %} {% endfor %}
</a> </a>
</div> </div>