Files
react/docs/_plugins/sidebar_item.rb
Paul O’Shannessy 6c19040d24 Point to Flux site for Flux docs
This doesn't actually remove the pages, just the main content. Sidebar
items now link offsite. The pages doesn't automatically redirect, but we
could do that if we really wanted.

Fixes #2229
2014-09-25 12:34:22 -07:00

15 lines
412 B
Ruby

module Jekyll
module SidebarItemFilter
def sidebar_item_link(item)
pageID = @context.registers[:page]["id"]
itemID = item["id"]
href = item["href"] || "/react/docs/#{itemID}.html"
className = pageID == itemID ? ' class="active"' : ''
return "<a href=\"#{href}\"#{className}>#{item["title"]}</a>"
end
end
end
Liquid::Template.register_filter(Jekyll::SidebarItemFilter)