1
Fork 0
blog/_layouts/post.liquid
2019-04-23 23:23:47 +02:00

39 lines
999 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>
{% if page.data and page.data.tags -%}
{%- assign tags = page.data.tags | join: ", " -%}
Tags: {{tags}}
{%- endif -%}
<br />
{{ page.content }}
</article>
</main>
{% include "_footer.liquid" %}
</body>
</html>