1
Fork 0
blog/_layouts/post.liquid
2018-01-08 15:56:34 +01:00

34 lines
850 B
Plaintext

<!DOCTYPE html>
<html lang="en">
<head>
{% include "_head.liquid" %}
</head>
<body>
{% 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>
</main>
{% include "_footer.liquid" %}
</body>
</html>