This config.rb
works:
helpers do
def link_to_nothing(text)
link_to(text, "#")
end
end
With template index.html.erb
:
<%= link_to_nothing "Test link" %>
But when I try to add a method to the Middleman::Sitemap::Resource
class in this config.rb
:
helpers do
class Middleman::Sitemap::Resource
def link(text)
link_to(text, path)
end
end
end
With template index.html.erb
:
<%= current_page.link "This page" %>
The following error comes up when loading the page:
NoMethodError at /index.html
undefined method `link_to' for #<Middleman::Sitemap::Resource:0x3139848>