1
Fork 0
blog/_layouts/post.liquid

34 lines
847 B
Plaintext
Raw Normal View History

2017-07-09 12:18:22 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
{{ include "_layouts/_head.liquid" }}
</head>
<body>
{{ include "_layouts/_menu.liquid" }}
<main>
<article>
<h1>{{ title }}</h1>
{% assign reading_wpm = 200 %}
{% assign word_count = 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">{{ date | date: "%b %d, %Y" }} - Reading time: {{ phrase }}</time><br />
{{ content }}
</article>
</main>
{{ include "_layouts/_footer.liquid" }}
</body>
</html>