mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-24 12:43:05 +00:00
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)
|