attachments: streamline icon parameter with button shortcode #240

This commit is contained in:
Sören Weber 2022-05-29 10:04:06 +02:00
parent 4da5114388
commit 4b79d36155
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589

View file

@ -7,13 +7,16 @@
{{- if eq $style "info" }}{{ $icon = default "info-circle" }}{{ end }}
{{- if eq $style "warning" }}{{ $icon = default "exclamation-triangle" }}{{ end }}
{{- if eq $style "note" }}{{ $icon = default "exclamation-circle" }}{{ end }}
{{- if eq $style "tip" }}{{ $icon = default "lightbulb " }}{{ end }}
{{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }}
{{- end }}
{{- $icon = trim $icon " " }}
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
{{- end }}
{{- $sort := .Get "sort" | default "asc" }}
{{- $pattern := .Get "pattern" | default "" }}
<div class="box attachments {{ $style }}">
<div class="box-label">{{ if $icon }}<i class="fas fa-{{ $icon }} fa-fw"></i> {{ end }}{{ $title }}</div>
<div class="box attachments cstyle {{ $style }}">
<div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i> {{ end }}{{ $title }}</div>
<ul class="box-content attachments-files">
{{- $filesName := "files" }}
{{- if ne .Page.File.BaseFileName "index" }}