File tree 3 files changed +27
-11
lines changed
3 files changed +27
-11
lines changed Original file line number Diff line number Diff line change
1
+ {{ $dateHuman := "" }}
2
+
3
+ {{ if .Date }}
4
+ {{ $dateHuman := .Date | time.Format ":date_long" }}
5
+ {{ else if .GitInfo }}
6
+ {{ $dateHuman := .GitInfo.AuthorDate | time.Format ":date_long" }}
7
+ {{ end }}
8
+ {{ return $dateHuman }}
Original file line number Diff line number Diff line change
1
+ {{ $dateMachine := "" }}
2
+ {{ printf "Hello, Hugo! The title of this page is: %s" .Title }}
3
+
4
+ {{ if page.Date }}
5
+ {{ $dateMachine := page.Date | time.Format "2006-01-02T15:04:05-07:00" }}
6
+ {{ else if page.GitInfo }}
7
+ {{ $dateMachine := page.GitInfo.AuthorDate | time.Format "2006-01-02T15:04:05-07:00" }}
8
+ {{ end }}
9
+ {{ return $dateMachine }}
Original file line number Diff line number Diff line change 1
- {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
2
- {{ $dateHuman := .Date | time.Format ":date_long" }}
1
+ {{ $dateMachine := partial "helper/dateMachine" . }}
2
+ {{ $dateHuman := partial "helper/dateHuman" . }}
3
+ < p > {{ $dateMachine }}</ p >
4
+ {{ printf "Hello, Hugo! The title of this page is: %s" .Title }}
5
+
6
+ {{ if ne .Type "news" }}
7
+ < div class ="updateDate " data-pagefind-ignore ="all ">
8
+ < span > {{ T "updateDate"}}:</ span >
9
+ < time datetime ="{{ $dateMachine }} "> {{ $dateHuman }}</ time >
10
+ </ div >
3
11
4
- {{ if .Date }}
5
- < div class ="updateDate " data-pagefind-ignore ="all ">
6
- {{ if ne .Type "news" }}
7
- < span > {{ T "updateDate"}}:</ span >
8
- {{ end }}
9
- < time datetime ="{{ $dateMachine }} "> {{ $dateHuman }}</ time >
10
- </ div >
11
12
{{ 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
13
{{ $href := print .Site.Params.gitHubUrl "/commits/" .GitInfo.Hash "/content" .Path "/index." .Language ".md" }}
15
14
< a
16
15
href ="{{ $href }} "
You can’t perform that action at this time.
0 commit comments