-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdefault.html
308 lines (253 loc) · 9.66 KB
/
default.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
{%- seo -%}
<meta name="viewport" content="width=device-width">
{%- for static_file in site.static_files -%}{% if static_file.path contains 'site-specific/favicon.ico' %}
<link rel="shortcut icon" href="{{ 'assets' | relative_url }}/img/site-specific/favicon.ico" type="image/x-icon" />
{% endif-%}{%- endfor -%}
<link rel="stylesheet" href="{{ 'assets/css/style.css' | relative_url }}">
<link rel="stylesheet" href="{{ 'assets/css/site_style.css' | relative_url }}">
</head>
<body>
<div id="headband">
{%- for static_file in site.static_files -%}{%- if static_file.path contains 'site-specific/site-logo-topleft.png' -%}
<img src="{{ 'assets' | relative_url }}/img/site-specific/site-logo-topleft.png" id="logo_topleft" />
{%- endif -%}{%- endfor -%}
{%- for static_file in site.static_files -%}{%- if static_file.path contains 'site-specific/site-logo-topright.png' -%}
<img src="{{ 'assets' | relative_url }}/img/site-specific/site-logo-topright.png" id="logo_topright" />
{%- endif -%}{%- endfor -%}
</div>
<div class="wrapper" style="margin-top: 20px">
<header id="header">
<a href="{{ '/' | relative_url }}">
<h2>{{ site.label }}</h2>
<div style="font-size: 0.9em; margin-top: -10px; margin-bottom: 15px;">{{ site.tagline }}</div>
</a>
{%- comment -%}
* categories from _config.yaml
* those are contained in nav_cat_blocks
{%- endcomment -%}
{%- assign nav_itemno = 5 -%}
{%- if site.navigation_max_items -%}
{%- assign nav_itemno = site.navigation_max_items -%}
{%- endif -%}
{%- for this_nav_cat_block in site.nav_cat_blocks -%}
{%- assign block_key = this_nav_cat_block[0] -%}
{%- assign block_label_type = this_nav_cat_block[1] | split: ',' -%}
{%- if block_label_type[1] == 'categories' -%}
{%- unless block_label_type[2] == 'hide' -%}
<h5>{{block_label_type[0]}}</h5>
{%- endunless -%}
{%- for this_category in site[block_key] -%}
{%- assign cat_label = this_category[1] -%}
{%- assign cat_key = this_category[0] -%}
{%- assign cat_page = cat_key | append: '.html' -%}
<h4 class="catlink"><a href="{{ 'categories' | relative_url }}/{{cat_page}}">{{ cat_label }}</a></h4>
{%- comment -%}
* posts are listed if same category as current page
* the "this_name" fix is for the category collection pages - e.g. /howto.md
which are identical in content (i.e. no "category" in front matter) & only
differ in their name (=> category)
{%- endcomment -%}
{%- assign this_name = page.name | split: "." -%}
{%- if page.category contains cat_key or this_name[0] == cat_key -%}
{%- assign cat_posts = site.documents | where: 'category', cat_key | sort: 'date' | reverse -%}
{%- comment -%}
* first featured posts
* those are subtracted from the nav_itemno count ...
{%- endcomment -%}
{%- for post in cat_posts -%}{%- if post.tags contains '.featured' -%}
<div class="sublink">
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
</div>
{%- assign nav_itemno = nav_itemno | minus: 1 -%}{%- endif -%}{%- endfor -%}
{%- for post in cat_posts limit: nav_itemno -%}{%- unless post.tags contains '.featured' or post.tags contains '.prepend' or post.tags contains '.append' -%}
{%- comment -%}
* others than the featured posts
{%- endcomment -%}
<div class="sublink" >
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
</div>
{%- endunless -%}{%- endfor -%}
{%- comment -%}
* link to the category collecting page, if more than nav_itemno
{%- endcomment -%}
{%- if cat_posts.size > nav_itemno -%}
<div class="sublink" >
<a href="{{ 'categories' | relative_url }}/{{cat_page}}">all ...</a>
</div>
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- comment -%}
* / categories from _config.yaml
* begin related_sites from _config.yml
{%- endcomment -%}
{%- assign nav_cat_blocks_cat = block_label_type[1] -%}
{%- if site[nav_cat_blocks_cat] -%}
{%- unless nav_cat_blocks_cat == 'categories' -%}
{%- unless block_label_type[2] == 'hide' -%}
<h5>{{block_label_type[0]}}</h5>
{%- endunless -%}
{%- for this_link in site[nav_cat_blocks_cat] -%}
{%- assign link_label = this_link[0] -%}
{%- assign link_link = this_link[1] -%}
{%- unless site.site_domain_name == link_link -%}
<div class="sublink">
<a href="{{ link_link }}">{{ link_label }}</a>
</div>
{%- endunless -%}
{%- endfor -%}
{%- endunless -%}
{%- endif -%}
{%- endfor -%}
{%- comment -%}
* / related_sites from _config.yml
* / of nav_cat_blocks
* begin of tags
{%- endcomment -%}
<h5>Tags</h5>
<div style="text-align:center;">
{%- assign tags = site.emptyArray -%}
{%- for this_post in site.documents -%}
{%- if this_post.tags -%}
{%- assign tags = tags | concat: this_post.tags -%}
{%- endif -%}
{%- endfor -%}
{%- assign tags_unique = site.cloud_tags | uniq | sort -%}
{%- for tag in tags_unique -%}
{%- assign counter = 0 -%}
{%- for this_tag in tags -%}
{%- if this_tag == tag -%}
{%- assign counter = counter | plus: 1 -%}
{%- endif -%}
{%- endfor -%}
{%- unless tag contains '.' or counter < 1 -%}
<div class="site-tag">
<a href="{{ '/tags' | relative_url }}/{{ tag }}.html" style="font-size: {{ counter | plus: 70 }}%">{{ tag | replace: "--", "::" | replace: "_", " " }}</a>
</div>
{%- endunless -%}
{%- endfor -%}
</div>
</header>
{%- comment -%}
* / tags
* / header
* begin page content
{%- endcomment -%}
<section>
{{ content }}
{%- comment -%}
* after the page content, some links from definitions in the YAML front
matter of the file
{%- endcomment -%}
{%- if page.pdf_file_name or page.www_link or page.www_links_formatted -%}
<h4>Links</h4>
<ul>
{%- if page.pdf_file_name -%}
{%- for this_file in site.static_files -%}
{% if this_file.name == page.pdf_file_name %}
<li><a href="{{this_file.path}}" target="_blank">[PDF]</a>
{% if page.pdf_file_type %}
({{ page.pdf_file_type }})
{% endif %}
{% endif %}</li>
{%- endfor -%}
{%- endif -%}
{% if page.www_link %}
<li><a href="{{ page.www_link }}" target="_blank">[www]</a></li>
{% endif %}
{%- if page.www_links_formatted -%}
{% for this_link in page.www_links_formatted %}
<li>{{ this_link }}</li>
{% endfor %}
{%- endif -%}
</ul>
{%- endif -%}
{%- comment -%}
* date and author based on front matter, if defined there
* formatted as github link if @author style
{%- endcomment -%}
{%- if page.date -%}
<div class="pagestamp">
<hr />
{%- if page.author -%}
{%- assign this_author = page.author -%}
{%- if this_author contains "@" -%}
{% assign this_author = this_author | remove: "@" %}
<a href="https://github.com/{{this_author}}/" target="_blank">{{this_author}}</a>,
{%- else -%}
{% if page.author_link contains "http" %}
<a href="{{page.author_link}}" target="_blank">{{this_author}}</a>,
{% else %}
{{this_author}},
{% endif %}
{%- endif -%}
{%- endif -%}
{{ page.date | date: "%Y-%m-%d" }}
</div>
{%- endif -%}
</section>
{%- comment -%}
* / page content
* begin footer
{%- endcomment -%}
<footer>
{%- for static_file in site.static_files -%}{%- if static_file.path contains 'site-specific/site-logo-main.png' -%}
<a href="{{ site.site_parent_link }}">
<img style="margin-top:15px; float: left;" src="{{ 'assets' | relative_url }}/img/site-specific/site-logo-main.png" />
</a>
{%- endif -%}{%- endfor -%}
</footer>
{%- comment -%}
* / footer
* next </div> closes the page wrapper
{%- endcomment -%}
</div>
{%- comment -%}
* editing links with icons, for either Github or local path based editing
{%- endcomment -%}
{%- if site.github.repository_url contains '/' -%}
{%- unless page.path contains 'categories/' or page.path contains 'tags/' -%}
{%- assign github_link = site.github.repository_url | append: '/blob/master/' -%}
{%- if page.path contains '/' -%}
{%- assign github_link = github_link | append: site.collections_dir | append: '/' -%}
{%- endif -%}
<a href="{{github_link}}{{page.path}}" style="text-decoration: none; color: #ccc;"><img src="{{ 'assets/img/icons8-edit-file-26.png' | relative_url }}" alt="Edit on Github..." style="position: absolute; bottom: 15px; right: 15px;" /></a>
{%- endunless -%}
{%- elsif site.source_path contains '/' -%}
<!-- Code from https://clipboardjs.com -->
<button style="position: absolute; bottom: 15px; right: 15px;" class="btn" data-clipboard-text="open {{site.source_path}}/{{ page.path }}">
<img src="{{ 'assets/img/clippy.svg' | relative_url }}" width="15px" alt="Copy local path to clipboard for pasting into terminal - only works for site editors...">
</button>
<script src="{{ 'assets/js/clipboard.min.js' | relative_url }}"></script>
<script>
var clipboard = new ClipboardJS('.btn');
clipboard.on('success', function(e) {
console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
});
</script>
<!-- / clipboardjs -->
{%- endif -%}
{%- comment -%}
* / editing
{%- endcomment -%}
<script src="{{ 'assets/js/scale.fix.js' | relative_url }}"></script>
{%- if site.google_analytics -%}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{%- endif -%}
</body>
</html>