-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbase.html.twig
141 lines (129 loc) · 6.47 KB
/
base.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!doctype html>
<html dir="{{ site.textDirection|default('ltr') }}" lang="{{ site.locale|default('en') }}" class="no-js">
<head>
{% set info_notes = page.messages.info ?? [] -%}
{%- set success_notes = page.messages.success ?? [] -%}
{%- set warning_notes = page.messages.warning ?? [] -%}
{%- set error_notes = page.messages.error ?? [] -%}
{%- set thumbnail = page.thumbnailImage.0.src|default(absolute_url(asset('images/w3c-opengraph-image.png', 'website-2021'))) -%}
<title>
{%- block documenttitle -%}
{%- set title_acl -%}
{%- if page.access_control is defined -%}
{%- if page.access_control.text is defined -%}
({{ page.access_control.text }})
{%- else -%}
{%- if page.access_control.acl is defined -%}
{%- set acl = page.access_control.acl -%}
{%- else -%}
{%- set acl = 'private' -%}
{%- endif -%}
({{ ('page.acl.' ~ acl)|trans({}, 'w3c_website_templates_bundle') }})
{%- endif -%}
{%- endif -%}
{%- endset -%}
{%- if error_notes|length > 0 -%}Error: {% endif -%}
{# recursively produces title from breadcrumbs, including acl info if present #}
{%- macro title(breadcrumb, title_acl=null) -%}
{%- if breadcrumb.parent is defined and breadcrumb.parent -%}
{{- breadcrumb.title }}{{ title_acl ? ' ' ~ title_acl : '' }} | {{ _self.title(breadcrumb.parent) }}
{%- else -%}
W3C
{%- endif -%}
{%- endmacro -%}
{% if page.breadcrumbs is defined and page.breadcrumbs %}
{{- _self.title(page.breadcrumbs, title_acl) -}}
{% elseif page.title is defined and page.title != 'W3C' %}
{{- page.title }} | W3C
{%- else -%}
W3C
{%- endif -%}
{%- endblock -%}
</title>
{{~ include('@W3CWebsiteTemplates/_common-head.html.twig') }}
<meta name="description" content="{% block description %}{{ page.excerpt|default('page.default_description'|trans({}, 'w3c_website_templates_bundle')) }}{% endblock %}"/>
<meta name="thumbnail" content="{{ thumbnail }}"/>
{# <meta property="fb:app_id" content="__hardcoded_fb_app_id__"> #}
<meta property="og:url" content="{{ app.request.uri }}"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="{{ page.title|default('W3C') }}"/>
<meta property="og:image" content="{{ thumbnail }}"/>
<meta property="og:image:width" content="1200"/>
<meta property="og:image:height" content="630"/>
<meta property="og:description" content="{{ block('description') }}"/>
<meta property="og:site_name" content="W3C"/>
{# <meta property="og:locale" content="{{ locale|replace('-', '_') }}"/> #}
{#
{% for locale in locales -%}
<meta property="og:locale:alternate" content="{{ locale|replace('-', '_') }}"/>
{% endfor %}
#}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:site" content="w3c"/>
<meta name="twitter:url" content="{{ app.request.uri }}"/>
<meta name="twitter:title" content="{{ page.title|default('W3C') }}"/>
<meta name="twitter:description" content="{{ block('description') }}"/>
<meta name="twitter:image" content="{{ thumbnail }}"/>
{%- if page.expiryDate is defined and page.expiryDate -%}
<meta name="robots" content="unavailable_after: {{ page.expiryDate }}"/>
{% endif %}
{% block stylesheets %}{% endblock stylesheets %}
{% block javascripts %}{% endblock javascripts %}
{% if page.feeds is defined %}
{% for feed in page.feeds %}
<link href="{{ feed.href }}" title="{{ feed.title }}" rel="alternate" type="application/rss+xml" />
{% endfor %}
{% endif %}
{% block head_other %}{% endblock %}
</head>
<body {% block body_classes %}class="{{ body_classes|default('default') }}"{% endblock %}>
<a class="skip-link" href="#main">{{ 'page.skip_to_content'|trans({}, 'w3c_website_templates_bundle') }}</a>
<div class="grid-wrap">
<div class="wrap">
<header class="global-header">
<span role="status" aria-live="polite"></span>
{# % block banner %}
{{ include('@W3CWebsiteTemplates/components/styles/banner.html.twig') }}
{% endblock banner %#}
{% block access_control %}
{{ include('@W3CWebsiteTemplates/components/styles/access_control.html.twig') }}
{% endblock %}
{% block lang_nav %}
{{ include('@W3CWebsiteTemplates/components/styles/lang_nav.html.twig') }}
{% endblock lang_nav %}
{% block global_nav %}
{% embed '@W3CWebsiteTemplates/components/styles/global_nav.html.twig' with {
'navigation': navigation|default([])
} %}{% endembed %}
{% endblock global_nav %}
</header>
{% block breadcrumbs %}
{% embed '@W3CWebsiteTemplates/components/styles/breadcrumbs.html.twig' with {
'breadcrumbs': page.breadcrumbs is defined ? page.breadcrumbs : {}
} %}{% endembed %}
{% endblock breadcrumbs %}
<main id="main" {% block extra_main_attributes %}{{ extra_main_attributes|default('')|raw }}{% endblock %}>
{% import '@W3CWebsiteTemplates/components/styles/notes.html.twig' as notes %}
{{ notes.errors(error_notes) }}
{{ notes.successes(success_notes) }}
{{ notes.warnings(warning_notes) }}
{{ notes.info(info_notes) }}
{% block notes %}{% endblock %}
{% block main %}{% endblock %}
{% block pre_footer %}{% endblock %}
</main>
{% block crosslinks %}
{% if crosslinks is defined and crosslinks['links'] is defined and crosslinks['links']|length > 0 %}
{{ include('@W3CWebsiteTemplates/components/styles/crosslinks.html.twig') }}
{% endif %}
{% endblock crosslinks %}
</div>
{% block footer %}
{% embed '@W3CWebsiteTemplates/components/styles/footer.html.twig' with {
'links': footerlinks is defined ? footerlinks : {}
} %}{% endembed %}
{% endblock %}
</div>
{% block closing_body_scripts %}{% endblock %}
</body>
</html>