summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-09-22 12:40:40 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-09-22 12:40:40 +0530
commitfd143fede2afd3c902f0a47102d49fbb0bbaa8c4 (patch)
tree050a9b6c415fa5d096df7fc82a555b2d24d94bb7
parent7cc579f197f2300043ffeed9a0831fbfdc57fe3c (diff)
i18n: read_time improvements
-rw-r--r--layouts/_default/list.html3
-rw-r--r--layouts/_default/single.html4
2 files changed, 5 insertions, 2 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index c0016be..0dd7286 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -51,7 +51,8 @@
<footer class="entry-footer">
<time>{{ .Date.Format "January 2, 2006" }}</time>
{{ if $.Site.Params.ShowReadingTime }} .
- {{ .ReadingTime }}{{ i18n "read_time" | default "min read" }}{{ end }}
+ {{ $default_txt := print .ReadingTime " " "min" }}
+ {{ i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
{{ if or .Params.author .Site.Params.author }} . {{ .Params.author | default .Site.Params.author }}{{ end }}
</footer>
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 27c79d0..b104c5f 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -10,7 +10,9 @@
<div class="post-meta">
<time>{{ .Date.Format "January 2, 2006" }}</time>
{{ if or .Params.author .Site.Params.author }} . {{ .Params.author | default .Site.Params.author }}{{ end }}
- {{ if $.Site.Params.ShowReadingTime }} . {{ .ReadingTime }}{{ i18n "read_time" | default "min read" }}{{ end }}
+ {{ if $.Site.Params.ShowReadingTime }} .
+ {{ $default_txt := print .ReadingTime " " "min" }}
+ {{ i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
</div>
{{end}}
</header>