-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.twig
205 lines (187 loc) · 8.15 KB
/
index.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
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
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<title>{{ options.title }}</title>
<meta name="description" content="">
<meta name="generator" content="kss-node">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="kss-assets/kss.css">
{% if options.highlightSyntax %}
<link rel="stylesheet" href="kss-assets/syntax-highlighting/prism.css">
{% endif %}
{{ styles|raw }}
</head>
<body id="kss-node" class="kss-offscreen is-moved">
<a id="kss-offscreen-toggle" class="kss-offscreen__toggle is-active" aria-expanded="true" aria-controls="offscreen-item" role="button">Open or Close the menu</a>
<div class="kss-offscreen__inner">
<header class="kss-style kss-header">
<h1 class="kss-doc-title">{{ options.title }}</h1>
</header>
<div class="kss-style kss-sidebar kss-offscreen__item" id="offscreen-item">
<div class="kss-search">
<label for="kss-search" style="display: none;">Search</label>
<input id="kss-search" name="kss-search" type="text" placeholder="Search components" title="Quick search" />
</div>
<nav class="kss-nav">
<ul class="kss-nav__menu">
<li class="kss-nav__menu-item">
<a class="kss-nav__menu-link" href="./">
<span class="kss-nav__ref">0</span
><span class="kss-nav__name">Overview</span>
</a>
</li>
{% for menu_item in menu %}
<li class="kss-nav__menu-item">
<a class="kss-nav__menu-link" href="section-{{ menu_item.referenceURI }}.html">
<span class="kss-nav__ref">{{ menu_item.referenceNumber }}</span><span class="kss-nav__name">{{ menu_item.header }}</span>
</a>
{% if menu_item.isActive and menu_item.children is not empty %}
<ul class="kss-nav__menu-child">
{% for menu_child in menu_item.children %}
<li class="kss-nav__menu-item {% if menu_child.isGrandChild %}kss-nav__menu-subchild{% endif %}">
<a class="kss-nav__menu-link" href="section-{{ menu_item.referenceURI }}.html#kssref-{{ menu_child.referenceURI }}">
<span class="kss-nav__ref {% if menu_child.isGrandChild %}kss-nav__ref-child{% endif %}">{{ menu_child.referenceNumber }}</span
><span class="kss-nav__name">{{ menu_child.header }}</span>
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
</div>
<article role="main" class="kss-main">
<div class="kss-offscreen__nav-backdrop" id="kss-offscreen-item-backdrop"></div>
{% if homepage %}
<div id="kssref-0" class="kss-section kss-section--depth-0 kss-overview kss-style">
{{ homepage|raw }}
</div>
{% else %}
{#
Display each section, in order.
The "root" element comes first in this loop, and can be detected using the
"loop.first" variable as seen below.
#}
{% set hide_example = false %}
{% for section in sections %}
{% set sectionElement = loop.first ? 'div' : 'section' %}
{% if section.header == 'Mockups' or section.header == 'Templates' %}
{% set hide_example = true %}
{% endif %}
<{{ sectionElement }} id="kssref-{{ section.referenceURI }}" class="kss-section kss-section--depth-{{ section.depth }}">
<div class="kss-style">
{% set headerElement = (section.depth > 6) ? 'h6' : 'h' ~ section.depth %}
<{{ headerElement }} class="kss-title kss-title--level-{{ section.depth }}">
<a class="kss-title__ref" href="#kssref-{{ section.referenceURI }}">{{ section.referenceNumber }}</a>
{{ section.header }}
{% if section.depth != 1 %}<a href="item-{{ section.referenceURI }}.html?hideAll" target="_blank" class="kss-title__view-link">View in a new window</a>{% endif %}
</{{ headerElement }}>
{% if section.description %}
<div class="kss-description">
{{ section.description|raw }}
{% if section.markupFile %}
<p>Twig: <code>{{ section.markupFile }}</code></p>
{% endif %}
</div>
{% endif %}
{% if section.colors %}
<ul class="kss-color__wrapper">
{% for color in section.colors %}
<li class="kss-color">
<div class="kss-color__swatch" style="background-color:{{ color.color }}"></div>
<div class="kss-color__details">
{% if color.name %}
<strong class="kss-color__name">{{ color.name }}</strong>
{% endif %}
<span class="kss-color__value"><code>{{ color.color }}</code></span>
{% if color.description %}
<span class="kss-color__description">{{ color.description }}</span>
{% endif %}
</div>
</li>
{% endfor %}
</ul>
{% endif %}
{% for parameter in section.parameters %}
{% if loop.first %}
<div class="kss-parameters__title">Parameters:</div>
<ul class="kss-parameters">
{% endif %}
<li class="kss-parameters__item">
<div class="kss-parameters__name"><code>{{ parameter.name }}</code></div>
<div class="kss-parameters__description">
{{ parameter.description|raw }}
{% if parameter.defaultValue %}
<div class="kss-parameters__default-value">
Defaults to: <code>{{ parameter.defaultValue }}</code>
</div>
{% endif %}
</div>
</li>
{% if loop.last %}
</ul>
{% endif %}
{% endfor %}
</div>
{% if section.example and not hide_example %}
<div class="kss-modifier__wrapper">
<div class="kss-modifier__heading kss-style">
{% if section.modifiers is not empty %}Default example{% else %}Example{% endif %}
</div>
<div class="kss-modifier__example {{ options.exampleClass|default('') }}">
{{ section.example|raw }}
</div>
</div>
{% for modifier in section.modifiers %}
<div class="kss-modifier__wrapper">
<div class="kss-modifier__heading kss-style">
{{ modifier.description|raw }}
</div>
<div class="kss-modifier__example {{ options.exampleClass|default('') }}">
{{ modifier.markup|raw }}
</div>
</div>
{% endfor %}
{% if section.markup and options.showMarkup %}
<details class="kss-markup kss-style">
<summary>Markup</summary>
<pre class="{{ options.markupClass|default('language-html') }}"><code class="{{ options.markupClass|default('language-html') }}">{{ section.markup|escape('html') }}</code></pre>
</details>
{% endif %}
{% endif %}
{% if section.sourceFile.name %}
<div class="kss-source kss-style">
Source: <code>{{ section.sourceFile.name }}</code>, line {{ section.sourceFile.line }}
</div>
{% endif %}
</{{ sectionElement }}>
{% endfor %}
{% endif %}
</article>
<ul id="kss-toc" style="display: none;">
{% for menu_item in menu %}
<li data-url="section-{{ menu_item.referenceURI }}.html#kssref-{{ menu_item.referenceURI }}" data-name="{{ menu_item.referenceNumber }} {{ menu_item.header }}"></li>
{% if menu_item.children is not empty %}
{% for menu_child in menu_item.children %}
<li data-url="section-{{ menu_item.referenceURI }}.html#kssref-{{ menu_child.referenceURI }}" data-name="{{ menu_child.referenceNumber }} {{ menu_child.header }}"></li>
{% endfor %}
{% endif %}
{% endfor %}
</ul>
</div>
<!-- SCRIPTS -->
<script src="kss-assets/auto-complete.min.js"></script>
<script src="kss-assets/kss.js"></script>
<script src="kss-assets/kss.hideAll.js"></script>
<script src="kss-assets/kss.offscreen.js"></script>
<script src="kss-assets/kss.autocomplete.js"></script>
<script src="kss-assets/details-element-polyfill.min.js"></script>
{{ scripts|raw }}
{% if options.highlightSyntax %}
<script src="kss-assets/syntax-highlighting/prism.js"></script>
{% endif %}
</body>
</html>