fix: remove relURL function from render-link template

This commit is contained in:
Robert Kaussow 2021-02-21 21:57:06 +01:00
parent 673dc72be0
commit 999f05049a
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61

View File

@ -1,7 +1,2 @@
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
{{- $isRemote:= or (in .Destination ":") ( hasPrefix .Destination "//") -}}
{{- $destination := .Destination | safeURL -}}
{{- if not $isRemote -}}
{{- $destination = $destination | relURL -}}
{{- end -}}
<a class="gblog-post__link{{ if $raw }}--raw{{ end }}" href="{{ $destination }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>
<a class="gblog-post__link{{ if $raw }}--raw{{ end }}" href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>