Remove Scratch from list

heh, yeah you’re totally right. Turns out what I actually wanted to do was this:

{{- $.Scratch.Add "index" slice -}}
{{- range .Data.Pages -}}
  {{- $.Scratch.Add "index" (dict "action" "addObject" "body" ( dict "objectID" ( printf "issue_%s" .Slug ) "issue" ( int .Slug ) "uri" .Permalink "title" .Title "blurb" ( .Params.description | plainify ) "tags" .Params.tags) ) -}}
{{- end -}}
{{- $list := $.Scratch.Get "index" -}}
{{- (dict "requests" $list ) | jsonify -}}

Which wasn’t even anything like the example I gave. Thanks for trying to help me and sorry for wasting your time!

1 Like