mirror of
https://github.com/imfing/hextra.git
synced 2025-05-13 17:16:26 -04:00
fix: use relURL only for link starts with slash (#54)
This commit is contained in:
parent
76ac694542
commit
a184cfd41e
@ -11,11 +11,11 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- $external := strings.HasPrefix $link "http" -}}
|
{{- $external := strings.HasPrefix $link "http" -}}
|
||||||
|
{{- $href := cond (strings.HasPrefix $link "/") ($link | relURL) $link -}}
|
||||||
|
|
||||||
<a
|
<a
|
||||||
class="hextra-card group flex flex-col justify-start overflow-hidden rounded-lg border border-gray-200 text-current no-underline dark:shadow-none hover:shadow-gray-100 dark:hover:shadow-none shadow-gray-100 active:shadow-sm active:shadow-gray-200 transition-all duration-200 {{ $linkClass }}"
|
class="hextra-card group flex flex-col justify-start overflow-hidden rounded-lg border border-gray-200 text-current no-underline dark:shadow-none hover:shadow-gray-100 dark:hover:shadow-none shadow-gray-100 active:shadow-sm active:shadow-gray-200 transition-all duration-200 {{ $linkClass }}"
|
||||||
href="{{ $link | relURL }}"
|
href="{{ $href }}"
|
||||||
{{- if $external }}
|
{{- if $external }}
|
||||||
target="_blank" rel="noreferrer"
|
target="_blank" rel="noreferrer"
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user