mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
6c19040d24
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
15 lines
412 B
Ruby
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)
|