Commit 7be8ea97 authored by Miquel Torres's avatar Miquel Torres Committed by GitHub
Browse files

Merge pull request #228 from str4d/page-specific-meta-desc

Customise the meta description to describe the URL
parents a5774969 b95d1a8e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<title>{% block title %}MyProject's Speed Center{% endblock %}</title> <title>{% block title %}MyProject's Speed Center{% endblock %}</title>
<meta name="description" content="A performance analysis tool for software projects. It shows performance regresions and allows comparing different applications or implementations"> <meta name="description" content="{% block description %}A performance analysis tool for software projects. It shows performance regresions and allows comparing different applications or implementations{% endblock %}">
<meta name="keywords" content="performance, test, plots, charts"> <meta name="keywords" content="performance, test, plots, charts">
<meta charset="UTF-8"> <meta charset="UTF-8">
<link href="{{ STATIC_URL }}css/main.css" rel="stylesheet" type="text/css"> <link href="{{ STATIC_URL }}css/main.css" rel="stylesheet" type="text/css">
......
{% extends "codespeed/base_site.html" %} {% extends "codespeed/base_site.html" %}
{% block title %}{{ block.super }}: Changes{% endblock %} {% block title %}{{ block.super }}: Changes{% endblock %}
{% block description %}{% if pagedesc %}{{ pagedesc }}{% else %}{{ block.super }}{% endif %}{% endblock %}
{% block navigation %} {% block navigation %}
{{ block.super }} {{ block.super }}
......
{% extends "codespeed/base_site.html" %} {% extends "codespeed/base_site.html" %}
{% block title %}{{ block.super }}: Timeline{% endblock %} {% block title %}{{ block.super }}: Timeline{% endblock %}
{% block description %}{% if pagedesc %}{{ pagedesc }}{% else %}{{ block.super }}{% endif %}{% endblock %}
{% block extra_head %} {% block extra_head %}
{{ block.super }} {{ block.super }}
......
...@@ -476,11 +476,17 @@ def timeline(request): ...@@ -476,11 +476,17 @@ def timeline(request):
defaultextr = "on" defaultextr = "on"
# Information for template # Information for template
if defaultbenchmark in ['grid', 'show_none']:
pagedesc = None
else:
pagedesc = "Results timeline for the '%s' benchmark (project %s)" % \
(defaultbenchmark, defaultproject)
executables = {} executables = {}
for proj in Project.objects.filter(track=True): for proj in Project.objects.filter(track=True):
executables[proj] = Executable.objects.filter(project=proj) executables[proj] = Executable.objects.filter(project=proj)
use_median_bands = hasattr(settings, 'USE_MEDIAN_BANDS') and settings.USE_MEDIAN_BANDS use_median_bands = hasattr(settings, 'USE_MEDIAN_BANDS') and settings.USE_MEDIAN_BANDS
return render_to_response('codespeed/timeline.html', { return render_to_response('codespeed/timeline.html', {
'pagedesc': pagedesc,
'checkedexecutables': checkedexecutables, 'checkedexecutables': checkedexecutables,
'defaultbaseline': defaultbaseline, 'defaultbaseline': defaultbaseline,
'baseline': baseline, 'baseline': baseline,
...@@ -624,7 +630,10 @@ def changes(request): ...@@ -624,7 +630,10 @@ def changes(request):
] ]
revisionlists = json.dumps(revisionlists) revisionlists = json.dumps(revisionlists)
pagedesc = "Report of %s performance changes for commit %s on branch %s" % \
(defaultexecutable, selectedrevision.commitid, selectedrevision.branch)
return render_to_response('codespeed/changes.html', { return render_to_response('codespeed/changes.html', {
'pagedesc': pagedesc,
'defaultenvironment': defaultenv, 'defaultenvironment': defaultenv,
'defaultexecutable': defaultexecutable, 'defaultexecutable': defaultexecutable,
'selectedrevision': selectedrevision, 'selectedrevision': selectedrevision,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment