mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 09:43:06 +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
|
@ -10,10 +10,13 @@
|
||||||
{{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }}
|
{{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $icon = trim $icon " " }}
|
{{- $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" }}
|
{{- $sort := .Get "sort" | default "asc" }}
|
||||||
{{- $pattern := .Get "pattern" | default "" }}
|
{{- $pattern := .Get "pattern" | default "" }}
|
||||||
<div class="box attachments {{ $style }}">
|
<div class="box attachments cstyle {{ $style }}">
|
||||||
<div class="box-label">{{ if $icon }}<i class="fas fa-{{ $icon }} fa-fw"></i> {{ end }}{{ $title }}</div>
|
<div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i> {{ end }}{{ $title }}</div>
|
||||||
<ul class="box-content attachments-files">
|
<ul class="box-content attachments-files">
|
||||||
{{- $filesName := "files" }}
|
{{- $filesName := "files" }}
|
||||||
{{- if ne .Page.File.BaseFileName "index" }}
|
{{- if ne .Page.File.BaseFileName "index" }}
|
||||||
|
|
Loading…
Reference in a new issue