-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
57 lines (53 loc) · 2.33 KB
/
index.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
---
layout: default
title: AutomatingGuy Blog
---
<div class="posts">
{% for post in paginator.posts %}
{% if post.tags.size > 0 %}
{% capture tags_content %} <span class="fas fa-tag{% if post.tags.size > 1 %}s{% endif %}"></span> {% endcapture %}
{% for post_tag in post.tags %}
{% assign tag = site.blog_tags | where: "slug", post_tag %}
{% if tag %}
{% assign tag = tag[0] %}
{% capture tags_content_temp %}{{ tags_content }}<a href="{{ tag.url }}">{{ tag.name }}</a>{% if forloop.last == false %}, {% endif %}{% endcapture %}
{% assign tags_content = tags_content_temp %}
{% endif %}
{% endfor %}
{% endif %}
{% assign comments_meta = nil %}
{% if site.data.comments[post.slug] %}
{% assign comments_number = site.data.comments[post.slug].size %}
{% capture comments_meta %} <span class="fas fa-comment{% if comments_number > 1 %}s{% endif %}"></span> {% endcapture %}
{% capture comments_meta %} <span class="post-comments">{{ comments_meta }}<a href="{{ post.url | relative_url }}#comments">{{ comments_number }} Comment{% if comments_number > 1 %}s{% endif %}</a></span>{% endcapture %}
{% endif %}
<div class="post">
<h1 class="post-title"><a href="{{ post.url }}"> {{ post.title }} </a></h1>
<div class="post-meta">
<span class="post-date"></span>{{ post.date | date_to_string }}</span>
{% capture content_length %} {{post.content}} {% endcapture %}
{% include reading-time.html content=content_length %}
{{ comments_meta }}
<span class="post-tags">{{ tags_content }}</span>
</div>
{{ post.excerpt }}
<a class="read-more" href="{{ post.url }}">Read more »</a>
</div>
{% endfor %}
</div>
<div class="pagination">
{% if paginator.next_page %}
<a class="pagination-item older" href="{{ site.baseurl }}/page{{paginator.next_page}}">Older</a>
{% else %}
<span class="pagination-item older">Older</span>
{% endif %}
{% if paginator.previous_page %}
{% if paginator.page == 2 %}
<a class="pagination-item newer" href="/">Newer</a>
{% else %}
<a class="pagination-item newer" href="{{ site.baseurl }}/page{{paginator.previous_page}}">Newer</a>
{% endif %}
{% else %}
<span class="pagination-item newer">Newer</span>
{% endif %}
</div>