diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ab6f9b3..b1a01774 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,7 @@ repos: rev: v5.0.0 hooks: - id: check-added-large-files + args: [--maxkb=2048] - id: check-case-conflict - id: check-executables-have-shebangs - id: check-json diff --git a/assets/images/default.webp b/assets/images/default.webp new file mode 100644 index 00000000..f075ca92 Binary files /dev/null and b/assets/images/default.webp differ diff --git a/content/country/belgium/image.webp b/content/country/belgium/image.webp new file mode 100644 index 00000000..9c35f5c5 Binary files /dev/null and b/content/country/belgium/image.webp differ diff --git a/content/country/belgium/index.de.md b/content/country/belgium/index.de.md index 41a1b6c4..e367187a 100644 --- a/content/country/belgium/index.de.md +++ b/content/country/belgium/index.de.md @@ -11,7 +11,7 @@ In Belgien können sowohl FIP 50 als auch FIP Freifahrtsscheine umfangreich genu Zusätzlich verkehren internationale [Eurostar]({{< ref "/operator/eurostar" >}} "Eurostar") Züge, welche vergünstigt mit speziellen FIP-Fahrkarten genutzt werden können. Die Züge sind in der Verbindungsauskunft als Zugkategorie `EST` ausgewiesen. -Darüber hinaus verkehren internationale TGV-Züge der SNCF aus Frankreich, für die Freifahrtscheine der belgischen Staatsbahn keine Gültigkeit haben. Für diese Züge lassen sich ausschließlich spezielle FIP Globalpreise buchen. +Darüber hinaus verkehren internationale TGV-Züge der SNCF aus Frankreich, für die Freifahrtscheine der belgischen Staatsbahn keine Gültigkeit haben. Für diese Züge lassen sich ausschließlich spezielle FIP Globalpreise buchen. Für die Eurocity Züge von Brüssel nach Paris von OuiGo gelten keine FIP Vergünstigungen. ## Wissenswertes @@ -24,3 +24,4 @@ Noch ausstehend ## Betreiber ohne FIP - European Sleeper +- OuiGo diff --git a/content/country/belgium/index.en.md b/content/country/belgium/index.en.md index 4fce18cb..70efdb03 100644 --- a/content/country/belgium/index.en.md +++ b/content/country/belgium/index.en.md @@ -11,7 +11,7 @@ In Belgium, both FIP 50 and FIP Coupons can be extensively used. The Belgian Nat Additionally, international [Eurostar]({{< ref "/operator/eurostar" >}} "Eurostar") trains operate, which can be used at a discount with special FIP tickets. The trains are listed as train category `EST` in the connection information. -Furthermore, international TGV trains of the SNCF from France operate, for which the free travel passes of the Belgian National Railway Company are not valid. Only special FIP global prices can be booked for these trains. +Furthermore, international TGV trains of the SNCF from France operate, for which the free travel passes of the Belgian National Railway Company are not valid. Only special FIP global prices can be booked for these trains. For the Eurocity trains from Brussels tp Paris operated by OuiGo, no FIP discounts apply. ## Insteresting @@ -24,3 +24,4 @@ Still pending ## Operators without FIP - European Sleeper +- OuiGo diff --git a/content/country/denmark/image.webp b/content/country/denmark/image.webp new file mode 100644 index 00000000..c7134624 Binary files /dev/null and b/content/country/denmark/image.webp differ diff --git a/content/country/netherlands/image.webp b/content/country/netherlands/image.webp new file mode 100644 index 00000000..670f2e03 Binary files /dev/null and b/content/country/netherlands/image.webp differ diff --git a/content/country/slovakia/image.webp b/content/country/slovakia/image.webp new file mode 100644 index 00000000..3f760a44 Binary files /dev/null and b/content/country/slovakia/image.webp differ diff --git a/content/news/image.webp b/content/news/image.webp deleted file mode 100644 index e05b8015..00000000 Binary files a/content/news/image.webp and /dev/null differ diff --git a/content/operator/dsb/image.webp b/content/operator/dsb/image.webp new file mode 100644 index 00000000..da7819cd Binary files /dev/null and b/content/operator/dsb/image.webp differ diff --git a/content/operator/eurostar/image.webp b/content/operator/eurostar/image.webp new file mode 100644 index 00000000..e1c416f1 Binary files /dev/null and b/content/operator/eurostar/image.webp differ diff --git a/content/operator/ns/image.webp b/content/operator/ns/image.webp new file mode 100644 index 00000000..85d466f5 Binary files /dev/null and b/content/operator/ns/image.webp differ diff --git a/content/operator/sncb/image.webp b/content/operator/sncb/image.webp new file mode 100644 index 00000000..be333cd3 Binary files /dev/null and b/content/operator/sncb/image.webp differ diff --git a/content/operator/zsr/image.webp b/content/operator/zsr/image.webp new file mode 100644 index 00000000..a8ec573e Binary files /dev/null and b/content/operator/zsr/image.webp differ diff --git a/content/operator/zsr/index.de.md b/content/operator/zsr/index.de.md index 6be1e6a3..989d9cc5 100644 --- a/content/operator/zsr/index.de.md +++ b/content/operator/zsr/index.de.md @@ -25,7 +25,9 @@ FIP Freifahrtscheine und FIP 50 Tickets sind auf Verbindungen der ZSSK mit der E ## Zugkategorien und Reservierungen +{{% highlight important %}} Reservierungspflicht für SC- und IC-Züge. Andere ZSSK Züge erfordern nur eine Reservierung in der 1. Klasse. [^2] +{{% /highlight %}} {{% expander "SuperCity (SC) ⚠️" category %}} **Beschreibung:** \ diff --git a/content/operator/zsr/index.en.md b/content/operator/zsr/index.en.md index e945db8f..37249857 100644 --- a/content/operator/zsr/index.en.md +++ b/content/operator/zsr/index.en.md @@ -25,7 +25,9 @@ FIP Coupons and FIP 50 tickets are valid on ZSSK connections with the restrictio ## Train categories and reservations +{{% highlight important %}} Reservation required for SC and IC trains. Other ZSSK trains only require a reservation in 1st class. [^2] +{{% /highlight %}} {{% expander "SuperCity (SC) ⚠️" category %}} **Description:** \ diff --git a/layouts/_default/single.html b/layouts/_default/single.html index f0eeec43..015d522c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,14 +1,14 @@ {{ define "main" }} -
-
-

{{ .Title }}

- {{ partial "updateDate.html" . }} -
+
+
+

{{ .Title }}

+ {{ partial "updateDate.html" . }} +
-
- {{ .Content }} -
+
+ {{ .Content }} +
- {{ partial "related.html" . }} -
+ {{ partial "related.html" . }} +
{{ end }} diff --git a/layouts/country/single.html b/layouts/country/single.html index 81da7e77..81b67de3 100644 --- a/layouts/country/single.html +++ b/layouts/country/single.html @@ -38,6 +38,7 @@ + {{ partial "image.html" (partial "helper/contentImage" . ) }} diff --git a/layouts/operator/single.html b/layouts/operator/single.html index 2772de7d..0cf6dfbf 100644 --- a/layouts/operator/single.html +++ b/layouts/operator/single.html @@ -1,30 +1,31 @@ {{ define "main" }} - -
-
-
- {{ partial "sidemenu.html" . }} -
+ +
+
+
+ {{ partial "sidemenu.html" . }} +
-
-
-
-
- {{ $object := replace .Path (printf "/%s/" .Page.Type) "" }} - {{ $logo := resources.Get (printf "svg/logos/%s.svg" $object) }} - -

{{ .Title }}

+
+
+
+
+ {{ $object := replace .Path (printf "/%s/" .Page.Type) "" }} + {{ $logo := resources.Get (printf "svg/logos/%s.svg" $object) }} + +

{{ .Title }}

+
+ {{ partial "updateDate.html" . }}
- {{ partial "updateDate.html" . }} -
-
- {{- with .Content -}} - {{ . | replaceRE "()" (print `${1}${3}` (partial "icon" "link") ``) | safeHTML }} - {{- end -}} +
+ {{- with .Content -}} + {{ . | replaceRE "()" (print `${1}${3}` (partial "icon" "link") ``) | safeHTML }} + {{- end -}} +
+ {{ partial "image.html" (partial "helper/contentImage" . ) }}
-
-
+
{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index d179e804..5f0fabc2 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,28 +1,4 @@ -{{ $metaDescription := "" }} -{{ if eq .Page.Type "country" }} - {{ $metaDescription = T "meta-description.country" }} -{{ else if eq .Page.Type "news" }} - {{ $metaDescription = T "meta-description.news" }} -{{ else if eq .Page.Type "news" }} - {{ $metaDescription = T "meta-description.news" }} -{{ else }} - {{ $metaDescription = .Description }} -{{ end }} - - - - - - - - - - - - - - - +{{ partial "headMeta.html" . }} {{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }} @@ -48,3 +24,23 @@ <link rel="icon" type="image/x-icon" href="/favicon.ico"> <link rel="apple-touch-icon" type="image/x-icon" href="/favicon.ico"> <link rel="mask-icon" type="image/x-icon" href="/favicon.ico"> +<link rel="canonical" href="{{ .Permalink }}"/> + +{{- $currentPage := . -}} +{{- range .Site.Languages -}} + {{- $lang := . -}} + {{- if eq $lang.Lang $currentPage.Lang -}} + <link rel="alternate" hreflang="{{ $lang.Lang }}" href="{{ $currentPage.Permalink }}" /> + {{- else -}} + {{- with $currentPage.Translations -}} + {{- range . -}} + {{- if eq .Lang $lang.Lang -}} + <link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}" /> + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} +<link rel="alternate" hreflang="x-default" href="{{ .Site.BaseURL }}" /> + +{{ partial "structuredData.html" . }} diff --git a/layouts/partials/headMeta.html b/layouts/partials/headMeta.html new file mode 100644 index 00000000..026e00d1 --- /dev/null +++ b/layouts/partials/headMeta.html @@ -0,0 +1,26 @@ +{{ $metaDescription := "" }} <!-- Initialisierung der Variable --> +{{ if eq .Page.Type "country" }} + {{ $metaDescription = T "meta-description.country" }} +{{ else if eq .Page.Type "news" }} + {{ $metaDescription = T "meta-description.news" }} +{{ else if eq .Page.Type "news" }} + {{ $metaDescription = T "meta-description.news" }} +{{ else }} + {{ $metaDescription = .Description }} +{{ end }} + +<meta charset="utf-8" xmlns:og="http://www.w3.org/1999/xhtml" /> +<meta name="description" content="{{ $metaDescription }}" /> +<meta name="dc.relation" content="{{ .Site.BaseURL }}" /> +<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> +<meta name="theme-color" content="#BA3D12" /> +<meta property="og:url" content='{{ .Permalink }}'> +<meta property="og:site_name" content='{{ site.Title }}'> +<meta property="og:title" content='{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}'> +<meta property="og:description" content="{{ $metaDescription }}" /> +<meta property="og:type" content='{{ if .IsPage }}article{{ else }}website{{ end }}'> +<meta property="og:image" content="{{ .Site.BaseURL }}og-image.jpg"> +<meta property="og:image:type" content="image/jpg"> +<meta property="og:image:width" content="1200"> +<meta property="og:image:height" content="630"> +<meta name="robots" content="index,follow"> diff --git a/layouts/partials/helper/contentImage.html b/layouts/partials/helper/contentImage.html new file mode 100644 index 00000000..fc355ac5 --- /dev/null +++ b/layouts/partials/helper/contentImage.html @@ -0,0 +1,6 @@ +{{ $contentImage := .Page.Resources.GetMatch "image.webp" }} +{{ if not $contentImage }} + {{ $contentImage = resources.Get "images/default.webp" }} +{{ end }} + +{{ return $contentImage }} diff --git a/layouts/partials/helper/dateHuman.html b/layouts/partials/helper/dateHuman.html new file mode 100644 index 00000000..e277b2c2 --- /dev/null +++ b/layouts/partials/helper/dateHuman.html @@ -0,0 +1,8 @@ +{{ $dateHuman := "" }} + +{{ if .Date }} + {{ $dateHuman = .Date | time.Format ":date_long" }} +{{ else if .GitInfo }} + {{ $dateHuman = .GitInfo.AuthorDate | time.Format ":date_long" }} +{{ end }} +{{ return $dateHuman }} diff --git a/layouts/partials/helper/dateMachine.html b/layouts/partials/helper/dateMachine.html new file mode 100644 index 00000000..8e450ca1 --- /dev/null +++ b/layouts/partials/helper/dateMachine.html @@ -0,0 +1,9 @@ +{{ $dateMachine := "" }} +{{ printf "Hello, Hugo! The title of this page is: %s" .Title }} + +{{ if page.Date }} + {{ $dateMachine = page.Date | time.Format "2006-01-02T15:04:05-07:00" }} +{{ else if page.GitInfo }} + {{ $dateMachine = page.GitInfo.AuthorDate | time.Format "2006-01-02T15:04:05-07:00" }} +{{ end }} +{{ return $dateMachine }} diff --git a/layouts/partials/structuredData.html b/layouts/partials/structuredData.html new file mode 100644 index 00000000..6790a306 --- /dev/null +++ b/layouts/partials/structuredData.html @@ -0,0 +1,67 @@ +{{ $dateMachine := partial "helper/dateMachine" . }} +{{ $type := "" }} +{{ if (or (eq .Page.Type "country") (eq .Page.Type "operator")) }} + {{ $type = "Article" }} +{{ else if eq .Page.Type "news"}} + {{ $type = "NewsArticle" }} +{{ end }} + +{{ $image := (partial "helper/contentImage" .).RelPermalink }} + +<script type="application/ld+json">{ + "@context": "https://schema.org", + "@type": "WebSite", + "url": {{ page.Site.BaseURL }}, + "name": "{{ site.Title }}", + "publisher": { + "@type": "Organization", + "name": "FIP Guide", + "email": "nextstop@fipguide.org" + }, + {{- if not .IsHome }} + "breadcrumb": { + "@type": "BreadcrumbList", + "itemListElement": [ + {{- $i := 1 }} + {{- range page.Ancestors.Reverse }} + { + "@type": "ListItem", + "position": {{ $i }}, + "name": "{{ if .IsHome }}{{ site.Title }}{{ else }}{{ .Title }}{{ end }}", + "url": {{ .Permalink }}, + "item": {{ .Permalink }} + }, + {{- $i = add $i 1 -}} + {{ end }} + { + "@type": "ListItem", + "position": {{ $i }}, + "name": "{{ page.Title | safeJS }}", + "url": {{ page.Permalink }}, + "item": {{ page.Permalink }} + } + ] + }, + {{- end }} + {{- if $type }} + "mainEntity": { + "@type": "{{ $type }}", + "headline": "{{ page.Title }}", + "image": {{ $image }}, + "dateModified": {{ $dateMachine }}, + "author": { + "@type":"Organization", + "name": "FIP Guide", + "url": "https://www.fipguide.org/", + "email": "nextstop@fipguide.org" + } + }, + {{- end }} + "maintainer": { + "@type": "Organization", + "name": "FIP Guide", + "email": "nextstop@fipguide.org" + }, + "inLanguage": "{{ site.Language.LanguageCode }}", + "isAccessibleForFree": true +}</script> diff --git a/layouts/partials/teaser.html b/layouts/partials/teaser.html index 9958f4d2..a80a0e71 100644 --- a/layouts/partials/teaser.html +++ b/layouts/partials/teaser.html @@ -7,7 +7,7 @@ <a href="{{ $page.RelPermalink }}" class="m-teaser {{ if $listview }}m-teaser--listview row{{ else }}col-lg-4 col-md-6{{ end }} col-12"> - {{ $image := $page.Page.Resources.GetMatch "image.webp" }} + {{ $image := (partial "helper/contentImage" $page ) }} {{ if $image }} <div class="m-teaser__image{{ if $listview }} col-md-3 col-12{{ end }}"> {{ partialCached "image.html" $image $image }} diff --git a/layouts/partials/updateDate.html b/layouts/partials/updateDate.html index 9b43c120..95b19482 100644 --- a/layouts/partials/updateDate.html +++ b/layouts/partials/updateDate.html @@ -1,16 +1,13 @@ -{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} -{{ $dateHuman := .Date | time.Format ":date_long" }} +{{ $dateMachine := partial "helper/dateMachine" . }} +{{ $dateHuman := partial "helper/dateHuman" . }} + +{{ if eq .Type "news" }} + <div class="updateDate" data-pagefind-ignore="all"> + <span>{{ T "updateDate"}}:</span> + <time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time> + </div> -{{ if .Date }} -<div class="updateDate" data-pagefind-ignore="all"> - {{ if ne .Type "news" }} - <span>{{ T "updateDate"}}:</span> - {{ end }} - <time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time> -</div> {{ else if .GitInfo }} - {{ $dateMachine := .GitInfo.AuthorDate | time.Format "2006-01-02T15:04:05-07:00" }} - {{ $dateHuman := .GitInfo.AuthorDate | time.Format ":date_long" }} {{ $href := print .Site.Params.gitHubUrl "/commits/" .GitInfo.Hash "/content" .Path "/index." .Language ".md" }} <a href="{{ $href }}" diff --git a/layouts/robots.txt b/layouts/robots.txt index 89be35c0..85483ae6 100644 --- a/layouts/robots.txt +++ b/layouts/robots.txt @@ -1,5 +1,5 @@ User-agent: * {{ $imprintPage := site.GetPage "imprint" }}{{ if $imprintPage }}Disallow: {{ $imprintPage.RelPermalink }}{{ range $imprintPage.Translations }} -Disallow: {{ .RelPermalink }}{{ end }}{{ end }}{{ $imprintPage := site.GetPage "privacy" }}{{ if $imprintPage }} -Disallow: {{ $imprintPage.RelPermalink }}{{ range $imprintPage.Translations }} +Disallow: {{ .RelPermalink }}{{ end }}{{ end }}{{ $privacyPage := site.GetPage "privacy" }}{{ if $privacyPage }} +Disallow: {{ $privacyPage.RelPermalink }}{{ range $privacyPage.Translations }} Disallow: {{ .RelPermalink }}{{ end }}{{ end }}