Add an option to not display descriptions
.Description is meant to be used for metadata purpose: https://gohugo.io/methods/page/description/ Hugo document has emphasized this in the .Description page: > Conceptually different from a content summary, a page description is typically used in metadata about the page. Hugo embedded templates are consistent in this regard. To maintain backward compatibility, add an option showDescription to disable displaying descriptions.
This commit is contained in:
parent
3f50861a0c
commit
24b5542ab7
|
@ -20,7 +20,7 @@
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
</h1>
|
||||
{{- if .Description }}
|
||||
{{- if and (.Param "ShowDescription") .Description }}
|
||||
<div class="post-description">
|
||||
{{ .Description }}
|
||||
</div>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
</h1>
|
||||
{{- if .Description }}
|
||||
{{- if and (.Param "ShowDescription") .Description }}
|
||||
<div class="post-description">
|
||||
{{ .Description | markdownify }}
|
||||
</div>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
||||
</svg>
|
||||
</h1>
|
||||
{{- if .Description }}
|
||||
{{- if and (.Param "ShowDescription") .Description }}
|
||||
<div class="post-description">
|
||||
{{ .Description }}
|
||||
</div>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
</span>
|
||||
{{- end }}
|
||||
</h1>
|
||||
{{- if .Description }}
|
||||
{{- if and (.Param "ShowDescription") .Description }}
|
||||
<div class="post-description">
|
||||
{{ .Description }}
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{- if .Title }}
|
||||
<header class="page-header">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{- if .Description }}
|
||||
{{- if and (.Param "ShowDescription") .Description }}
|
||||
<div class="post-description">
|
||||
{{ .Description }}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue