feat: Add estimated reading time
This commit is contained in:
@@ -168,6 +168,10 @@ a:visited {
|
|||||||
color: $gray-medium;
|
color: $gray-medium;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ettr {
|
||||||
|
color: $gray-light;
|
||||||
|
}
|
||||||
|
|
||||||
// ARTICLE FORMATTING
|
// ARTICLE FORMATTING
|
||||||
time {
|
time {
|
||||||
margin-right: 1.5em;
|
margin-right: 1.5em;
|
||||||
|
|||||||
@@ -27,3 +27,9 @@ other = "Тема Noteworthy"
|
|||||||
|
|
||||||
[built_with_hugo]
|
[built_with_hugo]
|
||||||
other = "Направено с Hugo"
|
other = "Направено с Hugo"
|
||||||
|
|
||||||
|
[estimated_time_to_read]
|
||||||
|
other = "Време за четене"
|
||||||
|
|
||||||
|
[minutes]
|
||||||
|
other = "минути"
|
||||||
|
|||||||
@@ -27,3 +27,9 @@ other = "Noteworthy Theme"
|
|||||||
|
|
||||||
[built_with_hugo]
|
[built_with_hugo]
|
||||||
other = "Gebaut mit Hugo"
|
other = "Gebaut mit Hugo"
|
||||||
|
|
||||||
|
[estimated_time_to_read]
|
||||||
|
other = "Zeit zum lesen"
|
||||||
|
|
||||||
|
[minutes]
|
||||||
|
other = "Minuten"
|
||||||
|
|||||||
@@ -27,3 +27,9 @@ other = "Noteworthy theme"
|
|||||||
|
|
||||||
[built_with_hugo]
|
[built_with_hugo]
|
||||||
other = "Built with Hugo"
|
other = "Built with Hugo"
|
||||||
|
|
||||||
|
[estimated_time_to_read]
|
||||||
|
other = "Estimated time to read"
|
||||||
|
|
||||||
|
[minutes]
|
||||||
|
other = "minutes"
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
{{ if .Date }}
|
{{ if .Date }}
|
||||||
<time>{{ .Date.Format "January 2, 2006" }}</time>
|
<time>{{ .Date.Format "January 2, 2006" }}</time>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ $readingTime := div (float .WordCount) .Site.Params.reading_speed }}
|
||||||
|
{{ $readingTime = math.Ceil $readingTime }}
|
||||||
|
<p class="ettr">{{ i18n "estimated_time_to_read" }}: {{ $readingTime }} {{ i18n "minutes" }}</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
|
|||||||
Reference in New Issue
Block a user