Skip to content

Instantly share code, notes, and snippets.

@cpdean
Forked from rouge8/filters.py
Last active December 14, 2015 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpdean/5167312 to your computer and use it in GitHub Desktop.
Save cpdean/5167312 to your computer and use it in GitHub Desktop.
{% macro nav_link(endpoint, name) %}
{%- if endpoint == request.endpoint -%}
<li class="active">
<a href="{{ url_for(endpoint) }}">{{ name }}</a>
</li>
{%- else -%}
<li>
<a href="{{ url_for(endpoint) }}">{{ name }}</a>
</li>
{%- endif -%}
{% endmacro %}
<ul class="nav nav-tabs">
{{ nav_link("index", "home") }}
{{ nav_link("dashboard", "dashboard") }}
{{ nav_link("trends", "trending") }}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment