-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.html
64 lines (62 loc) · 2.14 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
64
---
layout: default
---
<article class="post">
<header class="post-header{% if page.header_image_url %} with-image{% endif %}">
{% if page.header_image_url %}
<img src="{{ site.baseurl }}{{ page.header_image_url }}" alt="{{ page.title }}">
{% endif %}
<div class="post-header-inner{% if page.external_url %} post-external-link{% endif %}">
{% if page.external_url %}
<h1 class="post-title">
<a href="{{ page.external_url }}" target="_blank">{{ page.title }} »</a>
</h1>
{% else %}
<h1 class="post-title">{{ page.title }}</h1>
{% endif %}
<time datetime="{{ page.date | date_to_xmlschema }}" class="post-date">{{ page.date | date_to_string }}</time>
{% capture words %}
{{ content | number_of_words | minus: 180 }}
{% endcapture %}
{% unless words contains "-" %}
<span class="post-reading-time">{{ words | plus: 180 | divided_by: 180 | append: " minutes to read" }}</span>
{% endunless %}
</div>
</header>
{% if page.subtitle %}
<div class="post-subtitle">
<span>{{ page.subtitle }}</span>
</div>
{% elsif page.abstract %}
<div class="post-subtitle">
<span>{{ page.abstract }}</span>
</div>
{% elsif page.lead %}
<div class="post-subtitle">
<span>{{ page.lead }}</span>
</div>
{% endif %}
{{ content }}
</article>
{% if site.related_posts != empty %}
<aside class="widget related">
<h3 class="widget-title">Recent posts</h3>
<ul class="related-posts">
{% for post in site.related_posts limit:3 %}
<li>
<a href="{% if post.external_url %}{{ post.external_url }}{% else %}{{ site.baseurl }}{{ post.url }}{% endif %}"{% if post.external_url %} target="_blank"{% endif %}>
<span{% if post.external_url %} class="is-external"{% endif %}>
{{ post.title }}
{% if post.redirect_to or post.external_url %}
»
{% endif %}
</span>
<small>
<time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date_to_string }}</time>
</small>
</a>
</li>
{% endfor %}
</ul>
</aside>
{% endif %}