title: Jinja - Is there any built-in variable to get current HTML page name?
body: <p>i'm very new to Jinja and Flask</p>
  
  <p>I want to set different background color in the navigation bar to indicate the current page.</p>
  
  <p>Is there any built-in Jinja variable or method that returns current HTML pages? If possible, I want the code that doesn't need to communicate with the Python file.</p>
  
  <p>So if i'm currently in <code>index.html</code>, it will return "index" or "index.html"</p>
  
  <p>Here's my navigation code in my template:</p>
  
  <pre><code>&lt;ul&gt;
     {% for item in navigation %}
         &lt;a href="{{url_for(item.route)}}"&gt;
         &lt;li&gt;
             {{item.text}}
         &lt;/li&gt;
         &lt;/a&gt;
     {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  
  <p>I want to add <code>if</code> statement so the current page will get <code>&lt;li&gt;</code> that has <code>class</code></p>
  
  <pre><code>{% if ??? %}
     &lt;li class="current"&gt;
     ...
     &lt;/li&gt;
  {% else %}
     ...
  {% endif %}
  </code></pre>
  
  <p>Thank You</p>