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