Skip to content

Commit b95d1a8

Browse files
committed
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.
1 parent 33b2a3d commit b95d1a8

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

codespeed/templates/codespeed/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>{% block title %}MyProject's Speed Center{% endblock %}</title>
5-
<meta name="description" content="A performance analysis tool for software projects. It shows performance regresions and allows comparing different applications or implementations">
5+
<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 %}">
66
<meta name="keywords" content="performance, test, plots, charts">
77
<meta charset="UTF-8">
88
<link href="{{ STATIC_URL }}css/main.css" rel="stylesheet" type="text/css">

codespeed/templates/codespeed/changes.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends "codespeed/base_site.html" %}
22

33
{% block title %}{{ block.super }}: Changes{% endblock %}
4+
{% block description %}{% if pagedesc %}{{ pagedesc }}{% else %}{{ block.super }}{% endif %}{% endblock %}
45

56
{% block navigation %}
67
{{ block.super }}

codespeed/templates/codespeed/timeline.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends "codespeed/base_site.html" %}
22

33
{% block title %}{{ block.super }}: Timeline{% endblock %}
4+
{% block description %}{% if pagedesc %}{{ pagedesc }}{% else %}{{ block.super }}{% endif %}{% endblock %}
45

56
{% block extra_head %}
67
{{ block.super }}

codespeed/views.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,17 @@ def timeline(request):
463463
defaultextr = "on"
464464

465465
# Information for template
466+
if defaultbenchmark in ['grid', 'show_none']:
467+
pagedesc = None
468+
else:
469+
pagedesc = "Results timeline for the '%s' benchmark (project %s)" % \
470+
(defaultbenchmark, defaultproject)
466471
executables = {}
467472
for proj in Project.objects.filter(track=True):
468473
executables[proj] = Executable.objects.filter(project=proj)
469474
use_median_bands = hasattr(settings, 'USE_MEDIAN_BANDS') and settings.USE_MEDIAN_BANDS
470475
return render_to_response('codespeed/timeline.html', {
476+
'pagedesc': pagedesc,
471477
'checkedexecutables': checkedexecutables,
472478
'defaultbaseline': defaultbaseline,
473479
'baseline': baseline,
@@ -611,7 +617,10 @@ def changes(request):
611617
]
612618
revisionlists = json.dumps(revisionlists)
613619

620+
pagedesc = "Report of %s performance changes for commit %s on branch %s" % \
621+
(defaultexecutable, selectedrevision.commitid, selectedrevision.branch)
614622
return render_to_response('codespeed/changes.html', {
623+
'pagedesc': pagedesc,
615624
'defaultenvironment': defaultenv,
616625
'defaultexecutable': defaultexecutable,
617626
'selectedrevision': selectedrevision,

0 commit comments

Comments
 (0)