Skip to content

Commit

Permalink
allow setting ShowReadingTime per-page
Browse files Browse the repository at this point in the history
as well as site-wide
  • Loading branch information
adityatelange committed Jan 24, 2021
1 parent bc4d415 commit f7dbf75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 class="post-title">
<div class="post-meta">
{{- partial "post_meta.html" . -}}
{{- if .IsTranslated -}}
{{- if or .Params.author $.Site.Params.author $.Site.Params.ShowReadingTime (not .Date.IsZero) }}&nbsp;|&nbsp;{{- end -}}
{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }}&nbsp;|&nbsp;{{- end -}}
<ul class="i18n_list">
{{- i18n "translations" | default "Translations"}}:
{{- range .Translations }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/post_meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{- $scratch.Add "meta" (slice (.Date.Format (default "January 2, 2006" .Site.Params.DateFormat))) }}
{{- end -}}

{{- if $.Site.Params.ShowReadingTime -}}
{{- if (.Param "ShowReadingTime") -}}
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%s min" .ReadingTime))) }}
{{- end -}}

Expand Down

0 comments on commit f7dbf75

Please sign in to comment.