Skip to content

Commit

Permalink
Move helper into config (faster loading)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Oct 29, 2016
1 parent a629031 commit 40d0a4e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
11 changes: 11 additions & 0 deletions website/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ def description_for(page)
return escape_html(page.data.description || "")
end

# 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

# Returns the id for this page.
# @return [String]
def body_id_for(page)
Expand Down
12 changes: 0 additions & 12 deletions website/helpers/sidebar_helpers.rb

This file was deleted.

0 comments on commit 40d0a4e

Please sign in to comment.