mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2025-07-01 07:15:31 +00:00
17 lines
779 B
HTML
17 lines
779 B
HTML
{{- $dest := .Destination -}}
|
|
{{- $url := urls.Parse $dest -}}
|
|
|
|
{{- if and $dest (hasPrefix $dest "/") -}}
|
|
{{- with or (.PageInner.GetPage $url.Path) (.PageInner.Resources.Get $url.Path) (resources.Get $url.Path) -}}
|
|
{{- $query := cond $url.RawQuery (printf "?%s" $url.RawQuery) "" -}}
|
|
{{- $fragment := cond $url.Fragment (printf "#%s" $url.Fragment) "" -}}
|
|
{{- $dest = printf "%s%s%s" .RelPermalink $query $fragment -}}
|
|
{{- else -}}
|
|
{{/* Keep absolute paths as-is, don't use relURL */}}
|
|
{{- $dest = $dest -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- with . -}}
|
|
<a href="{{ $dest | safeURL }}" {{ with .Title }}title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }}target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>
|
|
{{- end -}} |