]> Raphaƫl G. Git Repositories - blogbundle/blob - Resources/views/_base.html.twig
Add carriage return to cleaned symbol
[blogbundle] / Resources / views / _base.html.twig
1 <!DOCTYPE html>
2 <html{% if head.locale is defined and head.locale %} lang="{{ head.locale }}"{% endif %}>
3 <head{% if head.facebook is defined and head.facebook is not empty %} prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"{% endif %}>
4 {% block head %}
5 <meta charset="UTF-8" />
6 <title>{{ head.title }}</title>
7 <meta name="viewport" content="width=device-width, initial-scale=1" />
8 {% if head.description is defined and head.description %}
9 <meta name="description" content="{{ head.description }}" />
10 {% endif %}
11 {% if head.keywords is defined and head.keywords %}
12 <meta name="keywords" content="{{ head.keywords }}" />
13 {% endif %}
14 {% if head.facebook is defined and head.facebook %}
15 {% for property, contents in head.facebook %}
16 {% if contents is iterable %}
17 {% for content in contents %}
18 <meta property="{{ property }}" content="{{ content }}" />
19 {% endfor %}
20 {% else %}
21 <meta property="{{ property }}" content="{{ contents }}" />
22 {% endif %}
23 {% endfor %}
24 {% endif %}
25 {% block link %}
26 {% if head.icon.ico is defined and head.icon.ico is not empty %}
27 <link rel="shortcut icon" type="image/x-icon" href="{{ asset(head.icon.ico) }}" />
28 {% endif %}
29 {% if head.icon.png is defined and head.icon.png is not empty %}
30 {% for size, icon in head.icon.png %}
31 {# Apple #}
32 {% if size in [120, 152, 167, 180] %}
33 {% if size == 180 %}
34 <link rel="apple-touch-icon" href="{{ asset(icon) }}" />
35 {% endif %}
36 <link rel="apple-touch-icon" sizes="{{ size }}x{{ size }}" href="{{ asset(icon) }}" />
37 {# Windows #}
38 {% elseif size in [70, 150, 310] %}
39 <meta name="msapplication-square{{ size }}x{{ size }}logo" content="{{ asset(icon) }}" />
40 {# Others #}
41 {% else %}
42 <link rel="icon" type="image/png" sizes="{{ size }}x{{ size }}" href="{{ asset(icon) }}" />
43 {% endif %}
44 {% endfor %}
45 {% endif %}
46 {% if head.icon.svg is defined and head.icon.svg is not empty %}
47 <link rel="icon" type="image/svg+xml" href="{{ asset(head.icon.svg) }}" />
48 {% endif %}
49 {# stylesheet '//fonts.googleapis.com/css?family=Irish+Grover' '//fonts.googleapis.com/css?family=La+Belle+Aurore' '@RapsysBlogBundle/Resources/public/css/{reset,screen}.css' #}
50 {% stylesheet '@RapsysBlog/css/{reset,droidsans,lemon,notoemoji,screen}.css' %}
51 <link rel="stylesheet" type="text/css" href="{{ asset_url }}?{{ 'now'|date('U') }}" />
52 {% endstylesheet %}
53 {% stopwatch 'stylesheet' %}
54 {% endstopwatch %}
55 {% if head.canonical is defined and head.canonical %}
56 <link rel="canonical" href="{{ head.canonical }}"{% if head.locale is defined and head.locale %} hreflang="{{ head.locale }}"{% endif %} />
57 {% endif %}
58 {% if head.alternates is defined and head.alternates %}
59 {% for lang, alternate in head.alternates %}
60 <link rel="alternate" href="{{ alternate.absolute }}" hreflang="{{ lang }}" />
61 {% endfor %}
62 {% endif %}
63 {% if head.prev is defined and head.prev %}
64 <link rel="prev" href="{{ head.prev }}" hreflang="{{ head.locale }}" />
65 {% endif %}
66 {% if head.next is defined and head.next %}
67 <link rel="next" href="{{ head.next }}" hreflang="{{ head.locale }}" />
68 {% endif %}
69 {% endblock %}
70 {% endblock %}
71 </head>
72 <body>
73 {% block body %}
74 {% block header %}
75 <header id="header">
76 <a id="logo" href="{{ path(head.root) }}" title="{{ head.site }}">
77 <img src="{{ asset(head.logo.svg) }}?20221024100144" srcset="{{ asset(head.logo.png) }}?20221024100144 200w, {{ asset(head.logo.svg) }}?20221024100144 400w" sizes="(min-width:400px) 400px, 200px" alt="{{ head.logo.alt }}" width="100" height="60" />
78 <strong>{{ head.site }}</strong>
79 </a>
80 <nav id="nav">
81 <a href="{{ path('rapsys_blog') }}" rel="home">{% trans %}Home{% endtrans %}</a>
82 <a href="{{ path('rapsys_blog_contact') }}" rel="contact">{% trans %}Contact{% endtrans %}</a>
83 {#<a href="{{ path('rapsys_blog_frequently_asked_questions') }}">{% trans %}Frequently asked questions{% endtrans %}</a>#}
84 {#{% if is_granted('ROLE_ADMIN') %}#}
85 <a href="{{ path('rapsys_blog_user') }}">{% trans %}Users{% endtrans %}</a>
86 {#{% endif %}#}
87 {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
88 <a href="{{ path('rapsys_user_edit', {mail: app.user.mail|short, hash: app.user.mail|short|hash}) }}">{% trans %}My account{% endtrans %}</a>
89 <a href="{{ path('rapsys_user_logout') }}">{% trans %}Logout{% endtrans %}</a>
90 {% else %}
91 <a href="{{ path('rapsys_user_login') }}">{% trans %}Login{% endtrans %}</a>
92 <a href="{{ path('rapsys_user_register') }}">{% trans %}Register{% endtrans %}</a>
93 {% endif %}
94 </nav>
95 {#{% block site_subtitle %}{% endblock %}
96 {% block site_tagline %}
97 {% if tags is defined and tags %}
98 <ul>
99 {% for id, tag in tags %}
100 <li><h2><a href="#{{id}}">{{tag}}</a></h2></li>
101 {% endfor %}
102 </ul>
103 {% endif %}
104 {% endblock %}#}
105 </header>
106 {% endblock %}
107 {% block message %}
108 {# pass an array argument to get the messages of those types (['warning', 'error']) #}
109 {% for label, messages in app.flashes %}
110 {% if messages %}
111 <section class="message {{label}}">
112 <ul>
113 {% for message in messages %}
114 <li>{{ message }}</li>
115 {% endfor %}
116 </ul>
117 </section>
118 {% endif %}
119 {% endfor %}
120 {% endblock %}
121 {% endblock %}
122 {#{% block sidebar %}<aside id="sidebar"></aside>{% endblock %}#}
123 {% block content %}
124 <article>
125 <header>
126 {% block title %}<h1 id="title"><a href="{{ head.canonical }}">{{ title }}</a></h1>{% endblock %}>
127 <p>{{ description }}</p>
128 </header>
129 </article>
130 {% endblock %}
131 {% block footer %}
132 <footer id="footer">
133 <a href="{{ path('rapsys_blog_about') }}">{% trans %}About{% endtrans %}</a>
134 {% if copy is defined and copy %}
135 <details><summary>{{ copy.long }}</summary><span>{{ copy.short }} <a href="{{ copy.link }}" title="{{ copy.title }}" rel="author">{{ copy.by }}</a></span></details>
136 {% endif %}
137 {#<a href="{{ path('rapsys_blog_terms_of_service') }}">{% trans %}Terms of service{% endtrans %}</a>#}
138 {% if head.alternates is defined and head.alternates %}
139 {% set langs = head.alternates|keys|filter(v => v|length == 5) %}
140 {% if langs|length > 1 %}
141 <ul>
142 {% for lang in langs %}
143 <li><a href="{{ head.alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ head.alternates[lang].title }}">{{ head.alternates[lang].translated }}</a></li>
144 {% endfor %}
145 </ul>
146 {% else %}
147 {% set lang = langs|first %}
148 <a href="{{ head.alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ head.alternates[lang].title }}">{{ head.alternates[lang].translated }}</a>
149 {% endif %}
150 {% else %}
151 <span>&nbsp;</span>
152 {% endif %}
153 </footer>
154 {% endblock %}
155 {% block javascripts %}
156 {% stopwatch 'javascript' %}
157 {#{% javascript '@RapsysBlog/js/*.js' %}
158 <script type="text/javascript" src="{{ asset_url }}"></script>
159 {% endjavascript %}#}
160 {% endstopwatch %}
161 {% endblock %}
162 </body>
163 </html>