diff --git a/assets/sass/booking.scss b/assets/sass/booking.scss index 5889fd07..17840376 100644 --- a/assets/sass/booking.scss +++ b/assets/sass/booking.scss @@ -99,3 +99,17 @@ flex-direction: column; gap: 1rem; } + +.o-booking__content { + h4 { + @extend %h3; + } + + h5 { + @extend %h4; + } + + h6 { + @extend %h5; + } +} diff --git a/assets/sass/headings.scss b/assets/sass/headings.scss index 8d77d781..92db1fa0 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 d6b5ed18..326dc249 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/layouts/partials/booking/booking.html b/layouts/partials/booking/booking.html index e76b3622..c90a8e3e 100644 --- a/layouts/partials/booking/booking.html +++ b/layouts/partials/booking/booking.html @@ -1,4 +1,7 @@ {{- $iconMapping := dict "website" "computer" "phone" "call" "onsite" "person" "email" "mail" "machine" "confirmation_number" "socialmedia" "add_reaction" -}} +
@@ -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,7 +51,7 @@ {{- partial "icon" "keyboard_arrow_down" -}}
-
+
{{- if .info -}}
{{- .info | .original_page.RenderString -}} @@ -68,6 +71,7 @@ > {{- $sectionContent := index $section "content" -}} {{- $sectionFootnotePrefix := print $.page.File.ContentBaseName "-" $sectionName -}} + {{- $sectionContent := partial "pagefind-ignore-headings" (dict "content" $sectionContent) -}} {{- $sectionContent | safeHTML -}}
{{- end -}} diff --git a/layouts/partials/pagefind-ignore-headings.html b/layouts/partials/pagefind-ignore-headings.html new file mode 100644 index 00000000..cb6bd79f --- /dev/null +++ b/layouts/partials/pagefind-ignore-headings.html @@ -0,0 +1,4 @@ +{{- $pattern := `(?m)^(#{1,6}\s+.+?)\s*$` -}} +{{- $replacement := `${1} {data-pagefind-ignore="all"}` -}} +{{- $content := replaceRE $pattern $replacement .content -}} +{{- return $content -}} diff --git a/layouts/partials/train-category.html b/layouts/partials/train-category.html index 7eac1468..5355a4ec 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,9 +120,11 @@
- {{ .content }} + {{- $content := partial "increase-headings" (dict "content" .content "offset" 1) -}} + {{- $content := partial "pagefind-ignore-headings" (dict "content" $content) -}} + {{- $content | safeHTML -}} {{- if or .route_overview_url .additional_information_url -}} -
+
{{- if .route_overview_url -}} {{- partial "button" (dict diff --git a/layouts/shortcodes/booking-section.html b/layouts/shortcodes/booking-section.html index 938a2fad..1abd1d0f 100644 --- a/layouts/shortcodes/booking-section.html +++ b/layouts/shortcodes/booking-section.html @@ -1,6 +1,6 @@ {{- $content := .Inner -}} {{- $content = partial "helper/resolve-images" (dict "content" $content "page" .Page) -}} -{{- $content = partial "increase-headings" (dict "content" $content "offset" 2) -}} +{{- $content = partial "increase-headings" (dict "content" $content "offset" 3) -}} {{- $sectionName := .Get 0 -}} {{- $footnoteId := print .Page.File.ContentBaseName "-" $sectionName -}} {{- $content = partial "prefix-footnotes" (dict "content" $content "id" $footnoteId) -}} diff --git a/layouts/shortcodes/booking.html b/layouts/shortcodes/booking.html index ee142ba7..6aef21f7 100644 --- a/layouts/shortcodes/booking.html +++ b/layouts/shortcodes/booking.html @@ -23,6 +23,6 @@ -}} -
+
{{- partial "booking/booking" $params -}}