mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
Add logic to use .Description instead of .Summary
Adds a check for a useDescription param which will check for a description field in a post and use it instead of the .Summary when producing list.html. If a description is unavailable and hideSummary is not true, the summary will show as normal.
This commit is contained in:
parent
efe4cb4516
commit
83e9267996
@ -72,7 +72,11 @@
|
||||
{{- if .Draft }}<sup><span class="entry-isdraft"> [draft]</span></sup>{{- end }}
|
||||
</h2>
|
||||
</header>
|
||||
{{- if (ne (.Param "hideSummary") true) }}
|
||||
{{- if and (.Description) (.Param "useDescription") }}
|
||||
<div class="entry-content">
|
||||
<p>{{ .Description | plainify | htmlUnescape }}</p>
|
||||
</div>
|
||||
{{- else if (ne (.Param "hideSummary") true) }}
|
||||
<div class="entry-content">
|
||||
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user