mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
attachments: streamline icon parameter with button shortcode #240
This commit is contained in:
parent
4da5114388
commit
4b79d36155
1 changed files with 6 additions and 3 deletions
|
@ -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" }}
|
||||
|
|
Loading…
Reference in a new issue