ensure there's a title for each piece of content (#165)

Signed-off-by: Daniel Holbach <daniel.holbach@gmail.com>
This commit is contained in:
Daniel Holbach 2023-12-23 00:03:28 +01:00 committed by GitHub
parent 97cec6269d
commit 37d24211ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,6 +70,7 @@
<!-- Render single-page content -->
{{ range $index_val, $elem_val := $content }}
{{ if .Title }}
{{ $fnav_title := .Title }}{{ with .Params.navigation_menu_title }}{{ $fnav_title = . }}{{ end }}
<div class='post-holder{{ if and (ne .Site.Params.invertSectionColors true) (not (modBool $index_val 2)) }} dark{{ else if and (eq .Site.Params.invertSectionColors true) (modBool $index_val 2) }} dark{{ end }}'>
<article id='{{ anchorize $fnav_title }}' class='post {{ if eq $index_val 0 }}first{{ end }} {{ if eq (add $index_val 1) (len $content) }}last{{ end }}'>
@ -82,6 +83,7 @@
</article>
<div class='post-after{{ if and (ne .Site.Params.invertSectionColors true) (modBool $index_val 2) }} light{{ else if and (eq .Site.Params.invertSectionColors true) (not (modBool $index_val 2)) }} light{{ end }}'></div>
</div>
{{ end }}
{{ end }}
</main>
{{ end }}