Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Commit

Permalink
fix odd spacing around last section separator
Browse files Browse the repository at this point in the history
  • Loading branch information
negrel committed Mar 27, 2023
1 parent 94d6b5c commit 2a57f5b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
{{ define "main" }}
{{ with .Site.GetPage "/home"}}

{{ $lastIndex := (sub (len (.Resources.ByType "page")) 1) }}
{{ range $index, $st := .Resources.ByType "page" }}

{{ if ne $st.Params.hidden true }}
{{ $widget := or $st.Params.widget "blank" }}
{{ $widget_path := printf "widgets/%s.html" $widget}}
{{ partial $widget_path $st }}
{{ if ne $widget "blank" }}
<hr class="my-24 border-secondary-dark dark:border-secondary-light">

{{ $lastSeparatorClass := "" }}
{{ if eq $index $lastIndex }}
{{ $lastSeparatorClass = "mb-12" }}
{{ end }}
<hr class="{{ $lastSeparatorClass }} my-24 border-secondary-dark dark:border-secondary-light">
{{ end }}
{{ end }}
{{ end }}
Expand All @@ -17,4 +24,4 @@

{{ end }}

{{ end }}
{{ end }}

0 comments on commit 2a57f5b

Please sign in to comment.