module Jekyll::Filters::Menu

Public Instance Methods

menu_active_item(page_url) click to toggle source

Verifies if the given URL is an active item on the menu.

Example usage:

{% assign active_url = page.url | menu_active %} {% for item in site.i18n.menu.items %}

<a
  href="{{ item.href }}"
  class="{{ page.url | menu_active | equals: item.href | ternary: 'active', '' }}">

  {{ item.title }}
</a>

{% endfor %}

@param [String] The URL to be verified @return [String] The item URL

site_menu() click to toggle source

The menu is defined in a data file that corresponds to the site language. This method converts the menu items into a map of URL parts and actual URLs.

@see _data/es.yml @see {0xacab.org/sutty/jekyll/jekyll-locales} @return [Hash]