-
Notifications
You must be signed in to change notification settings - Fork 8
/
post.liquid
32 lines (30 loc) · 1.05 KB
/
post.liquid
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
<!DOCTYPE html>
<html>
<head>
{% include "_head.liquid" %}
</head>
<body data-route={{ page.data.route }}>
{% include "_menu.liquid" %}
<main>
<article>
<h1>{{ page.title }}</h1>
{% assign reading_wpm = 200 %}
{% assign word_count = page.content | split: " " | size %}
{% assign reading_time = word_count | divided_by: 200 %}
{% case reading_time %}
{% when 0 %}
{% assign phrase = "less than a minute." %}
{% when 1 %}
{% assign phrase = "about a minute." %}
{% else %}
{% assign phrase = " minutes." | prepend: reading_time %}
{% endcase %}
<time pubdate="pubdate">{{ page.published_date | date: "%b %d, %Y" }} - Reading time: {{ phrase }}</time><br />
{{ page.content }}
</article>
<br /><br />
<a href="https://twitter.com/share" class="twitter-share-button" data-show-count="false">Tweet</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</main>
{% include "_footer.liquid" %}
</body>
</html>