diff --git a/assets/js/anchorlinks.js b/assets/js/anchorlinks.js index 6cce91868..2b587cdc9 100644 --- a/assets/js/anchorlinks.js +++ b/assets/js/anchorlinks.js @@ -1,5 +1,7 @@ function initAnchorlinkEventListener() { - const anchorLinks = document.querySelectorAll(".a-anchorlink__link"); + const anchorLinks = document.querySelectorAll( + ".a-anchorlink__link, .a-anchorlink__button", + ); const snackbar = document.getElementById("snackbar"); const snackbarButton = document.getElementById("snackbar-button"); @@ -38,12 +40,18 @@ function closeSnackbar() { } if (document.readyState === "interactive") { - if (document.querySelectorAll(".a-anchorlink__link").length) { + if ( + document.querySelectorAll(".a-anchorlink__link, .a-anchorlink__button") + .length + ) { initAnchorlinkEventListener(); } } else { window.addEventListener("DOMContentLoaded", () => { - if (document.querySelectorAll(".a-anchorlink__link").length) { + if ( + document.querySelectorAll(".a-anchorlink__link, .a-anchorlink__button") + .length + ) { initAnchorlinkEventListener(); } }); diff --git a/assets/sass/anchorlink.scss b/assets/sass/anchorlink.scss index d2d2eca97..887457f9a 100644 --- a/assets/sass/anchorlink.scss +++ b/assets/sass/anchorlink.scss @@ -70,6 +70,12 @@ } } +.a-anchorlink__button { + @media print { + display: none; + } +} + .a-snackbar { position: fixed; bottom: 0; diff --git a/assets/sass/booking.scss b/assets/sass/booking.scss index 25ef3ff65..9e2f91cbd 100644 --- a/assets/sass/booking.scss +++ b/assets/sass/booking.scss @@ -61,6 +61,10 @@ gap: 0.6rem; margin-top: 0.4rem; + &:empty { + margin-top: 0; + } + @media (max-width: #{$breakpoint-md}) { &:empty { display: none; @@ -86,18 +90,24 @@ } } -@mixin booking_section($name) { - &-#{$name}--hidden &-#{$name} { - display: none; - } +.o-booking__info { + margin-bottom: 1.5rem; } -.o-booking__section { - @include booking_section("fip_50"); - @include booking_section("fip_global_fare"); - @include booking_section("reservations"); +.o-booking__sections > .o-booking__section:not(:first-child) { + margin-top: 1rem; } -.o-booking__info { - margin-bottom: 1.5rem; +.o-booking__content { + h4 { + @extend %h3; + } + + h5 { + @extend %h4; + } + + h6 { + @extend %h5; + } } diff --git a/assets/sass/button.scss b/assets/sass/button.scss index 1512acadd..f5ef4318b 100644 --- a/assets/sass/button.scss +++ b/assets/sass/button.scss @@ -13,6 +13,7 @@ background: transparent; color: var(--body-color); width: fit-content; + border: 0.2rem solid var(--link-default); &:hover, &:focus { @@ -26,10 +27,6 @@ display: block; } - &__external { - border: 0.2rem solid var(--link-default); - } - &__internal { border: none; } diff --git a/assets/sass/form.scss b/assets/sass/form.scss index 04806433d..a93658a19 100644 --- a/assets/sass/form.scss +++ b/assets/sass/form.scss @@ -33,10 +33,6 @@ select { height: 5.5rem; } - - .a-button { - border: 0.2rem solid var(--link-default); - } } #success { diff --git a/assets/sass/headings.scss b/assets/sass/headings.scss index 8d77d7817..92db1fa0d 100644 --- a/assets/sass/headings.scss +++ b/assets/sass/headings.scss @@ -1,4 +1,4 @@ -h1 { +%h1 { font-size: 3rem; line-height: 1.25; margin-bottom: 2rem; @@ -8,7 +8,7 @@ h1 { break-after: avoid; } -h2 { +%h2 { font-size: 2.2rem; line-height: 1.25; margin-bottom: 1rem; @@ -18,7 +18,7 @@ h2 { break-after: avoid; } -h3 { +%h3 { font-size: 2rem; line-height: 1.25; margin-bottom: 1rem; @@ -28,7 +28,7 @@ h3 { break-after: avoid; } -h4 { +%h4 { font-size: 1.8rem; line-height: 1.25; margin-bottom: 1rem; @@ -38,7 +38,7 @@ h4 { break-after: avoid; } -h5 { +%h5 { font-size: 1.6rem; line-height: 1.25; margin-bottom: 1rem; @@ -48,7 +48,7 @@ h5 { break-after: avoid; } -h6 { +%h6 { font-size: 1.4rem; line-height: 1.25; margin-bottom: 1rem; @@ -57,3 +57,27 @@ h6 { text-wrap: balance; break-after: avoid; } + +h1 { + @extend %h1; +} + +h2 { + @extend %h2; +} + +h3 { + @extend %h3; +} + +h4 { + @extend %h4; +} + +h5 { + @extend %h5; +} + +h6 { + @extend %h6; +} diff --git a/assets/sass/trainCategory.scss b/assets/sass/trainCategory.scss index d6b5ed183..326dc2497 100644 --- a/assets/sass/trainCategory.scss +++ b/assets/sass/trainCategory.scss @@ -37,14 +37,14 @@ details.o-expander--train-category:not([open]) { .o-train-category__content { h4 { - @extend h3; + @extend %h3; } h5 { - @extend h4; + @extend %h4; } h6 { - @extend h5; + @extend %h5; } } diff --git a/content/booking/ffestiniogtravel-email/index.de.md b/content/booking/ffestiniogtravel-email/index.de.md index 1ac726ca3..699660a87 100644 --- a/content/booking/ffestiniogtravel-email/index.de.md +++ b/content/booking/ffestiniogtravel-email/index.de.md @@ -9,7 +9,7 @@ params: type: "email" --- -Ffestiniog Travel hat direkten Zugriff auf die Buchungssysteme vieler Bahnbetreiber und kann Tickets für viele Züge in Europa anbieten. +Ffestiniog Travel hat direkten Zugriff auf die Buchungssysteme vieler Bahnbetreiber und kann Tickets für viele Züge in Europa anbieten.[^1] Ausnahmen sind Frankreich (SNCF) und Norwegen (Vy Group). Auf Anfrage erstellen die Mitarbeitenden das passende Angebot für die Reise: @@ -26,6 +26,4 @@ Auf Anfrage erstellen die Mitarbeitenden das passende Angebot für die Reise: {{% /booking-section %}} -## Quellen - -[Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) +[^1]: [Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) diff --git a/content/booking/ffestiniogtravel-email/index.en.md b/content/booking/ffestiniogtravel-email/index.en.md index 09fae29ee..fc62c9750 100644 --- a/content/booking/ffestiniogtravel-email/index.en.md +++ b/content/booking/ffestiniogtravel-email/index.en.md @@ -9,7 +9,7 @@ params: type: "email" --- -Ffestiniog Travel has direct access to the booking systems of many railway operators and can offer tickets for many trains in Europe. +Ffestiniog Travel has direct access to the booking systems of many railway operators and can offer tickets for many trains in Europe.[^1] Exceptions are France (SNCF) and Norway (Vy Group). On request, staff create a suitable offer for the journey: @@ -26,6 +26,4 @@ Eurostar tickets can be purchased via Ffestiniog Travel. A booking fee of £5 ap {{% /booking-section %}} -## Sources - -[Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) +[^1]: [Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) diff --git a/content/booking/ffestiniogtravel-email/index.fr.md b/content/booking/ffestiniogtravel-email/index.fr.md index 26e59deda..087ef4eb2 100644 --- a/content/booking/ffestiniogtravel-email/index.fr.md +++ b/content/booking/ffestiniogtravel-email/index.fr.md @@ -9,7 +9,7 @@ params: type: "email" --- -Ffestiniog Travel a un accès direct aux systèmes de réservation de nombreux opérateurs ferroviaires et peut proposer des billets pour de nombreux trains en Europe. +Ffestiniog Travel a un accès direct aux systèmes de réservation de nombreux opérateurs ferroviaires et peut proposer des billets pour de nombreux trains en Europe.[^1] Les exceptions sont la France (SNCF) et la Norvège (Vy Group). Sur demande, le personnel établit l'offre adaptée au voyage : @@ -26,6 +26,4 @@ Des billets Eurostar peuvent être achetés via Ffestiniog Travel. Des frais de {{% /booking-section %}} -## Sources - -[Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) +[^1]: [Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) diff --git a/content/booking/ffestiniogtravel-phone/index.de.md b/content/booking/ffestiniogtravel-phone/index.de.md index a4c450f9a..b9f1064c0 100644 --- a/content/booking/ffestiniogtravel-phone/index.de.md +++ b/content/booking/ffestiniogtravel-phone/index.de.md @@ -9,7 +9,7 @@ params: type: "phone" --- -Ffestiniog Travel hat direkten Zugriff auf die Buchungssysteme vieler Bahnbetreiber und kann Tickets für viele Züge in Europa anbieten. +Ffestiniog Travel hat direkten Zugriff auf die Buchungssysteme vieler Bahnbetreiber und kann Tickets für viele Züge in Europa anbieten.[^1] Ausnahmen sind Frankreich (SNCF) und Norwegen (Vy Group). Auf Anfrage erstellen die Mitarbeitenden das passende Angebot für die Reise: [+44 (0)1766 515630](tel:+441766515630) @@ -30,6 +30,4 @@ Um Tickets telefonisch buchen zu können, muss initial ein Foto des FIP-Ausweise {{% satellite /%}} -## Quellen - -[Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) +[^1]: [Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) diff --git a/content/booking/ffestiniogtravel-phone/index.en.md b/content/booking/ffestiniogtravel-phone/index.en.md index c9709aab9..d6d68e9bf 100644 --- a/content/booking/ffestiniogtravel-phone/index.en.md +++ b/content/booking/ffestiniogtravel-phone/index.en.md @@ -9,7 +9,7 @@ params: type: "phone" --- -Ffestiniog Travel has direct access to the booking systems of many railway operators and can offer tickets for many trains in Europe. +Ffestiniog Travel has direct access to the booking systems of many railway operators and can offer tickets for many trains in Europe.[^1] Exceptions are France (SNCF) and Norway (Vy Group). On request, staff create a suitable offer for the journey: [+44 (0)1766 515630](tel:+441766515630) @@ -30,6 +30,4 @@ FIP Global Fare tickets for Eurostar can be purchased via the Ffestiniog Travel {{% satellite /%}} -## Sources - -[Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) +[^1]: [Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) diff --git a/content/booking/ffestiniogtravel-phone/index.fr.md b/content/booking/ffestiniogtravel-phone/index.fr.md index e12297cee..66f859f97 100644 --- a/content/booking/ffestiniogtravel-phone/index.fr.md +++ b/content/booking/ffestiniogtravel-phone/index.fr.md @@ -9,7 +9,7 @@ params: type: "phone" --- -Ffestiniog Travel a un accès direct aux systèmes de réservation de nombreux opérateurs ferroviaires et peut proposer des billets pour de nombreux trains en Europe. +Ffestiniog Travel a un accès direct aux systèmes de réservation de nombreux opérateurs ferroviaires et peut proposer des billets pour de nombreux trains en Europe.[^1] Les exceptions sont la France (SNCF) et la Norvège (Vy Group). Sur demande, le personnel établit l'offre adaptée au voyage : [+44 (0)1766 515630](tel:+441766515630) @@ -28,6 +28,4 @@ Des billets au Tarif Global FIP pour Eurostar peuvent être achetés via la hotl {{% satellite /%}} -## Sources - -[Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) +[^1]: [Feedback: FIP reduced Ticket booking](https://github.com/fipguide/fipguide.github.io/issues/710) diff --git a/content/booking/kw-ticket-machine/index.de.md b/content/booking/kw-ticket-machine/index.de.md index 4a49ee374..7ad7cced7 100644 --- a/content/booking/kw-ticket-machine/index.de.md +++ b/content/booking/kw-ticket-machine/index.de.md @@ -17,8 +17,6 @@ An einigen Bahnhöfen gibt es Koleje Wielkopolskie Fahrkartenautomaten. Zudem si An den Fahrkartenautomaten können ermäßigte FIP 50 Fahrkarten erworben werden. Dafür muss der Rabatt “UMOWA (ulga 50%)” angegeben werden. [^1] -## Quellen +{{% /booking-section %}} [^1]: [PKP FIP Information](https://www.intercity.pl/en/site/for-passengers/buy-a-ticket/where-to-buy-the-ticket/przejazdy-z-fip-en.html) - -{{% /booking-section %}} diff --git a/content/booking/kw-ticket-machine/index.en.md b/content/booking/kw-ticket-machine/index.en.md index 34503ed59..e16488198 100644 --- a/content/booking/kw-ticket-machine/index.en.md +++ b/content/booking/kw-ticket-machine/index.en.md @@ -17,8 +17,6 @@ At some stations, Koleje Wielkopolskie ticket machines are available. Additional Discounted FIP 50 Tickets can be purchased at the ticket machines. The discount "UMOWA (ulga 50%)" must be selected. [^1] -## Sources +{{% /booking-section %}} [^1]: [PKP FIP information](https://www.intercity.pl/en/site/for-passengers/buy-a-ticket/where-to-buy-the-ticket/przejazdy-z-fip-en.html) - -{{% /booking-section %}} diff --git a/content/booking/kw-ticket-machine/index.fr.md b/content/booking/kw-ticket-machine/index.fr.md index 43a43f40c..902955368 100644 --- a/content/booking/kw-ticket-machine/index.fr.md +++ b/content/booking/kw-ticket-machine/index.fr.md @@ -17,8 +17,6 @@ Dans certaines gares, des distributeurs de billets Koleje Wielkopolskie sont dis Des Billets FIP 50 à tarif réduit peuvent être achetés aux distributeurs de billets. La réduction « UMOWA (ulga 50%) » doit être sélectionnée. [^1] -## Sources +{{% /booking-section %}} [^1]: [PKP FIP information](https://www.intercity.pl/en/site/for-passengers/buy-a-ticket/where-to-buy-the-ticket/przejazdy-z-fip-en.html) - -{{% /booking-section %}} diff --git a/content/booking/kw-website/index.de.md b/content/booking/kw-website/index.de.md index 9bd432bbb..e3c559245 100644 --- a/content/booking/kw-website/index.de.md +++ b/content/booking/kw-website/index.de.md @@ -17,8 +17,6 @@ Auf der Website der Koleje Wielkopolskie, die nur auf Polnisch verfügbar ist, k ![KW Website FIP 50 Buchung](kw-fip50.webp) -## Quellen +{{% /booking-section %}} [^1]: [PKP FIP Information](https://www.intercity.pl/en/site/for-passengers/buy-a-ticket/where-to-buy-the-ticket/przejazdy-z-fip-en.html) - -{{% /booking-section %}} diff --git a/content/booking/kw-website/index.en.md b/content/booking/kw-website/index.en.md index 0d9ca7b5c..b56df3b7c 100644 --- a/content/booking/kw-website/index.en.md +++ b/content/booking/kw-website/index.en.md @@ -17,8 +17,6 @@ On the Koleje Wielkopolskie website, which is only available in Polish, tickets ![KW Website FIP 50 Booking](kw-fip50.webp) -## Sources +{{% /booking-section %}} [^1]: [PKP FIP information](https://www.intercity.pl/en/site/for-passengers/buy-a-ticket/where-to-buy-the-ticket/przejazdy-z-fip-en.html) - -{{% /booking-section %}} diff --git a/content/booking/kw-website/index.fr.md b/content/booking/kw-website/index.fr.md index 674c05680..b7cb144c5 100644 --- a/content/booking/kw-website/index.fr.md +++ b/content/booking/kw-website/index.fr.md @@ -17,8 +17,6 @@ Sur le site Web de Koleje Wielkopolskie, disponible uniquement en polonais, des ![Site Web KW Réservation FIP 50](kw-fip50.webp) -## Sources +{{% /booking-section %}} [^1]: [PKP FIP information](https://www.intercity.pl/en/site/for-passengers/buy-a-ticket/where-to-buy-the-ticket/przejazdy-z-fip-en.html) - -{{% /booking-section %}} diff --git a/content/booking/sbb-ticket-machine/index.de.md b/content/booking/sbb-ticket-machine/index.de.md index a4e782cc4..ed6085228 100644 --- a/content/booking/sbb-ticket-machine/index.de.md +++ b/content/booking/sbb-ticket-machine/index.de.md @@ -24,6 +24,4 @@ Unter anderem in städtischen Gebieten kann eine Fahrkarte mit Halbtax Rabatt au {{% /booking-section %}} -## Quellen - [^1]: [SBB Community](https://community.sbb.ch/d/2251-kann-man-als-fip-beg%C3%BCnstigter-tickets-weiterhin-online-mittels-halbtax-kaufen) diff --git a/content/booking/sbb-ticket-machine/index.en.md b/content/booking/sbb-ticket-machine/index.en.md index 0cc6ae6bd..4100cccc4 100644 --- a/content/booking/sbb-ticket-machine/index.en.md +++ b/content/booking/sbb-ticket-machine/index.en.md @@ -24,6 +24,4 @@ In urban areas, a ticket with Halbtax discount may also include transport operat {{% /booking-section %}} -## Sources - [^1]: [SBB Community](https://community.sbb.ch/d/2251-kann-man-als-fip-beg%C3%BCnstigter-tickets-weiterhin-online-mittels-halbtax-kaufen) diff --git a/content/booking/sbb-ticket-machine/index.fr.md b/content/booking/sbb-ticket-machine/index.fr.md index eb984ede8..e24c5970a 100644 --- a/content/booking/sbb-ticket-machine/index.fr.md +++ b/content/booking/sbb-ticket-machine/index.fr.md @@ -24,6 +24,4 @@ Dans les zones urbaines, un billet avec réduction demi-tarif peut inclure des t {{% /booking-section %}} -## Sources - [^1]: [SBB Community](https://community.sbb.ch/d/2251-kann-man-als-fip-beg%C3%BCnstigter-tickets-weiterhin-online-mittels-halbtax-kaufen) diff --git a/content/booking/sbb-website/index.de.md b/content/booking/sbb-website/index.de.md index b92ca1f73..88bd364d7 100644 --- a/content/booking/sbb-website/index.de.md +++ b/content/booking/sbb-website/index.de.md @@ -38,6 +38,4 @@ Einzelne nationale Reservierungen können bei der SBB online erworben werden. Da ![SBB Reservierung buchen](sbb_reservation.webp) {{% /booking-section %}} -## Quellen - [^1]: [SBB Community](https://community.sbb.ch/d/2251-kann-man-als-fip-beg%C3%BCnstigter-tickets-weiterhin-online-mittels-halbtax-kaufen) diff --git a/content/booking/sbb-website/index.en.md b/content/booking/sbb-website/index.en.md index f0a5c1993..b318b286b 100644 --- a/content/booking/sbb-website/index.en.md +++ b/content/booking/sbb-website/index.en.md @@ -38,6 +38,4 @@ Individual national reservations can be purchased online at SBB. To do so, searc ![Book SBB reservation](sbb_reservation.webp) {{% /booking-section %}} -## Sources - [^1]: [SBB Community](https://community.sbb.ch/d/2251-kann-man-als-fip-beg%C3%BCnstigter-tickets-weiterhin-online-mittels-halbtax-kaufen) diff --git a/content/booking/sbb-website/index.fr.md b/content/booking/sbb-website/index.fr.md index d4b353854..3ed688157 100644 --- a/content/booking/sbb-website/index.fr.md +++ b/content/booking/sbb-website/index.fr.md @@ -38,6 +38,4 @@ Des réservations individuelles pour des trajets nationaux peuvent être acheté ![Réserver une place CFF](sbb_reservation.webp) {{% /booking-section %}} -## Sources - [^1]: [Communauté CFF](https://community.sbb.ch/d/2251-kann-man-als-fip-beg%C3%BCnstigter-tickets-weiterhin-online-mittels-halbtax-kaufen) diff --git a/content/booking/stena-line-bv-ticket-office/index.de.md b/content/booking/stena-line-bv-ticket-office/index.de.md index b870558ed..8eef75af4 100644 --- a/content/booking/stena-line-bv-ticket-office/index.de.md +++ b/content/booking/stena-line-bv-ticket-office/index.de.md @@ -26,8 +26,6 @@ Kabinenreservierungen sind erhältlich und bei Übernachtfahrten obligatorisch. {{% /booking-section %}} -## Quellen - [^1]: [E-Mail-Anfrage des FIP Guide Teams bei Stena Line](https://github.com/fipguide/fipguide.github.io/issues/528) [^2]: [FIP Guide Community - Feedback](https://discord.com/channels/1250522473188032512/1433789686039707688/1491886477347651764) diff --git a/content/booking/stena-line-bv-ticket-office/index.en.md b/content/booking/stena-line-bv-ticket-office/index.en.md index be943081a..72c5039d9 100644 --- a/content/booking/stena-line-bv-ticket-office/index.en.md +++ b/content/booking/stena-line-bv-ticket-office/index.en.md @@ -26,8 +26,6 @@ Cabin reservations are available and mandatory for overnight journeys. {{% /booking-section %}} -## Sources - [^1]: [FIP Guide Team email inquiry to Stena Line](https://github.com/fipguide/fipguide.github.io/issues/528) [^2]: [FIP Guide Community - Feedback](https://discord.com/channels/1250522473188032512/1433789686039707688/1491886477347651764) diff --git a/content/booking/stena-line-bv-ticket-office/index.fr.md b/content/booking/stena-line-bv-ticket-office/index.fr.md index c58dc95f8..9ec9d15ed 100644 --- a/content/booking/stena-line-bv-ticket-office/index.fr.md +++ b/content/booking/stena-line-bv-ticket-office/index.fr.md @@ -26,8 +26,6 @@ Les réservations de cabine sont disponibles et obligatoires pour les trajets de {{% /booking-section %}} -## Sources - [^1]: [Demande par e-mail de l’équipe FIP Guide à Stena Line](https://github.com/fipguide/fipguide.github.io/issues/528) [^2]: [Communauté FIP Guide - Retour d'information](https://discord.com/channels/1250522473188032512/1433789686039707688/1491886477347651764) diff --git a/content/booking/stena-line-limited-email/index.de.md b/content/booking/stena-line-limited-email/index.de.md index 7d870f9d5..ac58a1ff2 100644 --- a/content/booking/stena-line-limited-email/index.de.md +++ b/content/booking/stena-line-limited-email/index.de.md @@ -29,6 +29,4 @@ FIP 50 Tickets können gebucht werden. {{% /booking-section %}} -## Quellen - [^1]: [FIP Guide Community - Feedback](https://discord.com/channels/1250522473188032512/1433789686039707688/1481942947917467669) diff --git a/content/booking/stena-line-limited-email/index.en.md b/content/booking/stena-line-limited-email/index.en.md index ef934d339..81ad161f5 100644 --- a/content/booking/stena-line-limited-email/index.en.md +++ b/content/booking/stena-line-limited-email/index.en.md @@ -29,6 +29,4 @@ FIP 50 Tickets can be booked. {{% /booking-section %}} -## Sources - [^1]: [FIP Guide Community - Feedback](https://discord.com/channels/1250522473188032512/1433789686039707688/1481942947917467669) diff --git a/content/booking/stena-line-limited-email/index.fr.md b/content/booking/stena-line-limited-email/index.fr.md index 9e3bec7cd..9802a0207 100644 --- a/content/booking/stena-line-limited-email/index.fr.md +++ b/content/booking/stena-line-limited-email/index.fr.md @@ -29,6 +29,4 @@ Les billets FIP 50 peuvent être réservés. {{% /booking-section %}} -## Sources - [^1]: [Communauté FIP Guide - Retour d'information](https://discord.com/channels/1250522473188032512/1433789686039707688/1481942947917467669) diff --git a/hugo.yaml b/hugo.yaml index 60a0abe28..0867f9e35 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -1,5 +1,6 @@ enableRobotsTXT: true enableGitInfo: true +ignoreLogs: ['warning-rendershortcodes-in-html'] defaultContentLanguage: "en" defaultContentLanguageInSubdir: true diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 000000000..928525ac4 --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1,20 @@ +{{- $id := replaceRE `-[0-9]+$` "" .Anchor -}} +{{- with index .Attributes "prefix" -}} + {{- $id = print . ":" $id -}} +{{- end -}} +{{- $heading := print `` .Text `` -}} +{{- if eq .Level 2 -}} + {{- partial "intersector" -}} + + {{- $heading | safeHTML -}} + + +{{- else -}} + {{- $heading | safeHTML -}} +{{- end -}} diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index b117d9de4..cdf2db95a 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,7 +1,15 @@ +{{- $page := .Page -}} +{{- with .Attributes.page -}} + {{- with site.GetPage . -}} + {{- $page = . -}} + {{- end -}} +{{- end -}} + + {{- $image := "" -}} -{{- with $.Page.Resources.Get .Destination -}} +{{- with $page.Resources.Get .Destination -}} {{- $image = . -}} {{- else -}} @@ -11,7 +19,7 @@ {{- end -}} {{- if $image -}} - {{- partial "image" (dict "image" $image "caption" .Text "Page" .Page) -}} + {{- partial "image" (dict "image" $image "caption" .Text) -}} {{- else -}} - {{- warnf "Image resource '%s' could not be found. Used in '%s'" .Destination $.Page.File.Path -}} + {{- warnf "Image resource '%s' could not be found. Used in '%s'" .Destination $page.File.Path -}} {{- end -}} diff --git a/layouts/booking/list.html b/layouts/booking/list.html deleted file mode 100644 index 7743b143e..000000000 --- a/layouts/booking/list.html +++ /dev/null @@ -1,20 +0,0 @@ -{{ define "main" }} -
-

{{ .Title }}

- {{ .Content }} - -
-{{ end }} diff --git a/layouts/booking/single.html b/layouts/booking/single.html deleted file mode 100644 index c1fe1ed90..000000000 --- a/layouts/booking/single.html +++ /dev/null @@ -1,27 +0,0 @@ -{{ define "main" }} -
- -
-
-

{{ .Title }}

-
- -
- {{ .Content }} -
- - {{ partial "booking-links" . }} -
-
-{{ end }} diff --git a/layouts/partials/anchorlink-button.html b/layouts/partials/anchorlink-button.html new file mode 100644 index 000000000..3f72caa32 --- /dev/null +++ b/layouts/partials/anchorlink-button.html @@ -0,0 +1,7 @@ + diff --git a/layouts/partials/booking-links.html b/layouts/partials/booking-links.html deleted file mode 100644 index 035601326..000000000 --- a/layouts/partials/booking-links.html +++ /dev/null @@ -1,20 +0,0 @@ -{{- if or .Params.booking_link .Params.additional_info_link -}} - -{{- end -}} diff --git a/layouts/partials/booking.html b/layouts/partials/booking/booking.html similarity index 66% rename from layouts/partials/booking.html rename to layouts/partials/booking/booking.html index 0d65c9acb..290e607b0 100644 --- a/layouts/partials/booking.html +++ b/layouts/partials/booking/booking.html @@ -1,8 +1,11 @@ {{- $iconMapping := dict "website" "computer" "phone" "call" "onsite" "person" "email" "mail" "machine" "confirmation_number" "socialmedia" "add_reaction" -}} +
-
+
{{- partial "icon" (index $iconMapping .page.Params.type) -}} {{- .page.Title -}}
@@ -11,7 +14,7 @@ {{- .subtitle -}}
{{- end }} -
+
{{- $metaFields := slice (dict "key" "reservations" "value" .reservations "label" "booking.reservation") (dict "key" "fip_50" "value" .fip_50 "label" "booking.fip-50") @@ -33,7 +36,7 @@
{{- if and (ne .reservations "nil") (ne .reservations false) .classes -}} -
+
{{ T "booking.reservation-costs" }}: @@ -48,28 +51,19 @@ {{- partial "icon" "keyboard_arrow_down" -}}
-
+
{{- if .info -}}
{{- .info | .original_page.RenderString -}}
{{- end -}} - {{- $contentClasses := slice "o-single__content" "o-booking__section" -}} - {{- if or (eq .fip_50 false) (eq .fip_50 "nil") }} - {{- $contentClasses = $contentClasses | append "o-booking__section-fip_50--hidden" -}} - {{- end -}} - {{- if or (eq .fip_global_fare false) (eq .fip_global_fare "nil") }} - {{- $contentClasses = $contentClasses | append "o-booking__section-fip_global_fare--hidden" -}} - {{- end -}} - {{- if or (eq .reservations false) (eq .reservations "nil") }} - {{- $contentClasses = $contentClasses | append "o-booking__section-reservations--hidden" -}} - {{- end -}} -
- {{- $content := partial "increase-headings" (dict "content" .page.Content "offset" 2) -}} - {{- $content := partial "prefix-footnotes" (dict "content" $content "prefix" .page.File.ContentBaseName) -}} - {{- $content := partial "prefix-heading-ids" (dict "content" $content "prefix" .page.File.ContentBaseName) -}} +
+ {{- $content := .page.RenderShortcodes -}} + {{- $content = partial "transformations/increase-headings" (dict "content" $content "offset" 3) -}} + {{- $content = partial "transformations/transform-expander-headings" (dict "content" $content "id" .id) -}} + {{- $content = partial "transformations/prefix-footnotes" (dict "content" $content "id" .id) -}} + {{- $content = partial "transformations/resolve-images" (dict "content" $content "page" .page) -}} {{- $content | safeHTML -}}
- - {{ partial "booking-links" .page }} + {{ partial "booking/links" (dict "page" .page "id" .id) }}
diff --git a/layouts/partials/booking/links.html b/layouts/partials/booking/links.html new file mode 100644 index 000000000..3047425d9 --- /dev/null +++ b/layouts/partials/booking/links.html @@ -0,0 +1,19 @@ + diff --git a/layouts/partials/content.html b/layouts/partials/content.html index 3410495a8..0a2404a61 100644 --- a/layouts/partials/content.html +++ b/layouts/partials/content.html @@ -1,5 +1,5 @@ {{- with .Content -}} - {{ . | replaceRE "()" (print (partial "intersector") `${1}${3}`) + {{ . | replaceRE "
" "
" | replaceRE "z. B. " "z. B. " | replaceRE "FIP 50" "FIP 50" diff --git a/layouts/partials/dialog.html b/layouts/partials/dialog.html index 2ad259d59..128c3f364 100644 --- a/layouts/partials/dialog.html +++ b/layouts/partials/dialog.html @@ -9,7 +9,7 @@

{{ .Title }}

{{- partial "button" (dict "Text" (partial "icon" "close") "Title" (i18n "dialog.close")) -}}
- {{- partial "increase-headings" (dict "content" .Content) | safeHTML -}} + {{- .Content | safeHTML -}}
diff --git a/layouts/partials/increase-headings.html b/layouts/partials/increase-headings.html deleted file mode 100644 index a6478162c..000000000 --- a/layouts/partials/increase-headings.html +++ /dev/null @@ -1,10 +0,0 @@ -{{- $content := .content -}} -{{- $offset := .offset | default 1 -}} - -{{- range $level := (seq 4 1) -}} - {{- $newLevel := add $level $offset -}} - {{- $content = $content | replaceRE (printf `]*)?>` $level) (printf `` $newLevel) -}} - {{- $content = $content | replaceRE (printf `` $level) (printf `` $newLevel) -}} -{{- end -}} - -{{- return $content -}} diff --git a/layouts/partials/prefix-footnotes.html b/layouts/partials/prefix-footnotes.html deleted file mode 100644 index cd6cb9680..000000000 --- a/layouts/partials/prefix-footnotes.html +++ /dev/null @@ -1,7 +0,0 @@ -{{- $patternFnref := `fnref:(\d+)` -}} -{{- $replacementFnref := (printf "fnref:%s:$1" .prefix) -}} -{{- $patternFn := `fn:(\d+)` -}} -{{- $replacementFn := (printf "fn:%s:$1" .prefix) -}} -{{- $content := replaceRE $patternFnref $replacementFnref .content -}} -{{- $content := replaceRE $patternFn $replacementFn $content -}} -{{- return $content -}} diff --git a/layouts/partials/prefix-heading-ids.html b/layouts/partials/prefix-heading-ids.html deleted file mode 100644 index dfd751c4d..000000000 --- a/layouts/partials/prefix-heading-ids.html +++ /dev/null @@ -1,4 +0,0 @@ -{{- $pattern := `(]*?)id="([^"]+)"` -}} -{{- $replacement := (printf `${1}id="%s:$2"` .prefix) -}} -{{- $content := replaceRE $pattern $replacement .content -}} -{{- return $content -}} diff --git a/layouts/partials/train-category.html b/layouts/partials/train-category.html index 7eac14683..7c8aaa03a 100644 --- a/layouts/partials/train-category.html +++ b/layouts/partials/train-category.html @@ -3,7 +3,13 @@ name="train-category" id="{{ .id }}" > - + +
{{ $iconMapping := dict @@ -114,26 +120,27 @@
- {{ .content }} - {{- if or .route_overview_url .additional_information_url -}} -
- {{- if .route_overview_url -}} - {{- partial "button" - (dict - "Destination" .route_overview_url - "Text" (T "trainCategory.routeOverview") - ) - -}} - {{- end -}} - {{- if .additional_information_url -}} - {{- partial "button" - (dict - "Destination" .additional_information_url - "Text" (T "trainCategory.additionalInformation") - ) - -}} - {{- end -}} -
- {{- end -}} + {{- $content := partial "transformations/increase-headings" (dict "content" .content "offset" 1) -}} + {{- $content := partial "transformations/transform-expander-headings" (dict "content" $content "id" .id) -}} + {{- $content | safeHTML -}} +
+ {{- if .route_overview_url -}} + {{- partial "button" + (dict + "Destination" .route_overview_url + "Text" (T "trainCategory.routeOverview") + ) + -}} + {{- end -}} + {{- if .additional_information_url -}} + {{- partial "button" + (dict + "Destination" .additional_information_url + "Text" (T "trainCategory.additionalInformation") + ) + -}} + {{- end -}} + {{- partial "anchorlink-button" (dict "id" .id) -}} +
diff --git a/layouts/partials/transformations/increase-headings.html b/layouts/partials/transformations/increase-headings.html new file mode 100644 index 000000000..3198d37a5 --- /dev/null +++ b/layouts/partials/transformations/increase-headings.html @@ -0,0 +1,8 @@ +{{- $content := .content -}} +{{- $offset := .offset | default 1 -}} + +{{- range seq $offset -}} + {{- $content = replaceRE `(?m)^(\s{0,3})(#{1,5})(\s+)` `${1}#${2}${3}` $content -}} +{{- end -}} + +{{- return $content -}} diff --git a/layouts/partials/transformations/prefix-footnotes.html b/layouts/partials/transformations/prefix-footnotes.html new file mode 100644 index 000000000..1650150e5 --- /dev/null +++ b/layouts/partials/transformations/prefix-footnotes.html @@ -0,0 +1,8 @@ +{{- $content := .content -}} +{{- $id := .id -}} + +{{- if and $content $id -}} + {{- $content = replaceRE `\[\^([^\]]+)\]` (print "[^" $id ":${1}]") $content -}} +{{- end -}} + +{{- return $content -}} diff --git a/layouts/partials/transformations/resolve-images.html b/layouts/partials/transformations/resolve-images.html new file mode 100644 index 000000000..0cd4cd3e4 --- /dev/null +++ b/layouts/partials/transformations/resolve-images.html @@ -0,0 +1,4 @@ +{{- $content := .content -}} +{{- $sourcePagePath := print .page.Section "/" .page.File.ContentBaseName -}} +{{- $content = replaceRE `!\[([^\]]*)\]\(([^)]+)\)` (printf "![$1]($2)\n{page=\"%s\"}" $sourcePagePath) $content -}} +{{- return $content -}} diff --git a/layouts/partials/transformations/transform-expander-headings.html b/layouts/partials/transformations/transform-expander-headings.html new file mode 100644 index 000000000..75d6d1712 --- /dev/null +++ b/layouts/partials/transformations/transform-expander-headings.html @@ -0,0 +1,4 @@ +{{- $pattern := `(?m)^(#{1,6}\s+.+?)\s*$` -}} +{{- $replacement := print `${1} {prefix="` .id `", data-pagefind-ignore="all"}` -}} +{{- $content := replaceRE $pattern $replacement .content -}} +{{- return $content -}} diff --git a/layouts/shortcodes/booking-section.html b/layouts/shortcodes/booking-section.html index 9621e1810..b5b8ce337 100644 --- a/layouts/shortcodes/booking-section.html +++ b/layouts/shortcodes/booking-section.html @@ -1,3 +1,11 @@ -
- {{ .Inner }} +{{- $sectionName := .Get 0 -}} +{{- $bookingContext := .Page.Store.Get "booking_context" | default dict -}} +{{- $sectionValue := index $bookingContext $sectionName | default "nil" -}} +{{- if or (eq $sectionValue false) (eq $sectionValue "nil") -}} + {{- return -}} +{{- end -}} +
+ {{- .Inner | safeHTML -}}
diff --git a/layouts/shortcodes/booking.html b/layouts/shortcodes/booking.html index b1beee60d..b25faeb6f 100644 --- a/layouts/shortcodes/booking.html +++ b/layouts/shortcodes/booking.html @@ -1,4 +1,4 @@ -{{- $page := site.GetPage (print "booking/" (.Get "id")) -}} +{{- $page := .Page.GetPage (print "/booking/" (.Get "id")) -}} {{- $classes := ($page.Params.classes | default dict) -}} {{- range $k, $v := .Params }} {{- if (hasPrefix $k "classes.") }} @@ -10,6 +10,7 @@ {{- $classes = dict -}} {{- end }} {{- $params := dict + "id" (.Get "id") "page" $page "original_page" .Page "subtitle" (.Get "subtitle") @@ -21,8 +22,9 @@ "fee" ((.Get "fee" ) | default $page.Params.fee | default "nil") "classes" $classes -}} +{{- $page.Store.Set "booking_context" $params -}} -
- {{- partial "booking" $params -}} +
+ {{- partial "booking/booking" $params -}}