Skip to content

Commit

Permalink
fix(collapse): use Scratch instead of now.UnixNano to generate ID (
Browse files Browse the repository at this point in the history
  • Loading branch information
TetraTheta committed Jun 30, 2024
1 parent 2efdcdb commit fdfc144
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion layouts/partials/bootstrap/collapse.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{{- $id := printf "collapse-%d" now.UnixNano -}}
{{- if not (.Page.Scratch.Get "collapseCounter") -}}
{{- .Page.Scratch.Set "collapseCounter" 0 -}}
{{- end -}}
{{- .Page.Scratch.Add "collapseCounter" 1 -}}
{{- $id := printf "collapse-%d" (.Page.Scratch.Get "collapseCounter") -}}
{{- $heading := "" -}}
{{- $style := "primary" -}}
{{- $expand := false -}}
Expand Down

0 comments on commit fdfc144

Please sign in to comment.