Refer to the current_page title rather than filename

This commit is contained in:
Dougal Matthews 2014-11-25 13:09:47 +00:00
parent 935d94c034
commit 4d28a09309
2 changed files with 5 additions and 8 deletions

View File

@ -54,9 +54,7 @@
} }
</style> </style>
</head> </head>
{# TODO: This is a bit of a hack. We don't want to refer to the file specifically. #} <body onload="prettyPrint()" class="{% if current_page.title == 'Home' %}index{% endif %}-page">
<body onload="prettyPrint()" class="{% if current_page.input_path == 'index.md' %}index{% endif %}-page">
<div class="wrapper"> <div class="wrapper">
@ -106,7 +104,7 @@
<div id="table-of-contents"> <div id="table-of-contents">
<ul class="nav nav-list side-nav well sidebar-nav-fixed"> <ul class="nav nav-list side-nav well sidebar-nav-fixed">
{% if current_page.input_path == 'index.md' %} {% if current_page.title == 'Home' %}
<li class="main"> <li class="main">
<a href="#">Django REST framework</a> <a href="#">Django REST framework</a>
</li> </li>
@ -114,7 +112,7 @@
{% for toc_item in toc %} {% for toc_item in toc %}
<li class="{% if current_page.input_path != 'index.md' %}main{% endif %}"> <li class="{% if current_page.title != 'Home' %}main{% endif %}">
<a href="{{ toc_item.url }}">{{ toc_item.title }}</a> <a href="{{ toc_item.url }}">{{ toc_item.title }}</a>
</li> </li>
@ -126,8 +124,7 @@
{% endfor %} {% endfor %}
{# TODO: This is a bit of a hack. We don't want to refer to the file specifically. #} {% if current_page.title == 'Home' %}
{% if current_page.input_path == 'index.md' %}
<div class="promo"> <div class="promo">
<hr/> <hr/>
<script type="text/javascript" src="//cdn.fusionads.net/fusion.js?zoneid=1332&serve=C6SDP2Y&placement=djangorestframework" id="_fusionads_js"></script> <script type="text/javascript" src="//cdn.fusionads.net/fusion.js?zoneid=1332&serve=C6SDP2Y&placement=djangorestframework" id="_fusionads_js"></script>

View File

@ -19,7 +19,7 @@
{% if include_nav %} {% if include_nav %}
<!-- Main navigation --> <!-- Main navigation -->
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li {% if current_page.input_path == 'index.md' %}class="active"{% endif %}><a href="/">Home</a></li> <li {% if current_page.title == 'Home' %}class="active"{% endif %}><a href="/">Home</a></li>
{% for nav_item in nav %} {% if nav_item.children %} {% for nav_item in nav %} {% if nav_item.children %}
<li class="dropdown{% if nav_item.active %} active{% endif %}"> <li class="dropdown{% if nav_item.active %} active{% endif %}">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ nav_item.title }} <b class="caret"></b></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ nav_item.title }} <b class="caret"></b></a>