Skip to content

Commit e387a13

Browse files
committed
feat: Add support for different icons
1 parent 4e895a5 commit e387a13

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
description: Update train category information
3+
agent: build
4+
---
5+
6+
Update the page $ARGUMENTS to new train category shortcodes.
7+
8+
A shortcode looks like:
9+
10+
```
11+
{{% train-category
12+
title="title"
13+
type="highspeed" (can be highspeed, regional, bus, funicular)
14+
fip_accepted=true (can be true, false, partially)
15+
reservation_required=true (can be true, false, partially)
16+
reservation_possible=true (omit the attribute if false or if reservation_required is true)
17+
risk_of_confusion=true (previously marked with ℹ️ in the title, omit the attribute if false)
18+
important_info=true (if an important highlight is part of the train category, omit the attribute if false)
19+
%}}
20+
{{% /train-category %}}
21+
```
22+
23+
Important information (previously paragraphs that started with ⚠️ in the text) should be changed to an important highlight shortcut (in the same position as the text was before):
24+
25+
```
26+
{{% highlight important %}}
27+
{{% /highlight %}}
28+
```
29+
30+
If there is a risk of confusion (previously marked with ℹ️ in the text), add it as confusion highlight (in the same position the text was before):
31+
32+
```
33+
{{% highlight confusion %}}
34+
{{% /highlight %}}
35+
```
36+
37+
Keep the "**Kosten für Reservierung:**" section.

layouts/partials/train-category.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<summary class="o-expander__summary o-expander__summary--train-category">
22
<div class="o-train-category__header">
33
<div class="o-train-category__title">
4-
{{- partial "icon" "train" -}}
4+
{{ $iconMapping := dict
5+
"highspeed" "train"
6+
"regional" "directions_subway"
7+
"funicular" "funicular"
8+
"bus" "directions_bus"
9+
}}
10+
{{- partial "icon" (index $iconMapping .type) -}}
511
<span class="o-train-category__title-text">{{- .title -}}</span>
612
</div>
713
<div class="o-train-category__tags">

layouts/shortcodes/train-category.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{- $data := dict
22
"title" (.Get "title")
3+
"type" (default "regional" (.Get "type"))
34
"fip_accepted" (default true (.Get "fip_accepted"))
45
"reservation_required" (default false (.Get "reservation_required"))
56
"reservation_possible" (default false (.Get "reservation_possible"))

0 commit comments

Comments
 (0)