-
Notifications
You must be signed in to change notification settings - Fork 13
/
tag.html
52 lines (42 loc) · 1.5 KB
/
tag.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
---
layout: page
title: Tags
subtitle: Browse site by tag
use-site-title: true
---
{% if site.google_adsense %}
{% include ad.html %}
{% endif %}
<div class="home">
<p class="post-meta" style="text-align: justify;">
{% assign tags = site.devices | map: 'tags' | join: ',' | split: ',' | sort %}
{% assign tags_count = site.devices | map: 'tags' | join: ',' | split: ',' | sort | uniq | size %}
{% assign previousTag = "" %}
{% assign counter = 0 %}
{% for currentTag in tags %}
{% if previousTag == "" %}
{% assign previousTag = currentTag %}
{% endif %}
{% if currentTag == previousTag %}
{% assign counter = counter | plus: 1 %}
{% else %}
{% assign rel_tag_size = counter | times: 2.5 | divided_by: tags_count | plus: 0.7 %}
<span style="white-space: nowrap; font-size: {{ rel_tag_size }}em; padding: 0.4em;">
<a href="{{ site.baseurl }}/tag/{{ previousTag }}" class="tag">{{ previousTag }} ({{ counter }})</a>
</span>
{% assign counter = 1 %}
{% endif %}
{% if forloop.last %}
{% assign rel_tag_size = counter | times: 2.5 | divided_by: tags_count | plus: 0.7 %}
<span style="white-space: nowrap; font-size: {{ rel_tag_size }}em; padding: 0.4em;">
<a href="{{ site.baseurl }}/tag/{{ currentTag }}" class="tag">{{ currentTag }} ({{ counter }})</a>
</span>
{% endif %}
{% assign previousTag = currentTag %}
{% endfor %}
</p>
</div>
<hr>
{% if site.google_adsense %}
{% include ad.html %}
{% endif %}