Change code depending on page
I have a twig-template (with twitter bootstrap) with the following code - it's a navbar:

    <ul class="nav">
        <li class="active"><a href="#">Modul 1</a></li>
        <li><a href="#about">Modul 2</a></li>
        <li><a href="#contact">Modul 3</a></li>
    </ul>

This code is in my global.html.twig. So I want to change the class="active" in the list element depending on the page that is opened.

How can I achieve this without adding too much logic in my template?
Change code depending on page
===

I have a twig-template (with twitter bootstrap) with the following code - it's a navbar:

    <ul class="nav">
        <li class="active"><a href="#">Modul 1</a></li>
        <li><a href="#about">Modul 2</a></li>
        <li><a href="#contact">Modul 3</a></li>
    </ul>

This code is in my global.html.twig. So I want to change the class="active" in the list element depending on the page that is opened.

How can I achieve this without adding too much logic in my template?