I have a custom collection defined as:
country: {
link: '/country/{country}/index.html',
template: 'layouts_blog/country.html'
}
Within a Middleman layout, the value of {country} is accessible as the variable ‘country’. However, I can’t find any way to get access to that variable from a method defined in a helper class, i.e. if I add:
module MyHelper
def some_method()
return country
end
end
calling ‘some_method()’ from a layout just returns nil.
Which Middleman globals are accessible to helpers? It looks as if current_page and current_article are accessible, but I haven’t been able to find any way to get access to that ‘country’ variable (or other, similar variables) within a helper, short of passing it in explicitly.