String / Variable Concatenation to build Path for partial

You can use printf:

https://github.com/bep/bepsays.com/blob/master/layouts/partials/menu.ace#L20

The example looks weird, but works. Search for printf in this doc:
http://golang.org/pkg/text/template/

Also, if you want you use $pathoutside of the range – in the upcoming Huog release (or build from source), there is Scratch:

https://github.com/spf13/hugo/blob/master/docs/content/extras/scratch.md

2 Likes