opentofu/website/helpers/sidebar_helpers.rb

13 lines
347 B
Ruby
Raw Normal View History

2014-07-16 16:51:48 -05:00
module SidebarHelpers
# This helps by setting the "active" class for sidebar nav elements
# if the YAML frontmatter matches the expected value.
def sidebar_current(expected)
current = current_page.data.sidebar_current || ""
if current.start_with?(expected)
return " class=\"active\""
else
return ""
end
end
end