- In a file
layouts/_default/list.html
I want to link hugo articles in a loop{ range .Pages }}...{{ end }}
. - Additionally I want to output a text. In this hierarchy:
{{- with (.Summary | default .Params.summary | default .Description) -}}
<p class="card-text">{{ . }}</p>
{{- end -}}
(!!)but it should never be the automatic .Summary
(!!).
So:
If there is a .Summary
because there is a <!--more-->
in the content, output that.
If not:
the .Params.summary or the .Description.
For a test I have
- removed the front-matter
summary
and<!--more-->
in a content file. - set
summaryLength
in the configuration to0
. Unfortunately, this results in an automatic summary up to the first period in the content and not an empty one. By the way, even if I setsummaryLength
to-1
,1
or similarly small the summary is the same.
The check for .isTruncated
does not distinguish between an automatic summary and a summary because of <!--more-->
. Both are true
.
Question: Is there any way to detect whether a summary was created automatically or because of a <!--more-->
?
Related docs: Content Summaries | Hugo