Skip to content

Commit

Permalink
Add reading time
Browse files Browse the repository at this point in the history
  • Loading branch information
mirmousaviii committed Oct 29, 2023
1 parent b1a695c commit bfac138
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion themes/mostafa-hugo-theme/layouts/partials/default-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,18 @@ <h2>{{ i18n "tableOfContents" | default "tableOfContents" }}</h2>


{{ if or (.ctx.Truncated) (isset .ctx.Params "summary") }}
<a href="{{ .ctx.Permalink }}" class="more">{{ i18n "continueReading" }}</a>
<a href="{{ .ctx.Permalink }}" class="more">
{{ i18n "continueReading" }}
{{ if ( .ctx.Site.Params.showReadingTime | default false ) }}
{{ if eq .ctx.Params.readingTime 0 }}
<!--hide reading time when it's set to 0 &ndash;&gt;-->
{{ else if .ctx.Params.readingTime }}
<span class="readingTime">({{ i18n "readingTime" .ctx.Params.readingTime }})</span>
{{ else }}
<span class="readingTime">({{ i18n "readingTime" .ctx.ReadingTime }})</span>
{{ end }}
{{ end }}
</a>
{{ end }}

{{ end }}
Expand Down

0 comments on commit bfac138

Please sign in to comment.