LoveIt/layouts/partials/plugin/link.html
Dillon 6b03c711ac
feat(shortcode): add link shortcode (#179)
* feat(shortcode): add link shortcode

* docs: add docs for link shortcode

* docs: fix 'mailto' in link shortcode docs error
2020-03-17 21:16:04 +08:00

9 lines
No EOL
440 B
HTML

{{- $rel := "" -}}
<a href="{{ .href | safeURL }}"{{ with .title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .href "http" }}{{ $rel = "noopener noreffer" }} target="_blank"{{ end }} rel="{{ $rel }}{{ with .rel }} {{ . }}{{ end }}"{{ with .class }} class="{{ . }}"{{ end }}>
{{- with .icon -}}
{{- partial "plugin/icon.html" . -}}
{{- end -}}
{{- with .content -}}
{{- . | safeHTML -}}
{{- end -}}
</a>