Unverified Commit b95d1a8e authored by str4d's avatar str4d
Browse files

Customise the meta description to describe the URL

This is useful when pasting permalinks into apps that show the description in a
summary of the page.
parent 33b2a3d6
...@@ -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 }}
......
...@@ -463,11 +463,17 @@ def timeline(request): ...@@ -463,11 +463,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,
...@@ -611,7 +617,10 @@ def changes(request): ...@@ -611,7 +617,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