Skip to content

Commit

Permalink
ensure there's a title for each piece of content (#165)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Holbach <[email protected]>
  • Loading branch information
dholbach authored Dec 22, 2023
1 parent 97cec62 commit 37d2421
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'>
Expand All @@ -82,6 +83,7 @@ <h2 class="post-title">{{ .Title | safeHTML }}</h2>
</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 }}

0 comments on commit 37d2421

Please sign in to comment.