Add icon for external links

This commit is contained in:
mark
2023-02-05 15:53:43 +01:00
parent 9c0fca16bf
commit 092ee2f4a7

View File

@@ -139,7 +139,14 @@
</li> </li>
{{ else -}} {{ else -}}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link {{ if $active }}active{{ end }}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ with $pre}}{{ . }}{{ end }}<span {{if $active }} class="active"{{end}}>{{ .Name }}</span>{{ with $post}}{{ . }}{{ end }}</a> {{- $external := ne $url.Host $baseurl.Host -}}
<a class="nav-link {{ if $active }}active{{ end }}"
href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if $external }}target="_blank" {{ end }}>
{{ with $pre}}{{ . }}{{ end }}
<span {{if $active }} class="active"{{end}}>{{ .Name }}</span>
{{- with $post}}{{ . }}{{ end -}}
{{- if $external }} {{ partial "assets/icon.html" (dict "icon" "fas up-right-from-square fa-2xs") }}{{ end -}}
</a>
</li> </li>
{{ end }} {{ end }}
{{ end -}} {{ end -}}