By default Hugo is using Go’s template engine. In the docs you can find a guide that explains the basics of it.
Go’s html/template package is an extensions of the text/html package which provides a small set of common template functions. You don’t have to understand Go, it’s just a background info.
Hugo extends the set of common template functions to fill the toolbelt for a static site generator. Here is a list of those functions.
Exactly. It doesn’t seem to be hard
Well, the text/html package named this function len. Here’s an overview all functions provided by text/template. As I said Hugo just adds a bunch of other useful template functions that you can find here.
The | operator is similar to the Unix pipe. It basically pipes the output of the previous function as input to the next function. This allows you to chain multiple operations elegantly. However, I would refer again to the Go template primer.
Btw, @rdwatters started to rewrite the documentation. Please let us know were exactly you got stuck and what can be improved. We try to incorporate the feedback from new users.
where gives you a list of all pages (which are somewhat similar to objects in JS). Such a list can be assigned to a variable as you already know it. where also allows even some more fine grained filtering for which you can find examples in the docs.
This way you print the internal representation of the pages list.
I’m not quite sure but I guess you only have a single event. Nonetheless, since you have a list assigned to $events you can range over it like in JS with range.
Pages aren’t really objects in the way that you can’t call methods with the dot notation. Instead you pass the “object” as an argument to a function, e.g. len $events.
https://gohugo.io are the official docs. https://hugodocs.info used to be the rewritten version by @rdwatters. I linked both because the latter one is basically a revamped version. Don’t be confused. I just linked both so that you get the best of both worlds.