Chore: render-link variable rename (#276)

This commit is contained in:
Patrice Chalin 2020-06-11 09:24:05 -04:00 committed by GitHub
parent 9dd867c20d
commit cb8f547e54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1,10 +1,10 @@
{{ $isRemote := hasPrefix .Destination "http" -}} {{ $isExternal := hasPrefix .Destination "http" -}}
<a href="{{ .Destination | safeURL }}" <a href="{{ .Destination | safeURL }}"
{{- with .Title }} title="{{ . }}"{{ end -}} {{- with .Title }} title="{{ . }}"{{ end -}}
{{- if $isRemote }} target="_blank" rel="noopener"{{ end -}} {{- if $isExternal }} target="_blank" rel="noopener"{{ end -}}
> >
{{- .Text | safeHTML -}} {{- .Text | safeHTML -}}
{{ if $isRemote -}} {{ if $isExternal -}}
<i class="fas fa-external-link-alt"></i> <i class="fas fa-external-link-alt"></i>
{{- end -}} {{- end -}}
</a> </a>