-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathnavbar.html
More file actions
40 lines (40 loc) · 1.51 KB
/
navbar.html
File metadata and controls
40 lines (40 loc) · 1.51 KB
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
{% capture site_tags %}{% for tag in site.tags %}{{ tag[1].size }}#{{ tag | first | downcase }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign tag_hashes = site_tags | split:',' | sort | reverse %}
{% assign sorted_tags = '' | split: '' %}
{% for hash in tag_hashes %}
{% assign keyValue = hash | split: '#' %}
{% capture tag_word %}{{ keyValue[1] | strip_newlines }}{% endcapture %}
{% assign sorted_tags = sorted_tags | push: tag_word %}
{% endfor %}
{% assign uniqueTags = sorted_tags | uniq %}
<div class="navigation-bar">
<div class="desktop-navbar">
<div class="navbar-links">
<div class="navigation-tags">
{% for tag in uniqueTags | limit: 5 %}
{% if site.active_lang == "en" %}
<a href="/">
{% else %}
<a href="/search.html?query={{ tag }}">
{% endif %}
{{ tag }}
</a>
{% endfor %}
</div>
{% include search-component-desktop.html %}
</div>
</div>
<div class="col-15 mobile-navbar">
<div class="navigation-tags">
{% for tag in uniqueTags | limit: 5 %}
{% if site.active_lang == "en" %}
<a href="/">
{% else %}
<a href="/search.html?query={{ tag }}">
{% endif %}
{{ tag }}
</a>
{% endfor %}
</div>
</div>
</div>