mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 18:01:01 -06:00
13 lines
347 B
Ruby
13 lines
347 B
Ruby
|
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
|