featurette.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {{ $ := .root }}
  2. {{ $page := .page }}
  3. <div class="row featurette">
  4. {{ with $page.Title }}
  5. <div class="col-md-12 section-heading">
  6. <h1>{{ . | markdownify | emojify }}</h1>
  7. {{ if $page.Params.subtitle }}<p>{{ $page.Params.subtitle | markdownify | emojify }}</p>{{ end }}
  8. </div>
  9. {{ end }}
  10. {{ with $page.Content }}
  11. <div class="col-md-12">
  12. {{ . }}
  13. </div>
  14. {{ end }}
  15. {{ range $page.Params.feature }}
  16. {{ $pack := or .icon_pack "fas" }}
  17. {{ $pack_prefix := $pack }}
  18. {{ if in (slice "fab" "fas" "far" "fal") $pack }}
  19. {{ $pack_prefix = "fa" }}
  20. {{ end }}
  21. <div class="col-12 col-sm-4">
  22. {{ with .icon }}
  23. <div class="featurette-icon">
  24. {{- if eq $pack "emoji" -}}
  25. {{- . | emojify -}}
  26. {{- else if eq $pack "custom" -}}
  27. {{- $svg_icon := resources.Get (printf "media/icons/%s.svg" .) -}}
  28. {{- if $svg_icon -}}<img src="{{ $svg_icon.RelPermalink }}" alt="{{.}}" class="svg-icon svg-baseline" loading="lazy">{{- end -}}
  29. {{- else -}}
  30. <i class="{{ $pack }} {{ $pack_prefix }}-{{ . }}"></i>
  31. {{- end -}}
  32. </div>
  33. {{ end }}
  34. <div class="section-subheading">{{ .name | markdownify | emojify }}</div>
  35. {{ with .description }}<p>{{ . | markdownify | emojify }}</p>{{ end }}
  36. </div>
  37. {{ end }}
  38. </div>