Method: Webgen::PathHandler::Base::Node#link_to

Defined in:
lib/webgen/path_handler/base.rb

Does exactly the same as Webgen::Node#link_to but replaces the HTML a-tag with a span-tag depending on the configuration option ‘website.link_to_current_page’.



54
55
56
57
58
59
60
61
# File 'lib/webgen/path_handler/base.rb', line 54

def link_to(*args, &block)
  result = super
  if !tree.website.config['website.link_to_current_page'] && args.first == self
    result.sub!(/<a/, '<span').sub!(/<\/a>/, '</span>').
      gsub!(/ (?:href|hreflang)=".*"/, '')
  end
  result
end