문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top