Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
182ccb3
70-seo-google-optimization
therobrob May 2, 2025
9835c09
70-seo-google-optimization
therobrob May 2, 2025
901c7ab
70-seo-google-optimization
therobrob May 2, 2025
2f2a05c
70-seo-google-optimization
therobrob May 2, 2025
569d065
Merge remote-tracking branch 'origin/70-seo-google-optimization' into…
therobrob May 8, 2025
7605ee6
feat: add structured Data for pages
therobrob May 8, 2025
8dde602
feat: add structured Data for pages
therobrob May 8, 2025
d16a1ba
feat: add structured Data for pages
therobrob May 8, 2025
f89c55e
feat: add structured Data for pages
therobrob May 8, 2025
3e4d166
fix: pre-commit
lenderom May 8, 2025
c24e915
feat: add meta-tag "robots"
therobrob May 8, 2025
49bbb44
feat: add canonical-link
therobrob May 8, 2025
f964803
feat: updated robots.txt
therobrob May 8, 2025
4d71010
feat: structured data
therobrob May 8, 2025
38e3c70
fix: add images
lenderom May 8, 2025
474fbc1
feat: structured data
therobrob May 8, 2025
bce5d29
Merge branch 'main' into 70-seo-google-optimization
therobrob May 8, 2025
3f98d3c
fix: use the image partial for responsive images
lenderom May 9, 2025
60ad507
Merge remote-tracking branch 'origin/main' into 70-seo-google-optimiz…
lenderom May 9, 2025
b577434
fix: remove roberts debug picture output
lenderom May 9, 2025
6fe0fa0
fix: absolute url for image in structuredData.html
therobrob May 9, 2025
60207b7
fix: Implementation of the review comments
therobrob May 23, 2025
2745b61
Merge branch 'main' into 70-seo-google-optimization
therobrob May 23, 2025
54621b4
fix: Implementation of the review comments
therobrob May 23, 2025
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
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added assets/images/default.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/country/belgium/image.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/country/denmark/image.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/country/netherlands/image.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/country/slovakia/image.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed content/news/image.webp
Binary file not shown.
Binary file added content/operator/dsb/image.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/operator/eurostar/image.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/operator/ns/image.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/operator/sncb/image.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/operator/zsr/image.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{ define "main" }}
<article class="container o-single">
<div class="o-single__header">
<h2 data-pagefind-meta="title">{{ .Title }}</h2>
{{ partial "updateDate.html" . }}
</div>
<article class="container o-single">
<div class="o-single__header">
<h2 data-pagefind-meta="title">{{ .Title }}</h2>
{{ partial "updateDate.html" . }}
</div>

<div class="content" data-pagefind-body>
{{ .Content }}
</div>
<div class="content" data-pagefind-body>
{{ .Content }}
</div>

{{ partial "related.html" . }}
</article>
{{ partial "related.html" . }}
</article>
{{ end }}
1 change: 1 addition & 0 deletions layouts/country/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ <h3 id="related">{{ T "_operator__list_title"}} in {{ .Title }}</h3>
</ul>
</div>
</div>
{{ partial "image" (partial "helper/contentImage" . ) }}
</div>
</div>
</article>
Expand Down
45 changes: 23 additions & 22 deletions layouts/operator/single.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
{{ define "main" }}
<div class="curtain" aria-hidden="true"></div>
<article class="container o-single o-single--with-sidemenu">
<div class="row">
<div class="col-12 col-lg-4">
{{ partial "sidemenu.html" . }}
</div>
<div class="curtain" aria-hidden="true"></div>
<article class="container o-single o-single--with-sidemenu">
<div class="row">
<div class="col-12 col-lg-4">
{{ partial "sidemenu.html" . }}
</div>

<div class="col-12 col-lg-8" data-pagefind-body>
<div class="o-single__container content_with_heading">
<div class="o-single__header">
<div class="o-single__header__title">
{{ $object := replace .Path (printf "/%s/" .Page.Type) "" }}
{{ $logo := resources.Get (printf "svg/logos/%s.svg" $object) }}
<img data-pagefind-meta="img" src="{{ $logo.RelPermalink }}" alt="" />
<h1 data-pagefind-meta="title">{{ .Title }}</h1>
<div class="col-12 col-lg-8" data-pagefind-body>
<div class="o-single__container content_with_heading">
<div class="o-single__header">
<div class="o-single__header__title">
{{ $object := replace .Path (printf "/%s/" .Page.Type) "" }}
{{ $logo := resources.Get (printf "svg/logos/%s.svg" $object) }}
<img data-pagefind-meta="img" src="{{ $logo.RelPermalink }}" alt="" />
<h1 data-pagefind-meta="title">{{ .Title }}</h1>
</div>
{{ partial "updateDate.html" . }}
</div>
{{ partial "updateDate.html" . }}
</div>

<div class="content" data-pagefind-weight="2.5">
{{- with .Content -}}
{{ . | replaceRE "(<h[2] id=\"([^\"]+)\".+)(</h[2]+>)" (print `<span class="a-anchorlink">${1}${3}<a href="#${2}" class="a-anchorlink__link" title="` (T "copyAnchorLink") `">` (partial "icon" "link") `</a></span>`) | safeHTML }}
{{- end -}}
<div class="content" data-pagefind-weight="2.5">
{{- with .Content -}}
{{ . | replaceRE "(<h[2] id=\"([^\"]+)\".+)(</h[2]+>)" (print `<span class="a-anchorlink">${1}${3}<a href="#${2}" class="a-anchorlink__link" title="` (T "copyAnchorLink") `">` (partial "icon" "link") `</a></span>`) | safeHTML }}
{{- end -}}
</div>
</div>
{{ partial "image" (partial "helper/contentImage" . ) }}
</div>
</div>
</div>
</article>
</article>
{{ end }}
46 changes: 21 additions & 25 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
{{ $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">
{{ partial "headMeta.html" . }}

<title>
{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}
Expand All @@ -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" . }}
26 changes: 26 additions & 0 deletions layouts/partials/headMeta.html
Original file line number Diff line number Diff line change
@@ -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">
6 changes: 6 additions & 0 deletions layouts/partials/helper/contentImage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ $contentImage := .Page.Resources.GetMatch "image.webp" }}
{{ if not $contentImage }}
{{ $contentImage = resources.Get "images/default.webp" }}
{{ end }}

{{ return $contentImage }}
8 changes: 8 additions & 0 deletions layouts/partials/helper/dateHuman.html
Original file line number Diff line number Diff line change
@@ -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 }}
8 changes: 8 additions & 0 deletions layouts/partials/helper/dateMachine.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ $dateMachine := "" }}

{{ 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 }}
77 changes: 77 additions & 0 deletions layouts/partials/structuredData.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{{ $dateMachine := partial "helper/dateMachine" . }}
{{ $mainEntity := "" }}
{{ if (or (eq .Page.Type "country") (eq .Page.Type "operator")) }}
{{ $mainEntity = "Article" }}
{{ else if eq .Page.Type "news"}}
{{ $mainEntity = "NewsArticle" }}
{{ end }}

{{ $image := (partial "helper/contentImage" .).Permalink }}

<script type="application/ld+json">{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"name": "{{ site.Title }}",
"url": {{ page.Site.BaseURL }}
},
{
"@type": "WebPage",
"url": {{ .Permalink }},
"name": "{{ .Title }}",
"publisher": {
"@type": "Organization",
"name": "FIP Guide",
"email": "[email protected]"
},
{{- 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 $mainEntity }}
"mainEntity": {
"@type": "{{ $mainEntity }}",
"headline": "{{ page.Title }}",
"image": {{ $image }},
"dateModified": {{ $dateMachine }},
"author": {
"@type":"Organization",
"name": "FIP Guide",
"url": "https://www.fipguide.org/",
"email": "[email protected]"
}
},
{{- end }}
"maintainer": {
"@type": "Organization",
"name": "FIP Guide",
"email": "[email protected]"
},
"inLanguage": "{{ site.Language.LanguageCode }}",
"isAccessibleForFree": true
}
]
}
</script>
2 changes: 1 addition & 1 deletion layouts/partials/teaser.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
19 changes: 8 additions & 11 deletions layouts/partials/updateDate.html
Original file line number Diff line number Diff line change
@@ -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 }}"
Expand Down
20 changes: 16 additions & 4 deletions layouts/robots.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
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 }}

{{- $imprintPage := site.GetPage "imprint" }}
{{- 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 }}
Loading