Skip to content

Commit 327cb38

Browse files
committed
feat: Auto-fetch "last updated" from Git history
It's not longer needed to provide the "date" attribute in the page metadata. If it's not provided, the information will be auto-fetched from Git.
1 parent 12a62df commit 327cb38

25 files changed

+20
-22
lines changed

.github/pull_request_template.md

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
## Checklist
66
<!-- Check fields with: [x] / Abhaken von Punkten: [x] -->
77

8-
- [ ] Changed the date in updatet content pages <!-- Auf Inhaltsseiten wurde das Bearbeitungsdatum angepasst -->
98
- [ ] Check the License of new pictures (non-commercial use without attribution) <!-- Die Lizenz neuer Bilder geprüft (nicht-kommerzielle Nutzung ohne Namensnennung) -->
109

1110
The content was modified in the following languages: <!-- Der Inhalt wurde für die folgenden Sprachen angepasst -->

archetypes/country.de.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: '{{ .Date }}'
32
draft: <true/false>
43
title: '<Name des Landes in Deutsch>'
54
country: '<Name des Landes auf Englisch>'

archetypes/country.en.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: '{{ .Date }}'
32
draft: <true/false>
43
title: '<Name of the country in English>'
54
country: '<Name of the country in English>'

archetypes/default.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: '{{ .Date }}'
32
draft: true
43
title: '{{ replace .File.ContentBaseName "-" " " | title }}'
54
---

archetypes/operator.de.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: '{{ .Date }}'
32
draft: <true/false>
43
title: '<Abkürzung der Bahngesellschaft>'
54
country:

archetypes/operator.en.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: '{{ .Date }}'
32
draft: <true/false>
43
title: '<Abbreviation of the Railway Company>'
54
country:

assets/sass/content.scss

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
font-size: 1.3rem;
33
}
44

5+
.updateDate > .material-symbols-rounded {
6+
font-size: 1.5rem
7+
}
8+
59
code {
610
font-size: inherit;
711
font-weight: 700;

content/country/belgium/index.de.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2024-10-17"
32
draft: false
43
title: "Belgien"
54
description: "Informationen über die FIP-Bedingungen für Belgien und für welche Betreiber Vergünstigungen genutzt werden können."

content/country/belgium/index.en.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2024-10-17"
32
draft: false
43
title: "Belgium"
54
description: "Find out about the FIP conditions for Belgium and for which operators you can benefit from discounts."

content/country/netherlands/index.de.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2024-10-17"
32
draft: false
43
title: "Niederlande"
54
description: "Informationen über die FIP-Bedingungen für die Niederlande und für welche Betreiber Vergünstigungen genutzt werden können."

content/country/netherlands/index.en.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2024-10-17"
32
draft: false
43
title: "Netherlands"
54
description: "Find out about the FIP conditions for the nederlands and for which operators you can benefit from discounts."

content/country/slovakia/index.de.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2024-10-17"
32
draft: false
43
title: "Slowakei"
54
description: "Informationen über die FIP-Bedingungen für die Slowakei und für welche Betreiber Vergünstigungen genutzt werden können."

content/country/slovakia/index.en.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2024-10-17"
32
draft: false
43
title: "Slovakia"
54
description: "Find out about the FIP conditions for slovakia and for which operators you can benefit from discounts."

content/generalInformation.de.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2025-05-01"
32
title: "Übergreifende Infos"
43
description: "Informationen über die allgemeinen Hinweise zu FIP und wie FIP in Anspruch genommen werden kann."
54
---

content/generalInformation.en.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2025-05-01"
32
title: "General Information"
43
description: "Find out about the general information on FIP and how you can use FIP."
54
---

content/operator/eurostar/index.de.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2025-05-01"
32
draft: false
43
title: "Eurostar"
54
description: "Informationen über die FIP-Bedingungen bei Eurostar."

content/operator/eurostar/index.en.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2025-05-01"
32
draft: false
43
title: "Eurostar"
54
description: "Information about FIP conditions for Eurostar."

content/operator/ns/index.de.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2024-10-17"
32
draft: false
43
title: "NS"
54
description: "Informationen über die FIP-Bedingungen bei NS."

content/operator/ns/index.en.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2024-10-17"
32
draft: false
43
title: "NS"
54
description: "Find out about the FIP conditions at NS."

content/operator/sncb/index.de.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2025-03-25"
32
draft: false
43
title: "SNCB"
54
description: "Informationen über die FIP-Bedingungen bei SNCB."

content/operator/sncb/index.en.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2025-02-15"
32
draft: false
43
title: "SNCB"
54
description: "Find out about the FIP conditions at SNCB."

content/operator/zsr/index.de.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2025-04-13"
32
draft: false
43
title: "ZSR / ZSSK"
54
description: "Informationen über die FIP-Bedingungen bei ZSR / ZSSK."

content/operator/zsr/index.en.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
date: "2025-04-13"
32
draft: false
43
title: "ZSR / ZSSK"
54
description: "Find out about the FIP conditions at ZSR / ZSSK."

hugo.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ baseURL: 'https://www.fipguide.org/'
22
title: 'FIP Guide'
33

44
enableRobotsTXT: true
5+
enableGitInfo: true
56

67
defaultContentLanguage: "en"
78
defaultContentLanguageInSubdir: true

layouts/partials/updateDate.html

+15
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,19 @@
88
{{ end }}
99
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
1010
</div>
11+
{{ else if .GitInfo }}
12+
{{ $dateMachine := .GitInfo.AuthorDate | time.Format "2006-01-02T15:04:05-07:00" }}
13+
{{ $dateHuman := .GitInfo.AuthorDate | time.Format ":date_long" }}
14+
{{ $href := print .Site.Params.gitHubUrl "/commits/" .GitInfo.Hash "/content" .Path "/index." .Language ".md" }}
15+
<a
16+
href="{{ $href }}"
17+
target="_blank"
18+
rel="noopener noreferrer"
19+
class="updateDate"
20+
aria-label="Open the commit history of the page"
21+
>
22+
{{ T "updateDate"}}:
23+
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
24+
{{- partial "icon" "arrow_outward" -}}
25+
</a>
1126
{{ end }}

0 commit comments

Comments
 (0)