Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions assets/sass/floatImage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,36 @@
display: flow-root;
margin-bottom: 1rem;

&--right > figure {
&__images {
display: flex;
gap: 1rem;
width: var(--float-image-width, 50%);
}

&__images > figure {
flex: 1;
min-width: 0;
margin: 0;
}

&--right > figure,
&--right > .m-float-image__images {
float: right;
margin-left: 2rem;
}

&--left > figure {
&--left > figure,
&--left > .m-float-image__images {
float: left;
margin-right: 2rem;
}

@media (max-width: $breakpoint-md) {
&__images {
flex-direction: column;
float: none;
margin: 0 0 1rem;
width: 100%;
}
}
}
43 changes: 17 additions & 26 deletions content/operator/cd/index.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,11 @@ Die České dráhy (ČD) ist die staatliche Eisenbahngesellschaft der [Tschechis

FIP Freifahrtscheine und FIP 50 Tickets sind auf Verbindungen der ČD gültig. Bei grenzüberschreitenden Fahrten muss entweder ein durchgängiges FIP 50 Ticket oder FIP Freifahrtscheine beider Länder vorhanden sein.

{{< highlight important >}}

{{< float-image
src="cd-fip-map-overview-26.webp"
alt="FIP Gültigkeitskarte Überblick für Tschechien"
caption="[Überblick FIP Gültigkeitskarte](/en/operator/cd/cd-fip-map-overview-26.webp) für Tschechien (© Petr Duda)"
width="40%"
position="left" >}}

{{% highlight important %}}
Auf einigen Routen und Regionen gelten keine FIP Vergünstigungen, obwohl die Verbindungen von der ČD betrieben werden. Teilweise sind Strecken auch zuschlagspflichtig.

Für einen ersten Eindruck, kann die Übersichtskarte für FIP Vergünstigungen in Tschechien genutzt werden.
{{< /float-image >}}

{{< float-image
src="cd-fip-map-detail-26.webp"
alt="FIP Gültigkeitskarte Detail für Tschechien"
caption="[Detail FIP Gültigkeitskarte](/en/operator/cd/cd-fip-map-detail-26.webp) für Tschechien (© Petr Duda)"
width="40%"
position="left" >}}
Für detaillierte Informartionen kann die Detailkarte für FIP Vergünstigungen genutzt werden.

Weitere Informationen: [Verbindungen der ČD ohne FIP](#verbindungen-der-čd-ohne-fip) und [ČD kommerzielle Verbindungen (zuschlagspflichtig)](#čd-kommerzielle-verbindungen-zuschlagspflichtig)
{{< /float-image >}}

{{< /highlight >}}
Weitere Informationen in den [tariflichen Besonderheiten](#tarifliche-besonderheiten) auf dieser Seite.
{{% /highlight %}}

## Zugkategorien und Reservierungen

Expand Down Expand Up @@ -278,11 +257,23 @@ Für reguläre Fahrkarten reisen Kinder bis 6 Jahre in der 2. Klasse kostenlos.

## Tarifliche Besonderheiten

Auf einigen Routen und Regionen gelten keine FIP Vergünstigungen, obwohl die Verbindungen von der ČD betrieben werden. Teilweise sind Strecken auch zuschlagspflichtig.

Für eine Übersicht der Gültigkeit kann die Übersichtskarte hier verwendet werden. Ausführlichere Informationen finden sich in der Detailkarte und den konkreten Regelungen in den folgenden Abschnitten zu [ČD Kommerzielle Verbindungen (zuschlagspflichtig)](#čd-kommerzielle-verbindungen-zuschlagspflichtig) und [Verbindungen der ČD ohne FIP](#verbindungen-der-čd-ohne-fip).

{{< float-image
src=`["cd-fip-map-overview-26.webp","cd-fip-map-detail-26.webp"]`
alt=`["FIP Gültigkeitskarte Überblick für Tschechien","FIP Gültigkeitskarte Detail für Tschechien"]`
caption=`["[Überblick FIP Gültigkeitskarte (Vollbild)](/en/operator/cd/cd-fip-map-overview-26.webp) für Tschechien (© Petr Duda)","[Detail FIP Gültigkeitskarte (Vollbild)](/en/operator/cd/cd-fip-map-detail-26.webp) für Tschechien (© Petr Duda)"]`
width="100%"
position="left">}}
{{< /float-image >}}
Comment on lines +264 to +270
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Danke dir fürs Anpassen – ich persönlich bin mir unsicher, ob diese Syntax so verständlich ist. Werden wir das an anderer Stelle wiederverwenden? Die Frage ist auch, ob wir es nicht anders als mit Float lösen können, um zwei Bilder nebeneinander darzustellen. 🤔 Lass uns da gern nochmal zu quatschen :)


### ČD Kommerzielle Verbindungen (zuschlagspflichtig)

Auf sogenannten _kommerziellen_ Verbindungen der ČD muss ein Zuschlag gekauft werden. Diese umfassen in der Regel nur bestimmte Züge der Zugkategorien `SC`, `EC`, `IC` und `R`. [^3]

Als Orientierung können die [FIP Gültigkeitskarten für Tschechien](#gültigkeit-fip-tickets) genutzt werden.
Als Orientierung können die [FIP Gültigkeitskarten für Tschechien](#tarifliche-besonderheiten) genutzt werden.

Betroffene Verbindungen im Detail:

Expand Down Expand Up @@ -532,7 +523,7 @@ Grundsätzlich gilt FIP theoretisch in keinen ČD Zügen, die im Rahmen von gewo

Für Verkehre, die von regionalen Gemeinden vergeben werden (Züge der Kategorie `SP` und `OS`), gilt FIP in einigen Regionen überhaupt nicht.

Als Orientierung kann die [FIP Gültigkeitekarte für Tschechien](#gültigkeit-fip-tickets) genutzt werden.
Als Orientierung kann die [FIP Gültigkeitekarte für Tschechien](#tarifliche-besonderheiten) genutzt werden.

Betrofene Regionen im Detail:

Expand Down
43 changes: 17 additions & 26 deletions content/operator/cd/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,11 @@ aliases:

FIP Coupons and FIP 50 Tickets are valid on ČD services. For cross-border journeys, either a continuous FIP 50 Ticket or FIP Coupons for both countries are required.

{{< highlight important >}}

{{< float-image
src="cd-fip-map-overview-26.webp"
alt="FIP validity map overview for Czechia"
caption="[Overview FIP validity map](/en/operator/cd/cd-fip-map-overview-26.webp) for Czechia (© Petr Duda)"
width="40%"
position="left" >}}

{{% highlight important %}}
On some routes and in some regions, FIP benefits are not valid, even if the services are operated by ČD. Some routes also require a surcharge.

For a first impression, the overview map for FIP benefits in Czechia can be used.
{{< /float-image >}}

{{< float-image
src="cd-fip-map-detail-26.webp"
alt="FIP validity map detail for Czechia"
caption="[Detailed FIP validity map](/en/operator/cd/cd-fip-map-detail-26.webp) for Czechia (© Petr Duda)"
width="40%"
position="left" >}}
For detailed information, the detailed map for FIP benefits can be used.

Further information: [ČD services without FIP](#čd-services-without-fip) and [ČD commercial services (surcharge required)](#čd-commercial-services-surcharge-required)
{{< /float-image >}}

{{< /highlight >}}
Further information in the [Special Tariff Conditions](#special-tariff-conditions) on this page.
{{% /highlight %}}

## Train Categories and Reservations

Expand Down Expand Up @@ -278,11 +257,23 @@ For regular tickets, children up to 6 years travel free in 2nd class. Children u

## Special Tariff Conditions

On some routes and in some regions, FIP benefits are not valid, even if the services are operated by ČD. Some routes also require a surcharge.

For an overview of validity, the overview map can be used here. More detailed information can be found in the detailed map and the specific rules in the following sections on [ČD Commercial Services (Surcharge Required)](#čd-commercial-services-surcharge-required) and [ČD Services Without FIP](#čd-services-without-fip).

{{< float-image
src=`["cd-fip-map-overview-26.webp","cd-fip-map-detail-26.webp"]`
alt=`["FIP validity map overview for Czechia","FIP validity map detail for Czechia"]`
caption=`["[Overview FIP validity map (full view)](/en/operator/cd/cd-fip-map-overview-26.webp) for Czechia (© Petr Duda)","[Detailed FIP validity map (full view)](/en/operator/cd/cd-fip-map-detail-26.webp) for Czechia (© Petr Duda)"]`
width="100%"
position="left">}}
{{< /float-image >}}

### ČD Commercial Services (Surcharge Required)

On so-called _commercial_ services operated by ČD, a surcharge must be purchased. These usually include only certain trains in the `SC`, `EC`, `IC`, and `R` categories. [^3]

The [FIP validity maps for Czechia](#validity-of-fip-tickets) can be used as a guide.
The [FIP validity maps for Czechia](#special-tariff-conditions) can be used as a guide.

Affected services in detail:

Expand Down Expand Up @@ -532,7 +523,7 @@ In principle, FIP is not valid on any ČD trains that operate under public tende

For services contracted by regional authorities (trains in the `SP` and `OS` categories), FIP is not valid at all in some regions.

The [FIP validity map for Czechia](#validity-of-fip-tickets) can be used as a guide.
The [FIP validity map for Czechia](#special-tariff-conditions) can be used as a guide.

Affected regions in detail:

Expand Down
43 changes: 17 additions & 26 deletions content/operator/cd/index.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,11 @@ aliases:

Les Coupons FIP et les Billets FIP 50 sont valables sur les services ČD. Pour les trajets transfrontaliers, un Billet FIP 50 continu ou des Coupons FIP valables dans chaque pays sont nécessaires.

{{< highlight important >}}

{{< float-image
src="cd-fip-map-overview-26.webp"
alt="Carte de validité FIP vue d’ensemble pour la Tchéquie"
caption="[Carte de validité FIP vue d’ensemble](/en/operator/cd/cd-fip-map-overview-26.webp) pour la Tchéquie (© Petr Duda)"
width="40%"
position="left" >}}

{{% highlight important %}}
Sur certaines lignes et dans certaines régions, les avantages FIP ne sont pas valables, même si les trains sont exploités par ČD. Certaines lignes nécessitent également un supplément.

Pour un premier aperçu, la carte de validité FIP pour la Tchéquie peut être consultée.
{{< /float-image >}}

{{< float-image
src="cd-fip-map-detail-26.webp"
alt="Carte de validité FIP détaillée pour la Tchéquie"
caption="[Carte de validité FIP détaillée](/en/operator/cd/cd-fip-map-detail-26.webp) pour la Tchéquie (© Petr Duda)"
width="40%"
position="left" >}}
Pour des informations détaillées, la carte détaillée de validité FIP peut être consultée.

Plus d’informations : [Services ČD sans FIP](#services-čd-sans-fip) et [Liaisons commerciales ČD (supplément obligatoire)](#liaisons-commerciales-čd-supplément-obligatoire)
{{< /float-image >}}

{{< /highlight >}}
Plus d’informations dans les [Conditions tarifaires spéciales](#conditions-tarifaires-spéciales) sur cette page.
{{% /highlight %}}

## Catégories de trains et réservations

Expand Down Expand Up @@ -278,11 +257,23 @@ Pour les billets ordinaires, les enfants jusqu’à 6 ans voyagent gratuitement

## Conditions tarifaires spéciales

Sur certaines lignes et dans certaines régions, les avantages FIP ne sont pas valables, même si les trains sont exploités par ČD. Certaines lignes nécessitent également un supplément.

Pour un aperçu de la validité, la carte de vue d’ensemble peut être consultée ici. Des informations plus détaillées sont disponibles dans la carte détaillée et les règles spécifiques dans les sections suivantes sur les [Liaisons commerciales ČD (supplément obligatoire)](#liaisons-commerciales-čd-supplément-obligatoire) et les [Services ČD sans FIP](#services-čd-sans-fip).

{{< float-image
src=`["cd-fip-map-overview-26.webp","cd-fip-map-detail-26.webp"]`
alt=`["Carte de validité FIP vue d’ensemble pour la Tchéquie","Carte de validité FIP détaillée pour la Tchéquie"]`
caption=`["[Carte de validité FIP vue d’ensemble (vue complète)](/en/operator/cd/cd-fip-map-overview-26.webp) pour la Tchéquie (© Petr Duda)","[Carte de validité FIP détaillée (vue complète)](/en/operator/cd/cd-fip-map-detail-26.webp) pour la Tchéquie (© Petr Duda)"]`
width="100%"
position="left">}}
{{< /float-image >}}

### Liaisons commerciales ČD (supplément obligatoire)

Sur les liaisons dites _commerciales_ de ČD, un supplément doit être acheté. Cela concerne généralement uniquement certains trains des catégories `SC`, `EC`, `IC` et `R`. [^3]

Les [cartes de validité FIP pour la Tchéquie](#validité-des-billets-fip) peuvent servir d’orientation.
Les [cartes de validité FIP pour la Tchéquie](#conditions-tarifaires-spéciales) peuvent servir d’orientation.

Liaisons concernées en détail :

Expand Down Expand Up @@ -532,7 +523,7 @@ En principe, le FIP n’est pas valable dans les trains ČD exploités dans le c

Pour les services attribués par des collectivités régionales (trains des catégories `SP` et `OS`), le FIP n’est pas du tout valable dans certaines régions.

La [carte de validité FIP pour la Tchéquie](#validité-des-billets-fip) peut servir d’orientation.
La [carte de validité FIP pour la Tchéquie](#conditions-tarifaires-spéciales) peut servir d’orientation.

Régions concernées en détail :

Expand Down
24 changes: 24 additions & 0 deletions layouts/partials/parse-list-param.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- $raw := strings.TrimSpace (. | default "") -}}
{{- $items := slice -}}
{{- if and (hasPrefix $raw "[") (hasSuffix $raw "]") -}}
{{- $listRaw := strings.TrimSpace (strings.TrimSuffix "]" (strings.TrimPrefix "[" $raw)) -}}
{{- if $listRaw -}}
{{- range split $listRaw "," -}}
{{- $itemRaw := strings.TrimSpace . -}}
{{- $item := $itemRaw -}}
{{- if and (hasPrefix $itemRaw "\"") (hasSuffix $itemRaw "\"") -}}
{{- $item = strings.TrimSpace (strings.TrimSuffix "\"" (strings.TrimPrefix "\"" $itemRaw)) -}}
{{- else if or (hasPrefix $itemRaw "\"") (hasSuffix $itemRaw "\"") -}}
{{- errorf "float-image: invalid quoted list item %q" $itemRaw -}}
{{- end -}}
{{- if $item -}}
{{- $items = $items | append $item -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- else if or (hasPrefix $raw "[") (hasSuffix $raw "]") -}}
{{- errorf "float-image: list parameters must use [\"value1\",\"value2\"] syntax" -}}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dieser Error löst aus, wenn man ein einzelnes Bild als float-image nutzt und einen Link in der Caption nutzt (hat eine eckige Klammer)

{{- else if $raw -}}
{{- $items = $items | append $raw -}}
{{- end -}}
{{- return $items -}}
76 changes: 63 additions & 13 deletions layouts/shortcodes/float-image.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,70 @@
{{- $image := $.Page.Resources.GetMatch (.Get "src") -}}
{{- $alt := .Get "alt" -}}
{{- $caption := .Get "caption" -}}
{{- $srcItems := partial "parse-list-param.html" (.Get "src" | default "") -}}
{{- $altItems := partial "parse-list-param.html" (.Get "alt" | default "") -}}
{{- $captionItems := partial "parse-list-param.html" (.Get "caption" | default "") -}}
{{- $width := .Get "width" | default "50%" -}}
{{- $position := .Get "position" | default "right" -}}

{{- if eq (len $srcItems) 0 -}}
{{- errorf "float-image: no valid src provided in %s" $.Page.File.Path -}}
{{- end -}}

<div class="m-float-image m-float-image--{{ $position }}">
{{- partial "image"
(dict
"image" $image
"alt" $alt
"caption" ($caption | $.Page.RenderString)
"width" $width
"Page" .Page
)
-}}
{{- $images := slice -}}
{{- range $srcItems -}}
{{- $image := $.Page.Resources.GetMatch . -}}
{{- if not $image -}}
{{- errorf "float-image: image %q not found in %s" . $.Page.File.Path -}}
{{- end -}}
{{- $images = $images | append $image -}}
{{- end -}}


<div
class="m-float-image m-float-image--{{ $position }}"
style="--float-image-width: {{ $width }}"
>
{{- if gt (len $images) 1 -}}
<div class="m-float-image__images">
{{- range $index, $image := $images -}}
{{- $currentAlt := "" -}}
{{- if gt (len $altItems) $index -}}
{{- $currentAlt = index $altItems $index -}}
{{- end -}}

{{- $currentCaption := "" -}}
{{- if gt (len $captionItems) $index -}}
{{- $currentCaption = index $captionItems $index | $.Page.RenderString -}}
{{- end -}}

{{- partial "image"
(dict
"image" $image
"alt" $currentAlt
"caption" $currentCaption
"width" "100%"
"Page" $.Page
)
-}}
{{- end -}}
</div>
{{- else -}}
{{- $singleAlt := "" -}}
{{- if gt (len $altItems) 0 -}}
{{- $singleAlt = index $altItems 0 -}}
{{- end -}}
{{- $singleCaption := "" -}}
{{- if gt (len $captionItems) 0 -}}
{{- $singleCaption = index $captionItems 0 | $.Page.RenderString -}}
{{- end -}}
{{- partial "image"
(dict
"image" (index $images 0)
"alt" $singleAlt
"caption" $singleCaption
"width" $width
"Page" .Page
)
-}}
{{- end -}}
<div class="m-float-image__content">
{{- .Inner | $.Page.RenderString -}}
</div>
Expand Down
Loading