Skip to content

Support relative links with search_index_path #5

@rtack

Description

@rtack

Using search_index_path I always got the absolute path back but for hosting on github a relative path is needed.

I wrote my own helper which uses link_to to get the relative path.

def link_to_search_index
  absolute_link_to_index = '/' + extensions[:search].options[:index_path]
  dom = Nokogiri.HTML(link_to '', absolute_link_to_index)
  node = dom.at_xpath '//a'
  node[:href]
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions