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 11googleAnalytics = " 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-
31{{- /* site build info */}}
42< p class ="buildinfo ">
53 {{- /* site build timestamp */}}
64 < time datetime ="{{ now.Format "2006-01-02 15:04:05 IST " }}"> Site built on: {{ now.Format "2006-01-02 15:04:05 IST" }}</ time >
75
86 {{- 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 -}}
1014 < span > from commit: </ span >
1115
1216 {{- /* code */}}
4650 < ul class ="navbar__list ">
4751 < li > < a href ="/posts/index.xml "> RSS</ a > </ li >
4852 < 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 -}}
4960 < li > < span > ~~ </ span > < a href ="{{ $gitRepoUrl }} "> Source</ a > </ li >
5061 </ ul >
5162 </ nav >
Original file line number Diff line number Diff line change 1414{{- end -}}
1515
1616{{- 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 -}}
1824
1925 {{- /* gitinfo */}}
2026 < p class ="gitinfo ">
You can’t perform that action at this time.
0 commit comments