1
0
mirror of https://github.com/meineerde/holgerjust.de.git synced 2026-02-21 19:12:05 +00:00

Allow to use procs in navigation links

This commit is contained in:
Holger Just 2015-12-06 14:08:08 +01:00
parent a8982fb69e
commit f235838ecb
2 changed files with 3 additions and 1 deletions

View File

@ -104,7 +104,8 @@ set :casper, {
},
navigation: {
'Home' => '/',
'Impressum' => '/impressum/'
'About Me' => ->{ author_path },
'Legal' => '/impressum/'
}
}

View File

@ -4,6 +4,7 @@
%span.hidden Close
%ul
- navigation.try(:each) do |label, href|
- href = href.call if href.respond_to?(:call)
- css_class = %W(nav-#{label.parameterize})
- css_class << "nav-current" if current_page.url == href
%li{class: css_class.join(' '), role: :presentation}