[Minor] Change target to _blank for external URLs

This commit is contained in:
Robert von Burg 2021-07-14 14:21:47 +02:00
parent 8aff75039d
commit d6597dc213
2 changed files with 6 additions and 2 deletions

View File

@ -1 +1 @@
<p>Built with <a href="https://github.com/matcornic/hugo-theme-learn"><i class="fas fa-heart"></i></a> from <a href="https://getgrav.org">Grav</a> and <a href="https://gohugo.io/">Hugo</a></p>
<p>Built with <a href="https://github.com/matcornic/hugo-theme-learn" target="_blank"><i class="fas fa-heart"></i></a> from <a href="https://getgrav.org" target="_blank">Grav</a> and <a href="https://gohugo.io/" target="_blank">Hugo</a></p>

View File

@ -41,7 +41,11 @@
<ul>
{{ range sort . "Weight"}}
<li>
{{.Pre}}<a class="padding" href="{{.URL | absLangURL }}">{{safeHTML .Name}}</a>{{.Post}}
{{ if gt (strings.Count "http" .URL) 0}}
{{.Pre}}<a class="padding" href="{{.URL | absLangURL }}" target="_blank">{{safeHTML .Name}}</a>{{.Post}}
{{ else }}
{{.Pre}}<a class="padding" href="{{.URL | absLangURL }}">{{safeHTML .Name}}</a>{{.Post}}
{{ end }}
</li>
{{end}}
</ul>