This repository has been archived on 2024-11-25. You can view files and clone it, but cannot push or open issues or pull requests.
2023-10-12 14:01:05 +02:00

15 lines
481 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 -}}
{{- with .Content -}}
{{- dict $id . | dict "data" | dict "config" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
{{- end -}}
{{- return $id -}}