mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-18 15:33:10 +00:00
Add icon for external links
This commit is contained in:
@@ -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 -}}
|
||||||
|
Reference in New Issue
Block a user