diff options
| author | anoduck <11767-anoduck@users.noreply.gitgud.io> | 2024-09-13 20:22:52 -0400 |
|---|---|---|
| committer | anoduck <11767-anoduck@users.noreply.gitgud.io> | 2024-09-13 20:23:11 -0400 |
| commit | 9744378a9b9071872182edb4f151f915ecfa8643 (patch) | |
| tree | a8c9b8de8e223f6edbecc91b899c2f2a196c712e /layouts/partials/GetIllustration.html | |
| parent | 5e0f93a81672bacbfd583cfe8cc40f24282af031 (diff) | |
added tags, working out themeing
Diffstat (limited to 'layouts/partials/GetIllustration.html')
| -rw-r--r-- | layouts/partials/GetIllustration.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/layouts/partials/GetIllustration.html b/layouts/partials/GetIllustration.html new file mode 100644 index 0000000..1b21f3b --- /dev/null +++ b/layouts/partials/GetIllustration.html @@ -0,0 +1,22 @@ +{{- $item := .item -}} +{{- $illustration := "" -}} +{{- $style := "img-wrap mx-auto mx-md-0" -}} +{{- $size := .size | default "col-12 col-sm-4 col-lg-12" -}} + +{{ if $item.Params.icon }} + {{- $icon := (or (and (reflect.IsMap $item.Params.Icon) $item.Params.Icon.url) $item.Params.Icon) -}} + {{- $mode := and (reflect.IsMap $item.Params.Icon) $item.Params.Icon.mode -}} + {{ if eq (lower (path.Ext $icon)) ".json" }} + {{ $illustration = partial "assets/animation.html" (dict "data" $icon "mode" $mode "loop" false "hover" true "class" (printf "mx-auto text-center %s" $size)) }} + {{ else }} + {{ $illustration = partial "assets/icon.html" (dict "icon" "mode" $mode $icon "wrapper" "mx-auto text-center")}} + {{ end }} +{{ else }} + {{- $thumbnail := "" -}} + {{ if reflect.IsMap $item.Params.Thumbnail }}{{ $thumbnail = $item.Params.Thumbnail.url }}{{ else }}{{ $thumbnail = $item.Params.Thumbnail }}{{ end }} + {{- if $thumbnail }} + {{ $illustration = partial "assets/image.html" (dict "url" $thumbnail "ratio" "16x9" "wrapper" $style "inner" "rounded" "title" $item.Site.Title) }} + {{ end }} +{{ end }} + +{{ return $illustration }}
\ No newline at end of file |
