This repository was archived by the owner on Jun 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change 1- {{ $link := .Destination }}
2- {{ $isRemote := strings.HasPrefix $link "http" }}
3- {{- if not $isRemote -}}
4- {{ $url := urls.Parse .Destination }}
5- {{- if $url.Path -}}
6- {{ $fragment := "" }}
7- {{- with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}}
8- {{- if .Page.GetPage $url.Path }}{{ $link = printf "%s%s" (.Page.GetPage $url.Path).RelPermalink $fragment }}{{ end }}{{ end -}}
9- {{- end -}}
10- < a href ="{{ $link | safeURL }} "{{ with .Title}} title ="{{ . }} "{{ end }}{{ if $isRemote }} target ="_blank "{{ end }} > {{- .Text | safeHTML -}}{{ if $isRemote }} < sup > < i class ="fas fa-external-link-alt "> </ i > </ sup > {{ end }}</ a >
1+ {{ $link := .Destination -}}
2+ {{ $isRemote := strings.HasPrefix $link "http" -}}
3+ {{ if not $isRemote -}}
4+ {{ $url := urls.Parse .Destination -}}
5+ {{ if $url.Path -}}
6+ {{ $fragment := "" -}}
7+ {{ with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}}
8+ {{ with .Page.GetPage $url.Path }}{{ $link = printf "%s%s" .RelPermalink $fragment }}{{ end -}}
9+ {{ end -}}
10+ {{ end -}}
11+ < a href ="{{ $link | safeURL }} "
12+ {{- with .Title}} title ="{{ . }} "{{ end -}}
13+ {{- if $isRemote }} target ="_blank " rel ="noopener "{{ end -}}
14+ >
15+ {{- .Text | safeHTML -}}
16+ </ a >
You can’t perform that action at this time.
0 commit comments