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