Move sidebar helper inline

This commit is contained in:
Seth Vargo 2014-10-06 19:13:22 -04:00
parent fb5aa46b76
commit 13ca50102c
2 changed files with 11 additions and 12 deletions

View File

@ -17,4 +17,15 @@ configure :build do
activate :asset_hash
activate :minify_html
activate :minify_javascript
helpers do
# 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

View File

@ -1,12 +0,0 @@
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