How to add a ".Section" class to the menù line?

I’m a bit confused on how to use variables: I never get to use them as I’m expecting.
Here’s the first sample: I would like to add a class named like the section to the menù links.
My menù is the standard “partial”

<nav class="sidebar-nav">navbar
            {{ $currentNode := . }}
            {{ range .Site.Menus.main }}
                <a class=" sidebar-nav-item{{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }} active{{end}} " href="{{.URL}}">
                    {{ .Section }} - {{ .Name }}
            {{ end }}

and I’m trying to add the class with the same name of the section. For testing purpose I’m also trying to get the output on vidoe (close to the {{ .Name }}) but nothing works
{{ .Section }}
{{ .Params.Section }}
{{ .File. Section }} and so on… but hugo complains there’s no variable, or not function…
I really need a tutorial on how to use these - the manual is not enough for me.
Next a post on my second trouble, on accessing variables, too.
Please help, thank you.

Once you enter a range loop in Go templates, the context changes to the current item in the loop. So, you’re trying to access .Site.Menus.main.Section of each menu entry, but menus don’t have a Section. See

So wich should be a best practise to have a list of all documents published, classified by section? I would like toreproduce the directory tree, using a diffrent fon awesome for each section, somehow automatic.
Thank you