]> Untitled Git - afilini.com/commitdiff
Check if git hash is available before using it
authorAlekos Filini <alekos.filini@gmail.com>
Mon, 23 Aug 2021 14:49:00 +0000 (16:49 +0200)
committerAlekos Filini <alekos.filini@gmail.com>
Mon, 23 Aug 2021 14:49:00 +0000 (16:49 +0200)
layouts/partials/footer.html

index 017a804da3069a89c2b2eb8879f20db1c9f12631..a06296b465b3d3d501b46f7fc53f44cecd6e778c 100644 (file)
@@ -1,6 +1,6 @@
 <small class="gray">
     {{ if .IsPage }}
-        <em>Updated: {{ .Lastmod.Format .Site.Params.dateFormat }} - Version: <a href="https://github.com/afilini/afilini.com/commit/{{ .GitInfo.Hash }}">{{ .GitInfo.AbbreviatedHash }}</a></em> -
+        <em>Updated: {{ .Lastmod.Format .Site.Params.dateFormat }} - Version: {{ if isset .GitInfo "Hash" }}<a href="https://github.com/afilini/afilini.com/commit/{{ .GitInfo.Hash }}">{{ .GitInfo.AbbreviatedHash }}</a>{{ else }}unknown{{ end }}</em> -
     {{ end }}
     &copy; <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>
 </small>