forked from scala/scala-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog-list.html
75 lines (71 loc) · 2.46 KB
/
blog-list.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
{% comment %}Use the include variable 'category' to select the category to show (included in blog-categories.yml), or assign it to "all" if you want to show all posts.{% endcomment %}
<section class="content">
<div class="wrap">
<div class="content-primary-blog">
<div class="inner-box">
<ul class="nav-tab">
<li class="item-tab"><a {% if page.category == "all" %}class="active"{% endif %} href="/blog/">All</a></li>
{% for category in site.data.blog-categories %}
<li class="item-tab">
<a {% if category.categoryId == include.category %}class="active"{% endif %} href="{{category.url}}">{{category.title}}</a>
</li>
{% endfor %}
</ul>
<div class="blog-list">
{% for post in paginator.posts %}
<div class="blog-item">
<h2><a href="{{post.url}}">{{post.title}}</a></h2>
<p class="blog-date">{{post.date | date: "%A %-d %B %Y"}}</p>
{% if post.by %}<p class="blog-author">{{post.by}}</p>{% endif %}
{% if post.tags %}
<ul class="tag-list">
{% for tag in post.tags %}
<li class="tag-item">{{tag}}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
</div>
</div>
{% for category in site.data.blog-categories %}
{% if category.categoryId == include.category %}
{% assign currentCategoryPath = category.url %}
{% endif %}
{% endfor %}
{% capture urlPath %}{% if include.category == "all" %}blog{% else %}{{currentCategoryPath}}{% endif %}{% endcapture %}
{% assign urlPath = urlPath | split: '/' | join: '/' | remove_first: '/' %}
{% include paginator.html urlPath=urlPath %}
</div>
{% assign highlights = "" | split: "," %}
{% for post in site.posts %}
{% if post.isHighlight == true %}
{% assign highlights = highlights | push: post %}
{% endif %}
{% endfor %}
{% for post in highlights %}
{% if forloop.first %}
<div class="content-nav-blog">
<div class="inner-box">
<h5>Highlights</h5>
<div class="blog-list-nav">
{% endif %}
<div class="blog-list-nav-item">
<h4><a href="{{post.url}}">{{post.title}}</a></h4>
{% if post.by %}<p>{{post.by}}</p>{% endif %}
{% if post.tags %}
{% for tag in post.tags %}
<ul class="tag-list">
<li class="tag-item">{{tag}}</li>
</ul>
{% endfor %}
{% endif %}
</div>
{% if forloop.last %}
</div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</section>