i18n: read_time improvements

This commit is contained in:
Aditya Telange 2020-09-22 12:40:40 +05:30
parent 7cc579f197
commit fd143fede2
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
2 changed files with 5 additions and 2 deletions

View File

@ -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>

View File

@ -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>