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

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/website/docs/helpers/sidebar_helpers.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/website/docs/helpers/sidebar_helpers.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/website/docs/helpers/sidebar_helpers.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/website/docs/helpers/sidebar_helpers.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/website/docs/helpers/sidebar_helpers.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/website/docs/helpers/sidebar_helpers.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/website/docs/helpers/sidebar_helpers.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/website/docs/helpers/sidebar_helpers.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/bundler/gems/vagrant-1e28f1ac31e7/website/docs/helpers/sidebar_helpers.rb
tnargav-1.3.3 website/docs/helpers/sidebar_helpers.rb