-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.html
37 lines (33 loc) · 1.33 KB
/
post.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
---
layout: default
---
<div class="jumbotron">
<div class="container">
<h1>{{ page.title }} <small class="post-date">{{ page.date | date: site.data.translations[page.lang].blog.date_format }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</small></h1>
</div>
</div>
<div class="container">
<article role="article">
{{ content }}
</article>
{% assign relevant_posts = site.posts | where: 'lang', page.lang | where_exp: 'item', 'item.ref != page.ref' %}
{% assign previous = relevant_posts | where_exp: 'item', 'item.date < page.date' | sample %}
{% assign next = relevant_posts | where_exp: 'item', 'item.date > page.date' | reverse | sample %}
{% if previous or next %}
<nav class="text-center">
<ul class="pagination">
{% if previous %}
<li><a href="{{ previous.url | prepend: site.baseurl }}"><span aria-hidden="true"><i class="fa fa-chevron-left"></i></span> {{ previous.title }}</a></li>
{% endif %}
{% if next %}
<li><a href="{{ next.url | prepend: site.baseurl }}">{{ next.title }} <span aria-hidden="true"><i class="fa fa-chevron-right"></i></span></a></li>
{% endif %}
</ul>
</nav>
{% endif %}
{% if site.disqus_short_name and page.comments %}
<section class="comments">
{% include disqus_thread.html %}
</section>
{% endif %}
</div>