-
Notifications
You must be signed in to change notification settings - Fork 10
/
default.html.twig
executable file
·49 lines (40 loc) · 1.43 KB
/
default.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{% extends 'partials/base.html.twig' %}
{# Define if the primary image and the attributes of width and height are shown #}
{% set show_image = header_var('show_pageimage')|defined(true) %}
{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v, k) => k != page.header.primaryImage and (v.type == 'image' or v.type == 'vector'))|first %}
{% set img_width = header_var('image_width')|default(1038) %}
{% set img_height = header_var('image_height')|default(437) %}
{# Set title and subtitle #}
{% set title = page.title|raw %}
{% set subtitle = page.header.subtitle|raw %}
{% block menu %}
{% include 'partials/sidebar_right.html.twig' %}
{% endblock %}
{% block content %}
<article class="post">
<header>
<div class="title">
<h2>{{ title }}</h2>
{% if subtitle %}
<p>{{ subtitle }}</p>
{% endif %}
</div>
</header>
{% if show_image and image %}
<span class="image featured">
{{ image.cropZoom(img_width, img_height).loading('lazy').attribute('decoding','async').html(title, title)|raw }}
</span>
{% endif %}
{{ page.content|raw }}
</article>
{% if show_sidebar == false %}
<section id="footer" class="align-center">
{% include 'partials/footer.html.twig' %}
</section>
{% endif %}
{% endblock %}
{% block sidebar %}
{% if show_sidebar == true %}
{% include 'partials/sidebar_left.html.twig' %}
{% endif %}
{% endblock %}