forked from Edikoyo/EdikoyoWiki
19 lines
608 B
HTML
19 lines
608 B
HTML
{{- $url := urls.Parse .Destination -}}
|
|
{{- $scheme := $url.Scheme -}}
|
|
|
|
<a href="
|
|
{{- if eq $scheme "" -}}
|
|
{{- $cleanedPath := strings.Replace $url.Path "\\" "/" -1 -}}
|
|
{{- if strings.HasSuffix $cleanedPath ".md" -}}
|
|
{{- relref .Page $cleanedPath | safeURL -}}
|
|
{{- else -}}
|
|
{{- $cleanedPath | safeURL -}}
|
|
{{- end -}}
|
|
{{- else -}}
|
|
{{- .Destination | safeURL -}}
|
|
{{- end -}}"
|
|
{{- with .Title }} title="{{ . | safeHTML }}"{{- end -}}>
|
|
{{- .Text | safeHTML -}}
|
|
</a>
|
|
|
|
{{- /* whitespace stripped here to avoid trailing newline in rendered result caused by file EOL */ -}}
|