File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed
exampleSite/config/production Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 1
1
googleAnalytics = " G-FX00ZBCNBW"
2
+ enableGitInfo = true
3
+
4
+ [params .git_info ]
5
+ host = " github"
6
+ user = " manid2"
7
+ repo = " hugo-xterm"
Original file line number Diff line number Diff line change 1
- {{- $gitRepoUrl := "https://github.com/manid2/hugo-xterm/" -}}
2
-
3
1
{{- /* site build info */}}
4
2
< p class ="buildinfo ">
5
3
{{- /* site build timestamp */}}
6
4
< time datetime ="{{ now.Format "2006-01-02 15:04:05 IST " }}"> Site built on: {{ now.Format "2006-01-02 15:04:05 IST" }}</ time >
7
5
8
6
{{- with site.Params.git.last_commit -}}
9
- {{- $commitUrl := printf "https://%s.com/%s/%s/-/commit/%s" site.Data.gitinfo.host site.Data.gitinfo.user site.Data.gitinfo.repo .hash }}
7
+ {{- $commitUrl := "" -}}
8
+ {{- if (isset site.Params "git_info") -}}
9
+ {{- $git_host := site.Params.git_info.host -}}
10
+ {{- $git_user := site.Params.git_info.user -}}
11
+ {{- $git_repo := site.Params.git_info.repo -}}
12
+ {{ $commitUrl = printf "https://%s.com/%s/%s/-/commit/%s" $git_host $git_user $git_repo .hash }}
13
+ {{- end -}}
10
14
< span > from commit: </ span >
11
15
12
16
{{- /* code */}}
46
50
< ul class ="navbar__list ">
47
51
< li > < a href ="/posts/index.xml "> RSS</ a > </ li >
48
52
< li > < span > ~~ </ span > < a href ="/sitemap.xml "> Sitemap</ a > </ li >
53
+ {{- $gitRepoUrl := "" -}}
54
+ {{- if (isset site.Params "git_info") -}}
55
+ {{- $git_host := site.Params.git_info.host -}}
56
+ {{- $git_user := site.Params.git_info.user -}}
57
+ {{- $git_repo := site.Params.git_info.repo -}}
58
+ {{ $gitRepoUrl = printf "https://%s.com/%s/%s" $git_host $git_user $git_repo }}
59
+ {{- end -}}
49
60
< li > < span > ~~ </ span > < a href ="{{ $gitRepoUrl }} "> Source</ a > </ li >
50
61
</ ul >
51
62
</ nav >
Original file line number Diff line number Diff line change 14
14
{{- end -}}
15
15
16
16
{{- with .GitInfo -}}
17
- {{ $commitUrl := printf "https://%s.com/%s/%s/-/commit/%s" site.Data.gitinfo.host site.Data.gitinfo.user site.Data.gitinfo.repo .Hash }}
17
+ {{- $commitUrl := "" -}}
18
+ {{- if (isset site.Params "git_info") -}}
19
+ {{- $git_host := site.Params.git_info.host -}}
20
+ {{- $git_user := site.Params.git_info.user -}}
21
+ {{- $git_repo := site.Params.git_info.repo -}}
22
+ {{ $commitUrl = printf "https://%s.com/%s/%s/-/commit/%s" $git_host $git_user $git_repo .Hash }}
23
+ {{- end -}}
18
24
19
25
{{- /* gitinfo */}}
20
26
< p class ="gitinfo ">
You can’t perform that action at this time.
0 commit comments