add support to disable summary #85

This commit is contained in:
Dmitry Kolosov 2021-04-13 20:20:58 +03:00
parent b9c021cab7
commit dc52fdf1b0
2 changed files with 6 additions and 3 deletions

View File

@ -76,6 +76,7 @@ params:
paginationSinglePost: true paginationSinglePost: true
style: light-without-switcher style: light-without-switcher
readMore: false readMore: false
disableSummary: false
# utteranc.es support # utteranc.es support
utterancesRepo: "" # mandatory utterancesRepo: "" # mandatory
utterancesTheme: "" # optional utterancesTheme: "" # optional

View File

@ -3,9 +3,11 @@
<h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h1> <h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h1>
</header> </header>
<div class="content post-summary p-summary"> {{ if not .Site.Params.disableSummary }}
{{ .Summary | safeHTML }} <div class="content post-summary p-summary">
</div> {{ .Summary | safeHTML }}
</div>
{{ end }}
{{ if and (.Truncated) (.Site.Params.readMore) }} {{ if and (.Truncated) (.Site.Params.readMore) }}
<div class="read-more"> <div class="read-more">
<a class="u-url" href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a> <a class="u-url" href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>