LoveIt/layouts/partials/function/id.html

7 lines
297 B
HTML
Raw Normal View History

2020-02-27 13:14:40 +01:00
{{- /* ID */ -}}
{{- $count := (.scratch.Get "this").count | default 1 -}}
{{- $id := printf "id-%d" $count -}}
{{- $count | add 1 | .scratch.SetInMap "this" "count" -}}
{{- dict $id .content | dict "data" | dict "config" | merge (.scratch.Get "this") | .scratch.Set "this" -}}
2020-02-27 13:14:40 +01:00
{{- return $id -}}