Skip to content

Commit 5a237e3

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 12f80a5 commit 5a237e3

28 files changed

+45
-24
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/main.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ $icon-remove: '{{(resources.Get "svg/default/remove.svg" | fingerprint "md5").Re
1515
@import "headings.scss";
1616
@import "form.scss";
1717
@import "expander.scss";
18-
@import "anchorlink.scss";
18+
@import "anchorlink.scss";
19+
@import "tooltip.scss"

assets/sass/tooltip.scss

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.tooltip-wrapper {
2+
position: relative;
3+
text-decoration: underline dotted;
4+
cursor: help;
5+
}
6+
7+
.tooltip-wrapper .hover-text {
8+
visibility: hidden;
9+
background-color: black;
10+
color: white;
11+
text-align: center;
12+
padding: 5px;
13+
border-radius: 6px;
14+
15+
position: absolute;
16+
width: 200px;
17+
top: 100%;
18+
left: 50%;
19+
margin-left: -100px
20+
}
21+
22+
.tooltip-wrapper:hover .hover-text,
23+
.tooltip-wrapper:focus .hover-text,
24+
.tooltip-wrapper:focus-within .hover-text {
25+
visibility: visible;
26+
}

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

i18n/de.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ highlight-inofficial: Inoffizielle Information
1717
highlight-tip: Persönlicher Tipp
1818
news-headline: Was gibt's Neues?
1919
updateDate: Zuletzt aktualisiert
20+
updatedBy: von
2021
related: Verwandte Seiten
2122
toc_name: Inhalt
2223
_operator__nearby: Angrenzende Betreiber

i18n/en.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ highlight-inofficial: Unofficial Information
1717
highlight-tip: Personal Tip
1818
news-headline: What's new?
1919
updateDate: Last updated
20+
updatedBy: by
2021
related: Related Pages
2122
toc_name: Contents
2223
_operator__nearby: Neighboring Operators

layouts/partials/updateDate.html

+14-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,17 @@
88
{{ end }}
99
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
1010
</div>
11-
{{ end }}
11+
{{ else if .GitInfo }}
12+
{{ with .GitInfo }}
13+
<div class="updateDate">
14+
{{ $dateMachine := .AuthorDate | time.Format "2006-01-02T15:04:05-07:00" }}
15+
{{ $dateHuman := .AuthorDate | time.Format ":date_long" }}
16+
{{ T "updateDate"}}:
17+
<span class="tooltip-wrapper" aria-describedby="tooltip-last-updated" tabindex="0">
18+
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time> {{ T "updatedBy"}} {{ .AuthorName }}
19+
<span role="tooltip" id="tooltip-last-updated" class="hover-text">{{ .Subject }}</span>
20+
</span>
21+
</div>
22+
{{ end }}
23+
{{ end }}
24+

0 commit comments

Comments
 (0)