Class: JekyllNavigation::Navigation
- Inherits:
-
Struct
- Object
- Struct
- JekyllNavigation::Navigation
- Defined in:
- lib/jekyll-navigation/navigation.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#level ⇒ Object
Returns the value of attribute level.
Instance Method Summary collapse
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context
2 3 4 |
# File 'lib/jekyll-navigation/navigation.rb', line 2 def context @context end |
#level ⇒ Object
Returns the value of attribute level
2 3 4 |
# File 'lib/jekyll-navigation/navigation.rb', line 2 def level @level end |
Instance Method Details
#display? ⇒ Boolean
3 4 5 |
# File 'lib/jekyll-navigation/navigation.rb', line 3 def display? !render.empty? end |
#render ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/jekyll-navigation/navigation.rb', line 7 def render pages.map do |page| css = (current_page["url"] == page["url"] || current_page.parent == page["url"]) ? " class='active'" : "" %Q{<li#{css}><a href=".#{page["url"]}">#{page.title}</a></li>} end.join("\n") end |