Sha256: 7e0bd37e1114546da6a04177dfcd4ad875a5332e83c7bee8bfc10d69d0afaded
Contents?: true
Size: 561 Bytes
Versions: 10
Compression:
Stored size: 561 Bytes
Contents
module SidebarHelpers # This helps by setting the "current" 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 == expected || sidebar_section == expected return " class=\"current\"" else return "" end end # This returns the overall section of the documentation we're on. def sidebar_section current = current_page.data.sidebar_current return "" if !current current.split("-")[0] end end
Version data entries
10 entries across 7 versions & 4 rubygems