Site Progression Week One | 220914


220914

_2214

Hugo Progression

So I have been working trying to understand the Hugo. Its something al-right. I am making progress

early screen shot of local dev

So I am chugging along with this and came across something I thought was kinda nutty. I am sure there is a good reason for it somewhere, but I don’t know it.

When you think on how to count in an slice/array or any collection when iterating over them how would one do that in hugo?

Did you think just use a for loop and grab the index value or just add a variable then add to that each iteration of the loop.

It’s not, it make another set then add an item to each time you make an iteration then get the size of that. ( I think the more I look at it the more werid it gets

{{ $.Scratch.Set "counter" 0 }}
{{range sort .Params.employees}}
{{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }}
 I am the number {{$.Scratch.Get "counter"}} in loop!
{{end}}

here is the link to the forum post link where I found out how to do this.


working with hugo is not really all that fun. I feel like knowing how to do things in other ’languages’ is just slowing me down, but getting something to work is nice cause it feel like I just discovered how to do something with some forbidding magic or something.

location of the disable cache