Selaa lähdekoodia

Add if statement around content printing

Some list pages, such as tags and categories, don't have content. Added
an if statement around the content panel to avoid displaying an empty
panel.
Apis Necros 2 vuotta sitten
vanhempi
säilyke
c6b1193c78
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      layouts/_default/list.html

+ 2 - 0
layouts/_default/list.html

@@ -1,7 +1,9 @@
 {{ define "main" }}
+	{{- if gt (len .Content) 0 }}
 	<div class="panel space-y-2">
 		{{ .Content }}
 	</div>
+	{{- end }}
 	{{ range .Pages.ByPublishDate.Reverse }}
 	{{- $images := default (slice "/imgs/no-image-new.webp" "/imgs/no-image-new.png") .Params.Images }}
 	{{- $altText := default "No alt text" .Params.ImageAltText }}