Skip to content

Commit 5e999a2

Browse files
committed
Use template markers for 'Home' and 'About' links
Instead of hard-coding the links to the 'Home' page and to the 'About' page, use template markers. This allows the hyperlinks to work even if the Codespeed site does not reside at the web server root.
1 parent 17cba4b commit 5e999a2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

codespeed/templates/codespeed/base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
{# TODO: Rename id=title to id=header and/or switch to <header> #}
1515
<div id="title" class="clearfix">
1616
{% block page_header %}
17-
<a href="/">
17+
<a href="{% url 'home' %}">
1818
{% block logo %}
1919
<img src="{{ STATIC_URL }}images/logo.png" height="48" alt="logo"/>
2020
{% endblock logo %}
2121
</a>
2222
<h2>{% block page_title %}SPEED CENTER{% endblock page_title %}</h2>
2323
{% block top_nav %}
2424
<ul id="links" class="inline">
25-
<li><a href="/">Home</a></li><li><a href="../about/">About</a></li>
25+
<li><a href="{% url 'home' %}">Home</a></li><li><a href="{% url 'about' %}">About</a></li>
2626
</ul>
2727
{% endblock top_nav %}
2828
{% endblock page_header %}

codespeed/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77

88
urlpatterns = patterns('',
9-
url(r'^$', TemplateView.as_view(template_name='home.html')),
10-
url(r'^about/$', TemplateView.as_view(template_name='about.html')),
9+
url(r'^$', TemplateView.as_view(template_name='home.html'), name='home'),
10+
url(r'^about/$', TemplateView.as_view(template_name='about.html'), name='about'),
1111
# RSS for reports
1212
url(r'^feeds/latest/$', LatestEntries(), name='latest_feeds'),
1313
url(r'^feeds/latest_significant/$', LatestSignificantEntries(),

0 commit comments

Comments
 (0)