mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-11-26 18:13:59 -05:00
Added read time to posts that'll take longer than a minute to read
This commit is contained in:
parent
3a7aeed035
commit
b2b05cc29e
2 changed files with 9 additions and 1 deletions
|
@ -236,4 +236,4 @@ nav li {
|
|||
|
||||
#webmentions img { max-height: 1.2em; margin-right: -1ex; }
|
||||
|
||||
.date-updated { margin-top: -8px; }
|
||||
.date-updated { margin-top: -18px; }
|
||||
|
|
|
@ -15,6 +15,14 @@
|
|||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $readTime := mul (div (countwords .Content) 220.0) 60 }}
|
||||
{{ if gt $readTime 60 }}
|
||||
<p>
|
||||
Reading Time:
|
||||
{{ math.Floor (div $readTime 60) }} minutes
|
||||
and {{ mod $readTime 60 }} seconds.
|
||||
</p>
|
||||
{{ end }}
|
||||
<!-- tags -->
|
||||
<div id="tags">
|
||||
<ul>
|
||||
|
|
Loading…
Reference in a new issue