Skip to content
This repository has been archived by the owner on Jun 10, 2023. It is now read-only.

Show summary always, allow optionally hiding reading time on non-blog pages #279

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,12 @@ <h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ with .Description }}
{{ . | markdownify }}
{{ else }}
{{ if .Truncated }}
{{ .Summary }}
{{ .Summary | markdownify }}
{{ if and .Truncated (not .Params.hideReadMore) }}
<div><a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore | default "Read more" }} →</a></div>
{{ end }}
{{ end }}
</div>
{{ if not .Params.hideReadMore }}
<div>
<a class="read-more button" href="{{ .RelPermalink }}"
>{{ $.Site.Params.ReadMore | default "Read more" }} →</a
>
</div>
{{ end }}
</div>
{{ end }}
{{ partial "pagination.html" . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1 class="post-title">{{ .Title | markdownify }}</h1>
>{{ end }}


{{ if $.Site.Params.ShowReadingTime }}
{{ if and $.Site.Params.ShowReadingTime (not .Params.hideReadingTime) }}
<span class="post-read-time"
>— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span
>
Expand Down