children: remove W3C validator errors #337

if tree nesting with a depth > 1 is used, tags are in wrong order
This commit is contained in:
Sören Weber 2022-10-07 20:05:49 +02:00
parent 29ef3c657a
commit 5090541ae0
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -50,23 +50,35 @@
{{- if hasPrefix $.style "h" }}
{{- $num := sub ( int (trim $.style "h") ) 1 }}
{{- $numn := add $num $.count }}
{{ (printf "<h%d>" $numn)|safeHTML }}<a href="{{ .RelPermalink }}" >{{ .Title }}</a>{{ (printf "</h%d>" $numn)|safeHTML }}
{{- if $.description }}
{{- if .Description -}}
<p>{{ .Description }}</p>
{{- else -}}
<p>{{ .Summary }}</p>
{{- end }}
{{- end }}
{{ (printf "<h%d>" $numn)|safeHTML -}}
<a href="{{ .RelPermalink }}" >{{ .Title }}</a>
{{- (printf "</h%d>" $numn)|safeHTML }}
{{- else if eq $.style "li" }}
{{ (printf "<%s>" $.style)|safeHTML }}<a href="{{ .RelPermalink }}" >{{ .Title }}</a>
{{- if $.description }}
{{- if .Description -}}
<p>{{ .Description }}</p>
{{- else -}}
<p>{{ .Summary }}</p>
{{- end }}
{{- end }}
{{- else }}
{{ (printf "<%s>" $.style)|safeHTML -}}
<a href="{{ .RelPermalink }}" >{{ .Title }}</a>
{{- (printf "</%s>" $.style)|safeHTML }}
{{- end }}
{{- if $.description }}
{{- if .Description }}
{{ (printf "<%s>" $.style)|safeHTML }}<a href="{{ .RelPermalink }}" >{{ .Title }}</a>{{ (printf "</%s>" $.style)|safeHTML }}
{{- if $.description }}
{{- if .Description -}}
<p>{{ .Description }}</p>
{{else}}
{{- else -}}
<p>{{ .Summary }}</p>
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if lt $.count $.depth }}
@ -102,6 +114,12 @@
{{- (printf "</%s>" $.containerstyle)|safeHTML }}
{{- end }}
{{- end }}
{{- if not .IsHome }}
{{- if eq $.style "li" }}
{{- (printf "</%s>" $.style)|safeHTML -}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}