mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
12 lines
342 B
HTML
12 lines
342 B
HTML
{{- /* ID */ -}}
|
|
{{- $id := "" -}}
|
|
{{- with .Id -}}
|
|
{{- /* If an ID is specified, then just use it.*/ -}}
|
|
{{- $id = printf "%v" . -}}
|
|
{{- else -}}
|
|
{{- $count := ($.Scratch.Get "this").count | default 1 -}}
|
|
{{- $id = printf "id-%d" $count -}}
|
|
{{- $count | add 1 | $.Scratch.SetInMap "this" "count" -}}
|
|
{{- end -}}
|
|
{{- return $id -}}
|