mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
ce0354346c
Conflicts: docs/docs/flux-todo-list.md
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)
|