dashboard
repositories
filestore
activity
search
login
scapegoat
/
Docs2
summary
reflog
commits
tree
docs
forks
compare
blame
|
history
|
raw
remove horizontal scrollbar
Juaoose
2021-12-03
bc90955959d818797e84c944247736e871faee3f
[scapegoat/Docs2.git]
/
layouts
/
_default
/
_markup
/
render-link.html
1
2
3
4
5
6
7
8
{{$trimmed := strings.TrimSuffix ".md" (.Destination | safeURL)}}
{{$trimmed = replace $trimmed "%20" "-"}}
{{$external := strings.HasPrefix $trimmed "http" }}
{{ if $external }}
<a href="{{ $trimmed }}" rel="noopener">{{ .Text | safeHTML }}</a>
{{else}}
<a href="{{ if (hasPrefix $trimmed "/") }}{{ $trimmed }}{{ else }}{{ print "/" $trimmed }}{{ end }}" rel="noopener">{{ .Text | safeHTML }}</a>
{{end}}