forked from aron-bordin/neo-hpstr-jekyll-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.html
100 lines (95 loc) · 4.38 KB
/
header.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
{% capture site_cats %}{% for cat in site.categories %}{{ cat | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign cats_list = site_cats | split:',' | sort %}
<div class="header-menu header-menu-top">
<ul class="header-item-container">
<li class="header-item-title header-toggle "><a href="#menu"><h2><i class="fa fa-bars"></i></h2></a></li>
<li class="header-item-title">
<a href="{{site.url}}/">
{% if site.logo %}
<img class="logo" src="{{site.url}}/{{ site.logo }}" alt="{{ site.title }}">
{% endif %}
<a href="{{site.url}}/" class="title"> {{ site.title }}</a>
</a>
</li>
{% for menu in site.menu reversed %}
{% assign class = nil %}
{% if ((page.url contains menu.url and menu.url != '/') or (page.url == '/index.html' and menu.url == '/')) %}
{% assign class = 'active' %}
{% endif %}
{% if menu.type == 'categories' %}
<li class="header-item {{class}}"><a href="{{site.url}}{{menu.url}}"><h3>{{ menu.title }}</h3></a>
<ul class="header-submenu">
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
{% capture this_word %}{{ cats_list[item] | strip_newlines }}{% endcapture %}
<li class="sub-item"><a href="{{site.url}}/categories/#{{this_word}}">{{this_word}}</a></li>
{% endunless %}{% endfor %}
</ul>
</li>
{% elsif menu.submenu %}
<li class="header-item {{class}}"><a href="{{site.url}}{{menu.url}}"><h3>{{ menu.title }}</h3></a>
<ul class="header-submenu">
{% for sub in menu.submenu %}
<li class="sub-item"><a href="{{site.url}}{{sub.url}}">{{sub.title}}</a></li>
{% endfor %}
</ul>
</li>
{% else %}
{% if menu.url contains 'http://' or menu.url contains 'https://' %}
<li class="header-item {{class}}"><a href="{{menu.url}}" target="_blank"><h3>{{ menu.title }}</h3></a></li>
{% else %}
<li class="header-item {{class}}"><a href="{{site.url}}{{menu.url}}"><h3>{{ menu.title }}</h3></a></li>
{% endif %}
{% endif %}
{% endfor %}
<li class="header-item"><a href="{{site.url}}/search"><h3><i class="fa fa-search"></i></h3></a></li>
</ul>
</div>
<div class="entry-header">
<div class="header-title">
<div class="header-title-wrap">
<h1>{{ page.title }}</h1>
{% if page.date %}
<h2><span class="entry-date date published updated"><time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %d, %Y" }}</time></span></h2>
{% else %}
<h2><span class="entry-date"><time> </time></span></h2>
{% endif %}
{% if site.reading_time and page.layout == 'post' %}
<p class="entry-reading-time">
<i class="fa fa-clock-o"></i>
{% assign readtime = content | strip_html | number_of_words | divided_by:site.words_per_minute %}
Temps de lecture ~{% if readtime <= 1 %}1 minute{% else %}{{ readtime }} minutes{% endif %}
</p><!-- /.entry-reading-time -->
{% else %}
<p class="entry-reading-time">
</p><!-- /.entry-reading-time -->
{% endif %}
</div><!-- /.header-title-wrap -->
</div><!-- /.header-title -->
</div><!-- /.entry-header -->
<nav id="menu" style="display: none">
<ul>
{% for menu in site.menu %}
{% if menu.type == 'categories' %}
<li><a href="{{site.url}}{{menu.url}}"><h3>{{ menu.title }}</h3></a>
<ul>
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
{% capture this_word %}{{ cats_list[item] | strip_newlines }}{% endcapture %}
<li><a href="{{site.url}}/categories/#{{this_word}}">{{this_word}}</a></li>
{% endunless %}{% endfor %}
</ul>
</li>
{% elsif menu.submenu %}
<li><a href="{{site.url}}{{menu.url}}"><h3>{{ menu.title }}</h3></a>
<ul>
{% for sub in menu.submenu %}
<li><a href="{{site.url}}{{sub.url}}">{{sub.title}}</a></li>
{% endfor %}
</ul>
</li>
{% else %}
<li><a href="{{site.url}}{{menu.url}}"><h3>{{ menu.title }}</h3></a></li>
{% endif %}
{% endfor %}
</ul>
</nav>