is returning returning me what seems to be a slice with only one string, containing all links, with .Text and $destination.
Separated by space, or not, depends. It’s a mess.
I expected a map or slice of strings, which I could use delimit on.
I read the docu and don’t understand.
The result of {{ delimit (.Page.Scratch.Get "all_sources") " "}} is
error calling delimit: can’t iterate over <nil> failed to render pages: can’t iterate over <nil>
Ah… Ok
Still, more documentation and examples of use cases wouldn’t hurt.
One more question : why does the result of this:
{{with (.Page.Scratch.Get "all_sources")}}
{{ delimit . "<p>"}}
{{ end }}
(with the command hugo server) changes when it reloads, when I save the text editor on such or such file ? It appears as it should with when saving render-link.html but is empty/outputs nothing when saving on content-after.html.
But that difference doesn’t happen with .Store instead of .Scratch.
Is this a feature or a bug ?
And I don’t understand what .Get is returning. I would expect a slice of slices,
but it’s not the case because {{range . }}<p>{{ delimit . " "}}{{end}} is returning me gibberish numbers like 104 116 116 112 115 58 47 47 119 119 119 46 103 105 103 97 108 114 101 115 101 97 114 99 104 46 99 111 109 47 117 107 47 112 117 98 108
None of the entries were numbers or close, it shouldn’t happen…
Damn weakly-typed languages.
so {{ .Page.Store.Add "all_sources" (slice $.Text $destination) }} followed by {{{ .Page.Get "all_sources"}} should return a slice of slices, right ? .Text being a string and $destination too.
I meant .Get, sorry.
Yes I read that sentence but didn’t understand. Now I do.
How can I get the object to be a slice of slices instead ?
Like [[aaa bbbb] [cccc ddd]]
also I noticed that I didn’t initiliaze the object, yet it doesn’t seem to matter. Or perhaps it caused the erratic behavior I described?