include: don't generate additional HTML if file should be displayed without parameter #110

This commit is contained in:
Sören Weber 2021-10-06 19:51:34 +02:00
parent 82a3ee5a90
commit 0058c51b32
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589

View file

@ -1,6 +1,5 @@
{{- $file := .Get 0 }}
{{- $showFirstHeading := .Get 1 | default true }}
<div class="include{{ if not $showFirstHeading }} hide-first-heading{{ end }}">
{{ $file | readFile | safeHTML }}
</div>
{{- if not $showFirstHeading }}<div class="include hide-first-heading">{{ end }}
{{ $file | readFile | safeHTML -}}
{{- if not $showFirstHeading }}</div>{{ end }}