mirror of
https://github.com/jbowdre/runtimeterror.git
synced 2024-11-23 23:42:19 +00:00
clean up render-link template, add rel=external attr
This commit is contained in:
parent
25e4274986
commit
9c6da303a9
1 changed files with 9 additions and 1 deletions
|
@ -1 +1,9 @@
|
||||||
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}{{ if strings.HasPrefix .Destination "http" }}↗{{ end }}</a>
|
{{- $u := urls.Parse .Destination -}}
|
||||||
|
<a href="{{ .Destination | safeURL }}"
|
||||||
|
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||||
|
{{- if $u.IsAbs }} rel="external"{{ end -}}
|
||||||
|
>
|
||||||
|
{{- with .Text | safeHTML }}{{ . }}{{ end -}}
|
||||||
|
{{- if $u.IsAbs }}↗{{ end -}}
|
||||||
|
</a>
|
||||||
|
{{- /* chomp trailing newline */ -}}
|
Loading…
Reference in a new issue