summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-07-03 19:27:20 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-07-03 19:27:20 +0200
commitb1dcf0d582e92f60e7400f7ac477811a5d351945 (patch)
tree9c94213771767c424afd6b2c898da02c51826064
parent83a1be4735db1f1736e7a7d6465a4d7ac4d7aa59 (diff)
set appropriate meta description for departure board and train details
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm18
-rw-r--r--templates/layouts/app.html.ep2
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index fd7ed37..912d95d 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -958,6 +958,14 @@ sub render_train {
sub {
$self->render(
$template // '_train_details',
+ description => sprintf(
+ '%s %s%s%s nach %s',
+ $departure->{train_type},
+ $departure->{train_line} // $departure->{train_no},
+ $departure->{origin} ? ' von ' : q{},
+ $departure->{origin} // q{},
+ $departure->{destination} // 'unbekannt'
+ ),
departure => $departure,
linetype => $linetype,
icetype => $self->app->ice_type_map->{ $departure->{train_no} },
@@ -1279,6 +1287,14 @@ sub train_details {
$self->render(
$self->param('ajax') ? '_train_details' : 'train_details',
+ description => sprintf(
+ '%s %s%s%s nach %s',
+ $res->{train_type},
+ $res->{train_line} // $res->{train_no},
+ $res->{origin} ? ' von ' : q{},
+ $res->{origin} // q{},
+ $res->{destination} // 'unbekannt'
+ ),
departure => $res,
linetype => $linetype,
icetype => $self->app->ice_type_map->{ $res->{train_no} },
@@ -1735,6 +1751,8 @@ sub handle_result {
}
$self->render(
$template,
+ description => 'Abfahrtstafel '
+ . ( $via ? "$station_name via $via" : $station_name ),
api_link => $api_link,
api_text => $api_text,
api_icon => $api_icon,
diff --git a/templates/layouts/app.html.ep b/templates/layouts/app.html.ep
index 84b2d33..ba709d3 100644
--- a/templates/layouts/app.html.ep
+++ b/templates/layouts/app.html.ep
@@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="Abfahrtsmonitor, Bahnhofstafel, Abfahrten, Abfahrtstafel, ICE, IC, RE, RB, S-Bahn">
- <meta name="description" content="Inoffizieller Abfahrtsmonitor für innerdeutsche Zugfahrten">
+ <meta name="description" content="<%= stash('description') // 'Inoffizieller Abfahrtsmonitor für innerdeutsche Zugfahrten' %>">
<meta name="theme-color" content="#00838f">
<link rel="icon" type="image/png" href="/static/icons/icon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/static/icons/icon-32x32.png" sizes="32x32">