Read more

Highlight current navigation item with Staticmatic

Thomas Eisenbarth
September 15, 2012Software engineer at makandra GmbH

StaticMatic Show archive.org snapshot 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'
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

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.

Posted by Thomas Eisenbarth to makandra dev (2012-09-15 16:11)