Skip to content

Commit b3d43b5

Browse files
committed
feat: Redesign highlight in train category expanders
1 parent df3615c commit b3d43b5

File tree

5 files changed

+103
-24
lines changed

5 files changed

+103
-24
lines changed

.opencode/command/update-traincategory.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ A shortcode looks like:
1010
```
1111
{{% train-category
1212
title="title"
13-
type="highspeed" (can be highspeed, regional, bus, funicular)
13+
type="highspeed" (can be highspeed, regional, bus, funicular, sleeper)
1414
fip_accepted=true (can be true, false, partially)
1515
reservation_required=true (can be true, false, partially)
1616
reservation_possible=true (omit the attribute if false or if reservation_required is true)
1717
risk_of_confusion=true (previously marked with ℹ️ in the title, omit the attribute if false)
1818
important_info=true (if an important highlight is part of the train category, omit the attribute if false)
19+
route_overview_url="https://example.com" (if there is an route overview link in the description, otherwise omit the attribute)
20+
additional_information_url="https://example.com" (if there is an additional information link in the description, otherwise omit the attribute)
1921
%}}
2022
{{% /train-category %}}
2123
```
@@ -34,4 +36,4 @@ If there is a risk of confusion (previously marked with ℹ️ in the text), add
3436
{{% /highlight %}}
3537
```
3638

37-
Keep the "**Kosten für Reservierung:**" section.
39+
Tranform the "**Reservation cost:**" (or language equivalent) section to a heading "### Reservation".

assets/sass/trainCategory.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,17 @@
4545
}
4646
}
4747
}
48+
.o-train-category__content {
49+
.m-text-highlight {
50+
&--important,
51+
&--confusion {
52+
> .m-text-highlight__roofline {
53+
color: var(--tag-warning-color);
54+
}
55+
56+
background-color: var(--tag-warning-bg);
57+
border: var(--tag-warning-border) solid;
58+
border-width: 1px 1px 1px 1rem;
59+
}
60+
}
61+
}

content/operator/sncf/index.en.md

Lines changed: 74 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ Reservations are mandatory on all `TGV`, almost all `IC` trains, and some region
3939

4040
{{% train-category
4141
title="Train à grande vitesse inOui (TGV inOui)"
42+
type="highspeed"
4243
fip_accepted=true
4344
reservation_required=true
4445
risk_of_confusion=true
4546
important_info=true
4647
route_overview_url="https://www.sncf-connect.com/assets/media/2021-05/2014_axes-tgv_0.pdf"
47-
type="highspeed"
4848
%}}
4949
The `TGV` inOui is SNCF's high-speed train, connecting many cities in France and international destinations (e.g. Munich, Frankfurt am Main, Barcelona, Luxembourg, Brussels, Zurich, Milan). Each seat number exists twice in the carriage; the reserved seat is the one with the illuminated number.
5050

@@ -69,50 +69,78 @@ Prices differ between peak and off-peak trains. The classification is not public
6969

7070
{{% train-category
7171
title="Train à grande vitesse OuiGo (TGV OuiGo) / OuiGo Train Classique"
72+
type="highspeed"
7273
fip_accepted=false
7374
reservation_required=true
75+
risk_of_confusion=true
7476
%}}
77+
7578
The `TGV` OuiGo is SNCF's low-cost high-speed train, serving many cities in France and some international destinations.
79+
80+
{{% highlight confusion %}}
81+
SNCF also operates `TGV` trains under the inOui brand, which are valid with FIP.
82+
{{% /highlight %}}
7683
{{% /train-category %}}
7784

7885
{{% train-category
7986
title="Intercity-Express (ICE)"
87+
type="highspeed"
8088
fip_accepted=true
8189
reservation_required=true
8290
%}}
8391
International high-speed trains operated by SNCF in cooperation with Deutsche Bahn, running between France (Paris Est, Strasbourg) and Germany (Karlsruhe, Mannheim, Frankfurt am Main, Stuttgart, Munich).
8492

85-
**Reservation cost:** \
86-
Prices differ between peak and off-peak trains. Off-peak: €1.70 (1st/2nd class); peak: €15 (1st class), €10 (2nd class). The classification is not publicly available.
93+
### Reservation
94+
95+
Prices differ between peak and off-peak trains. The classification is not publicly available.
96+
97+
| | 1st class | 2nd class |
98+
| -------- | --------- | --------- |
99+
| Off-peak | €1.70 | €1.70 |
100+
| Peak | €15 | €10 |
101+
87102
{{% /train-category %}}
88103

89104
{{% train-category
90105
title="Intercité (IC)"
106+
type="highspeed"
91107
fip_accepted=true
92108
reservation_required=true
93109
%}}
94110
Intercity trains operated by SNCF, connecting various cities in France, mostly requiring reservations.
95111

96112
SNCF does not provide public information on which `IC` trains require reservations. If in doubt, check with SNCF or purchase a reservation.
97113

98-
**Reservation cost:** \
99-
Prices differ between peak and off-peak trains. Off-peak: €1.70 (1st/2nd class); peak: €15 (1st class), €10 (2nd class). The classification is not publicly available.
114+
### Reservation
115+
116+
Prices differ between peak and off-peak trains. The classification is not publicly available.
117+
118+
| | 1st class | 2nd class |
119+
| -------- | --------- | --------- |
120+
| Off-peak | €1.70 | €1.70 |
121+
| Peak | €15 | €10 |
122+
100123
{{% /train-category %}}
101124

102125
{{% train-category
103126
title="Intercité de nuit"
127+
type="sleeper"
104128
fip_accepted=true
105129
reservation_required=true
106130
%}}
107131
SNCF night trains within France. International Nightjet connections ended in December 2025.
108132

109-
**Reservation cost:** depends on route and occupancy
133+
### Reservation
134+
135+
Cost depends on route and occupancy.
136+
110137
{{% /train-category %}}
111138

112139
### Regional
113140

114141
{{% train-category
115142
title="Train express régional (TER)"
143+
type="regional"
116144
fip_accepted=true
117145
reservation_possible=true
118146
%}}
@@ -121,6 +149,7 @@ SNCF night trains within France. International Nightjet connections ended in Dec
121149

122150
{{% train-category
123151
title="Réseau Express Régional (RER)"
152+
type="regional"
124153
fip_accepted=true
125154
%}}
126155
RER is a suburban train operated by SNCF in Île de France (Greater Paris) and surrounding cities.
@@ -205,25 +234,44 @@ This validation requirement does not apply to FIP Coupons.
205234

206235
### International TGV inOui / ICE trains
207236

208-
{{% expander "TGV/ICE trains to Germany" info %}}
237+
{{% train-category
238+
title="TGV/ICE trains to Germany"
239+
type="highspeed"
240+
fip_accepted=partially
241+
reservation_required=partially
242+
%}}
209243
International `TGV` and `ICE` trains are reservation-required in the French section. In Germany, reservations are not required and FIP Coupons are valid.
210-
{{% /expander %}}
244+
{{% /train-category %}}
211245

212-
{{% expander "TGV trains to Italy, Spain, and Belgium" info %}}
246+
{{% train-category
247+
title="TGV trains to Italy, Spain, and Belgium"
248+
type="highspeed"
249+
fip_accepted=partially
250+
reservation_required=true
251+
%}}
213252
International `TGV` services from France to Italy, Spain, or Belgium are reservation-required throughout and FIP Coupons are not valid. Instead, FIP Global Fares can be purchased, which can be expensive (up to €130). [^1]
214-
{{% /expander %}}
253+
{{% /train-category %}}
215254

216-
{{% expander "TGV Lyria trains to Switzerland" info %}}
255+
{{% train-category
256+
title="TGV Lyria trains to Switzerland"
257+
type="highspeed"
258+
fip_accepted=partially
259+
reservation_required=partially
260+
%}}
217261
International `TGV` Lyria services from France to Switzerland are reservation-required in the French section and FIP Coupons are not valid. FIP Global Fares can be purchased. In Switzerland, reservations are not required and FIP Coupons are valid.
218-
{{% /expander %}}
262+
{{% /train-category %}}
219263

220264
### Trains in Greater Paris
221265

222266
Île-de-France Mobilités (ÎDF Mobilités) coordinates various transport operators in Greater Paris, including RATP and SNCF.
223267

224268
RATP operates the Paris Métro, bus lines, and part of the tram and RER networks. SNCF operates the rest of the RER network and some tram lines. FIP discounts do not apply on RATP services.
225269

226-
{{% expander "RER trains" info %}}
270+
{{% train-category
271+
title="RER trains"
272+
type="regional"
273+
fip_accepted=partially
274+
%}}
227275
Some RER lines are operated by SNCF. FIP discounts apply on the following sections:
228276

229277
- RER Line A – only branches A3 & A5 west of Nanterre Préfecture to Poissy or Cergy-le-Haut
@@ -233,15 +281,23 @@ Some RER lines are operated by SNCF. FIP discounts apply on the following sectio
233281
- RER Line E – entire line
234282

235283
Note: For journeys between Gare du Nord and Châtelet – Les Halles, only SNCF-operated RER Line D can be used. FIP discounts are not valid on RATP-operated RER Line B on the same section.
236-
{{% /expander %}}
284+
{{% /train-category %}}
237285

238-
{{% expander "Transilien trains" info %}}
286+
{{% train-category
287+
title="Transilien trains"
288+
type="regional"
289+
fip_accepted=true
290+
%}}
239291
FIP discounts apply on all Transilien lines H, J, K, L, N, P, R, U, and V.
240-
{{% /expander %}}
292+
{{% /train-category %}}
241293

242-
{{% expander "Trams" info %}}
294+
{{% train-category
295+
title="Trams"
296+
type="tram"
297+
fip_accepted=partially
298+
%}}
243299
Tram lines T4 and T11 are operated by SNCF and can be used with FIP discounts. Tram lines T9 and T13 are operated by SNCF and Keolis; FIP validity is unclear. FIP discounts do not apply on other tram lines.
244-
{{% /expander %}}
300+
{{% /train-category %}}
245301

246302
<img src="/en/operator/sncf/contramarquedePassage.webp" alt="Contramarque de Passage" style="width: 60%; float: right; margin-left: 2rem; margin-bottom: 1rem">
247303

layouts/partials/train-category.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
<details class="o-expander o-expander--booking">
1+
<details class="o-expander o-expander--train-category">
22
<summary class="o-expander__summary o-expander__summary--train-category">
33
<div class="o-train-category__header">
44
<div class="o-train-category__title">
55
{{ $iconMapping := dict
66
"highspeed" "train"
77
"regional" "directions_subway"
8+
"sleeper" "airline_seat_flat"
89
"funicular" "funicular"
910
"bus" "directions_bus"
11+
"tram" "tram"
1012
}}
1113
{{- partial "icon" (index $iconMapping .type) -}}
1214
<span class="o-train-category__title-text">{{- .title -}}</span>
@@ -34,7 +36,7 @@
3436
{{ partial "icon" "calendar_add_on" }}
3537
{{ i18n "trainCategory.reservation.required" }}
3638
</span>
37-
{{- else if eq .reservation_required true -}}
39+
{{- else if eq .reservation_required "partially" -}}
3840
<span class="o-train-category__tag o-train-category__tag--warning">
3941
{{ partial "icon" "calendar_add_on" }}
4042
{{ i18n "trainCategory.reservation.partiallyRequired" }}
@@ -69,7 +71,7 @@
6971
{{- partial "icon" "keyboard_arrow_down" -}}
7072
</summary>
7173
<hr aria-hidden="true" />
72-
<div class="o-expander__content">
74+
<div class="o-expander__content o-train-category__content">
7375
{{- .content -}}
7476
{{- if .route_overview_url -}}
7577
{{- partial "button"

layouts/shortcodes/highlight.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{{- $param := .Get 0 -}}
2-
{{ $iconMapping := dict "important" "error" "inofficial" "warning" "tip" "lightbulb_2" "confusion" "question_exchange" }}
2+
{{ $iconMapping := dict
3+
"important" "campaign"
4+
"inofficial" "warning"
5+
"tip" "lightbulb_2"
6+
"confusion" "question_exchange"
7+
}}
38

49

510
<div class="m-text-highlight m-text-highlight--{{ $param }}">

0 commit comments

Comments
 (0)