Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ pagination.pagerSize = 5
title = "Terminal"

[languages.en.params]
# readingSpeed = 212 # in words per minute, default is 212
subtitle = "A simple, retro theme for Hugo"
owner = ""
keywords = ""
Expand All @@ -243,8 +244,11 @@ pagination.pagerSize = 5
olderPosts = "Older posts"
missingContentMessage = "Page not found..."
missingBackButtonLabel = "Back to home page"
minuteReadingTime = "min read"
words = "words"
word = "word"
minute = "minute"
minutes = "minutes"
to_read = "to read"

[languages.en.params.logo]
logoText = "Terminal"
Expand Down
5 changes: 3 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ <h1 class="post-title">
{{- with .Params.Author -}}
<span class="post-author">{{ . }}</span>
{{- end -}}
{{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}}
<span class="post-reading-time">{{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }} ({{ .WordCount }} {{ $.Site.Params.words | default "words" }})</span>
{{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}}{{ $customReadingTime := div (float .WordCount) (.Site.Params.readingSpeed | default 212) }}{{ $customReadingTime = math.Ceil $customReadingTime }}<!--
(browsers insert spaces (here) sometimes)
--><span class="post-reading-time">{{ $customReadingTime }} {{ if eq $customReadingTime 1.0 }}{{ $.Site.Params.minute | default "minute" }}{{ else }}{{ $.Site.Params.minutes | default "minutes" }}{{ end }} {{ $.Site.Params.to_read | default "to read" }} ({{ .WordCount }} {{ if eq .WordCount 1 }}{{ $.Site.Params.word | default "word" }}{{ else }}{{ $.Site.Params.words | default "words" }}{{ end }})</span>
{{- end -}}
</div>

Expand Down