class Sigmund::Liquid::Tags::ActiveLink

Public Instance Methods

render(context) click to toggle source
# File lib/sigmund/liquid/tags/active_link.rb, line 7
def render(context)
  @page = context.registers[:page] 
  render_path(context) do |page, path|
    if path == '/'
      return  @page.handle == 'index' ? 'active' : ''
    else 
      @page.fullpath =~ /^#{page.fullpath}(\/.*)?$/ ? 'active' : ''
    end
  end
end