Changed to use /tree/master by default.

This commit is contained in:
tobiasraabe
2018-03-03 20:15:41 +01:00
committed by Michael Noronha
parent b4cfd8b01e
commit d20c953181

View File

@@ -2,9 +2,16 @@
<div class="container">
{{ if .Site.Params.githubRepo }}
<div class="copyright">
<a href="https://github.com/{{ .Site.Params.githubRepo }}/content/{{ .File.Path }}" target="_blank">View this post on GitHub</a>
</div>
{{ $length := len ( split .Site.Params.githubRepo "/" ) }}
{{ if eq $length 2 }}
<div class="copyright">
<a href="https://github.com/{{ .Site.Params.githubRepo }}/tree/master/content/{{ .File.Path }}" target="_blank">View this post on GitHub</a>
</div>
{{ else }}
<div class="copyright">
<a href="https://github.com/{{ .Site.Params.githubRepo }}/content/{{ .File.Path }}" target="_blank">View this post on GitHub</a>
</div>
{{ end }}
{{ end }}
<div class="copyright">