-
Notifications
You must be signed in to change notification settings - Fork 23
/
standalone_resource.html
335 lines (291 loc) · 10.7 KB
/
standalone_resource.html
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
{%- assign pagelang = 'en' -%}
{%- if page.lang -%}
{%- assign pagelang = page.lang -%}
{%- endif -%}
{%- if pagelang == 'en' -%}
{%- assign enpage = page -%}
{%- else -%}
{%- assign enpage=site.documents | where:"ref", page.ref | where: "lang", "en" | first -%}
{%- unless enpage.ref -%}
{%- assign enpage=site.pages | where:"ref", page.ref | where: "lang", "en" | first -%}
{%- endunless -%}
{%- endif -%}
{%- assign englishpageurl = enpage.url %}
{%- assign translations=site.documents | where:"ref", page.ref | where_exp:"item", "item.lang != 'en'" | sort: 'lang' %}
{%- unless translations[0].ref -%}
{% assign translations=site.pages | where:"ref", page.ref | where_exp:"item", "item.lang != 'en'" | sort: 'lang' %}
{%- endunless -%}
<!DOCTYPE html>
<html class="no-js" lang="{% if page.lang %}{{page.lang}}{% else %}en{% endif %}" dir="{% if site.data.lang[pagelang].rtl %}rtl{% else %}ltr{% endif %}" prefix="og: http://ogp.me/ns#">
{%- assign timestamp = site.time | date: '%s%N' -%}
{%- assign timestamp = '?' | append: timestamp -%}
{%- include_cached head.html type="start" timestamp=timestamp -%}
{%- if site.data.lang[pagelang].rtl -%}
<title> W3C | WAI | {%if page.type_of_guidance %}{{page.type_of_guidance}} | {% endif%}{%if page.proposed %}[proposed]{% endif %}{{page.title}}</title>
{%- else -%}
<title> {{page.title}}{%if page.proposed %}[proposed]{% endif %} | {%if page.type_of_guidance %}{{page.type_of_guidance}} | {% endif%}WAI | W3C</title>
{%- endif -%}
{%- if page.external_css %}<link rel="stylesheet" href="{{ page.external_css | relative_url | append: timestamp }}">{% endif -%}
{%- if page.ext_css %}<link rel="stylesheet" href="{{ page.ext_css | prepend: '/css/' | prepend: page.collection | prepend: '/' | relative_url | append: timestamp }}">{% endif -%}
{%- if page.inline_css %}<style>{{ page.inline_css }}</style>{% endif -%}
{%- capture seo -%}
{%- seo title=false -%}
{%- endcapture -%}
{{- seo | replace: '<meta name="twitter:card" content="summary" />', '<meta name="twitter:card" content="summary_large_image" />' -}}
{%- unless page.image -%}{%- if site.twitter.image -%}{% assign twimage = site.twitter.image -%}{%- else -%}{% assign twimage = '/assets/images/social-sharing-default.jpg' -%}{%- endif -%}
<meta name="twitter:image" property="og:image" content="{{ twimage | relative_url | prepend: site.url }}">
{%- endunless -%}
{% include_cached head.html type="end" %}
<body id="top" class="page-{{page.title | slugify}} {% include_cached body-class.html collection=page.collection doc-note-type=page.doc-note-type pageclass=page.class%}">
<a href="#main" class="button button--skip-link">Skip to content</a>
<div class="minimal-header-container default-grid">
{% if page.standalone_resource_header %}
{% assign mhtitle = page.standalone_resource_header.title %}
{% else %}
{% assign mhtitle = page.standalone_resource_doc_name %}
{% endif %}
{% include minimal-header.html translations = translations
title = mhtitle
subtitle = page.standalone_resource_header.subtitle
link = page.standalone_resource_header.link
title-ref=page.standalone_resource_header.title-ref %}
</div>
<div class="default-grid nav-container">
<div class="nav" >
{% if page.standalone_resource_pager %}
{% assign pager = page.standalone_resource_pager %}
<nav class="nav standalone-resource-pager" aria-label="{{page.type_of_guidance}}">
<ul>
<li class="nav__item">
{%- if page.standalone_resource_pager.icon -%}
{%- capture icon-element -%}<img src="{{page.standalone_resource_pager.icon | relative_url }}" alt="" class="category-icon">{%- endcapture -%}
{%- endif -%}
{% assign ref = pager.ref | split: "#" | first %}
{%- if page.permalink == ref %}
<a class="pagename active" aria-current="page">{{icon-element}}{{pager.name}}</a>
{%else%}
<a href="{{pager.ref | relative_url}}">{{icon-element}}{{pager.name}}</a>
{%endif%}
</li>
{% if page.standalone_resource_pager.include %}
{% include {{ page.standalone_resource_pager.include }} %}
{% if context %}
<li class="nav__item"><a href="{{ context[1] | relative_url }}">{% include_cached icon.html class="pager-icon" name="arrow-up-thin" %} {{ context[0] }}: {{context[2]}}</a></li>
{% endif %}
{% if prev %}
<li class="nav__item"><a href="{{ prev[1] | relative_url }}">{% include_cached icon.html class="pager-icon" name="arrow-left-thin" %} {{ prev[0] }}</a></li>
{% endif %}
{% if next %}
<li class="nav__item"><a href="{{ next[1] | relative_url }}">{{ next[0] }} {% include_cached icon.html class="pager-icon" name="arrow-right-thin" %}</a></li>
{% endif %}
{% endif %}
</ul>
</nav>
{% elsif page.standalone_resource_nav_links %}
<nav class="nav" aria-label="{{page.type_of_guidance}}">
<ul>
{% for link in page.standalone_resource_nav_links %}
<li class="nav__item"><a href="{{ link.ref | relative_url }}"{% if page.permalink == link.ref %} class="active" aria-current="page"{% endif %}>{{ link.name }}</a></li>
{% endfor %}
<li class="nav__item"><a href="https://www.w3.org/WAI/standards-guidelines/wcag/docs/">
All WCAG 2 Guidance
{% include_cached icon.html name="different-view" %}
</a></li>
</ul>
</nav>
{% endif %}
</div>
</div>
<div class="default-grid with-gap leftcol">
<style>
.nav {
background: none;
}
.nav-related-info { /* blue bar with the "About:" links */
background: #005a9c;
color: #fff;
}
.nav-related-info a {
color: #fff !important;
}
.nav-page-specific { /* light blue bar with page/section specific navigation/pager */
margin-bottom: 1.25em;
}
.nav a:link, .nav a:visited {
color: #036;
color: var(--w3c-blue);
}
.nav a:hover, .nav a:active {
color: var(--dk-blue);
}
.nav-hack.sidebar a:hover,
.nav-hack.sidebar a:active
{
color: var(--dk-blue);
text-decoration: underline;
}
.standalone-resource-about, .standalone-resource-pager {
margin: 0;
}
nav.standalone-resource-about {
padding: .5em 0 1.5em 0;
font-style: italic;
}
.nav .standalone-resource-pager ul {
align-items: center;
}
.nav .standalone-resource-pager a,
.nav .standalone-resource-pager span {
margin-left: 0;
margin-right: 1.5em;
padding: .5em;
}
.pager-icon {
vertical-align: middle;
padding: 0 0 0.15em 0;
margin: 0 -0.4em;
width: 1.65em;
height: 2em;
fill: var(--dk-blue)
}
.category-icon {
vertical-align: middle;
padding: 0 0.25em 0.25em 0.25em;
width: 2em;
height: 2em;
}
.zstandalone-resource-pager {
padding: .7em 0;
}
.standalone-resource-pager zul {
display: block;
}
.standalone-resource-pager zul li {
display: inline;
}
.nav-hack {
font-size: .85rem;
/*justify-self: end;*/
align-self: start;
}
.nav-hack ul {
list-style: none;
border-bottom: 1px solid #BCBCBC;
padding-left: 0
}
.nav-hack li:not(:first-child){
padding-top: 0.4em;
line-height: 1.2;
border-top: 1px solid #BCBCBC;
}
.nav-hack li a {
text-decoration: none;
}
.nav-hack h3 {
margin: 0;
font-size: 1rem;
}
.nav-hack p {
margin: 0;
}
h2#sidebar-header {
font-size: .95rem;
}
/* skip link */
.button--skip-link {
background-color: var(--gold) !important;
border-color: var(--gold) !important;
outline-color: currentColor !important;
color: var(--off-black) !important;
font-weight: 600;
font-size: larger;
margin: 0 auto;
position: absolute;
z-index: 20;
left: 0;
right: 0;
top: 0.5em;
width: 10em;
opacity: 1;
transition: transform 0.1875s ease-out, opacity 0.1875s ease-out;
}
.button--skip-link:not(:focus):not(:hover) {
transform: translateY(-4em);
opacity: 0;
}
.standalone-resource-navrule {
border:none;
border-top: 1px solid grey
}
.standalone-resource-about ul,
.standalone-resource-pager ul {
list-style: none;
}
.standalone-resource-about a,
.standalone-resource-pager a,
.standalone-resource-about span,
.standalone-resource-pager span
{
margin-left:.8em;
margin-right:.8em;
}
.minimal-header-name a {
text-decoration: none;
}
.minimal-header-name a:hover,
.minimal-header-name a:focus {
text-decoration: underline;
}
</style>
{% assign sidebar = page.sidebar %}
{% if sidebar == nil %} {% assign sidebar = layout.sidebar %} {% endif %}
{% if sidebar %}
<nav class="box nav-hack sidebar standalone-resource__sidebar " aria-labelledby="sidebar-header">
<h2 id="sidebar-header" class="box-h ">Page Contents</h2>
{% capture expanded_content %}{{ content | add_h2_ids }} {% endcapture %}
<div class="box-i">
<ul>
{% assign h2links = expanded_content | get_h2_links %}
{% for link in h2links %}
<li><a href="#{{ link[1] }}">{{ link[0] }}</a></li>
{% endfor %}
</ul>
</div>
</nav>
{%else%}
{% assign expanded_content = content %}
{% endif %}
<main id="main"{% if page.lang %} lang="{{page.lang}}"{% endif %} class="standalone-resource__main">
<header>
<h1>
{% if page.type_of_guidance %}
<span class="standalone-resource__type-of-guidance">
{% if page.proposed %}
Proposed
{% endif %}
{% if page.type_of_guidance_in_content %}{{ page.type_of_guidance }}:{% endif %}
</span>
{% endif %}
{% if page.title_html %}{{ page.title_html }}{% else %}{{ page.title }}{% endif %}
</h1>
</header>
{{ expanded_content }}
</main>
</div>
<div class="default-grid with-gap leftcol">
<div class="standalone-resource__prevnext">
{%- if page.navigation -%}
{%- include prevnext-navigation.html -%}
{%- else -%}
{%- if page.order -%}
{%- include prevnext-order.html -%}
{%- endif -%}
{%- endif -%}
{% include feedback-box.html %}
</div>
</div>
{% include_cached backtotop.html lang=page.lang %}
</div>
{% include footer.html lang=pagelang inner-style="-ms-grid-column: 2; -ms-grid-column-span: 8; grid-column: 2 / 8;" %}
</body>
</html>