This repository has been archived by the owner on Jun 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnews.html
59 lines (56 loc) · 2.26 KB
/
news.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
---
title: News
layout: default
---
<header>
<div class="container">
<div class="page-header">
<h1>{{ page.title }}</h1>
</div>
</div>
</header>
<main>
<div class="container">
{% comment %}
FIXME: As https://shopify.github.io/liquid/tags/variable/ said,
initial value of incrementis 0, but actually it is 1,
use additional decrement to fix value to 0 for now.
{% endcomment %}
{% capture _ %}{% decrement new_release_index %}{% endcapture %}
{% capture _ %}{% decrement new_post_index %}{% endcapture %}
{% capture _ %}{% increment new_release_index %}{% endcapture %}
{% capture _ %}{% increment new_post_index %}{% endcapture %}
{% capture num %} {{ site.posts.size | plus: site.project.releases.size | minus: 1 }} {% endcapture %}
{% for i in (0..num) %}
{% capture release_time %}{{ site.project.releases[new_release_index].date | date: '%s' }}{% endcapture %}
{% capture post_time %}{{ site.posts[new_post_index].date | date: '%s' }}{% endcapture %}
<div class="panel panel-default">
{% if release_time > post_time %}
{% assign release = site.project.releases[new_release_index] %}
<div class="panel-heading">
<h3>
<a href="{{ release.url }}">Srain {{ release.version }} released</a>
<small>{{ release.date | date_to_string }}</small>
</h3>
</div>
<div class="panel-body">
<p>{{ release.notes | markdownify }}</p>
</div>
{% capture _ %}{% increment new_release_index %}{% endcapture %}
{% else %}
{% assign post = site.posts[new_post_index] %}
<div class="panel-heading">
<h3>
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
<small>{{ post.date | date_to_string }}</small>
</h3>
</div>
<div class="panel-body">
<p>{{ post.excerpt | strip_html }} </p>
</div>
{% capture _ %}{% increment new_post_index %}{% endcapture %}
{% endif %}
</div>
{% endfor %}
</div>
</main>