mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-22 05:00:39 +00:00
fix: dont apply relURL function to remote urls in render-link template
This commit is contained in:
parent
ece9d46a3e
commit
673dc72be0
@ -3,5 +3,6 @@ title: "Get in touch"
|
|||||||
---
|
---
|
||||||
|
|
||||||
- **E-Mail:** <!-- spellchecker-disable -->mail [ett] example.com<!-- spellchecker-enable -->
|
- **E-Mail:** <!-- spellchecker-disable -->mail [ett] example.com<!-- spellchecker-enable -->
|
||||||
|
- **Mailto:** [contact@example.com](mailto:contact@example.com)
|
||||||
- **Matrix:** @john:example.com
|
- **Matrix:** @john:example.com
|
||||||
- **XMPP:** john@example.com
|
- **XMPP:** john@example.com
|
||||||
|
@ -1,2 +1,7 @@
|
|||||||
{{ $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") }}
|
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
|
||||||
<a class="gblog-post__link{{ if $raw }}--raw{{ end }}" href="{{ .Destination | safeURL | relURL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>
|
{{- $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>
|
||||||
|
Loading…
Reference in New Issue
Block a user