cullmann.io/themes/LoveIt/layouts/partials/function/id.html

9 lines
330 B
HTML
Raw Normal View History

2021-02-18 21:44:01 +01:00
{{- /* ID */ -}}
{{- $count := (.Scratch.Get "this").count | default 1 -}}
{{- $id := printf "id-%d" $count -}}
{{- $count | add 1 | .Scratch.SetInMap "this" "count" -}}
{{- with .Content -}}
{{- dict $id . | dict "data" | dict "config" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
{{- end -}}
{{- return $id -}}