-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpost.html
63 lines (54 loc) · 2.04 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
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
---
layout: blog
---
<article>
<div class="mb-3">
<small class="text-muted">Posted on <span>{{- page.date | date: site.date_format -}}</span></small>
</div>
{{ content }}
<div class="mt-3 mb-3 text-muted fst-italic">
<small>
{% capture pagePath %}{{ page.date | date: "%Y-%m-%d-" }}{{ page.title | slugify }}.md{% endcapture %}
Found an issue with this page? <a href="{{ site.jekyll_source_url }}/edit/main/_posts/{{ pagePath }}">suggest edit</a>
</small>
</div>
<div class="d-flex">
{% if page.previous.url %}
<div class="p-2 flex-fill"><a class="prev" href="{{page.previous.url}}">« Previous Post</a></div>
{% endif %}
{% if page.next.url %}
<div class="p-2 flex-fill text-end"><a class="next" href="{{page.next.url}}">Next Post »</a></div>
{% endif %}
</div>
<h2 class="mb-3">Comments</h2>
{% include comment-new.html %}
{% capture default_slug %}{{ page.slug | default: page.title | slugify }}{% endcapture %}
{% capture slug %}{{ page.slug }}{% endcapture %}
{% assign comments_map = site.data.comments[slug] %}
{% assign cmts = site.emptyArray %}
{% for comment in comments_map %}
{% assign cmts = cmts | push: comment[1] %}
{% endfor %}
{% assign comment_count = cmts | size %}
{% assign comments = cmts | sort: 'date' %}
{% if comment_count > 0 %}
<h5 class="mt-5">{{ comments.size }} responses</h5>
<hr class="mb-4" />
{% for comment in comments %}
<a id="{{ comment.id }}"></a>
<div class="row mb-3">
<div class="col-2">
<img src="{{ comment.avatar }}" style="max-width: 100%;" />
</div>
<div class="col-10">
<div class="row">
<div class="col-6"><strong>{{ comment.author }}</strong></div>
<div class="col-6 text-end"><small><a href="#{{ comment.id }}">{{- comment.date | date: site.date_format -}}</a></small></div>
</div>
<div class="comment-message">{{ comment.message }}</div>
</div>
<div class="col-12"><hr class="comment-divider" /></div>
</div>
{% endfor %}
{% endif %}
</article>