Question

I'm building a site with nanoc and cannot find out how to use a global variable that could be incremented on the compilation of each page. The idea behind this is to get the list of all tags (incrementing the appearance number each time a tag is seen).

I though that declaring the variable in lib/helper.rb would do the trick, but it's not working that way.

Any idea?

Was it helpful?

Solution

Ok, in fact, I just had to declare $my_var in lib/helpers.rb. This var is then accessible in all pages during compilation. Luc

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top