Highlight current navigation item with Staticmatic

StaticMatic Archive is a nice tool to build simple static websites.
In case you want to have some nifty styles on the navigation item that is currently active, you can use this:

=link 'Aktuelles', :class => (current_page =~ /aktuelles/) ? 'current' : 'default'

Keep in mind that current_page gives you the full relative path of your page. raise current_path in case you're not sure.

I know there is an navigation helper out there. I did not use it and also did not want to migrate.

Thomas Eisenbarth over 9 years ago
This website uses short-lived cookies to improve usability.
Accept or learn more