Skip to content

Commit

Permalink
Add awesome icon in project cards
Browse files Browse the repository at this point in the history
  • Loading branch information
BernatBC committed Apr 2, 2024
1 parent a69388d commit fcad9f0
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions layouts/partials/cards/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,24 @@
<div class="d-flex">
{{ if .logo }}

{{ $logoImage:= resources.Get .logo}}
{{ if $logoImage }}
{{/* svg don't support "Fit" operation */}}
{{ if ne $logoImage.MediaType.SubType "svg" }}
{{ $logoImage = $logoImage.Fit "24x24" }}
{{ end }}
{{ if eq (len (findRE ".*/.*" .logo) ) 0 }}

<i style="padding-right: 0.25em" class="{{.logo}} h4"></i>

{{ else }}

{{ $logoImage:= resources.Get .logo}}
{{ if $logoImage }}
{{/* svg don't support "Fit" operation */}}
{{ if ne $logoImage.MediaType.SubType "svg" }}
{{ $logoImage = $logoImage.Fit "24x24" }}
{{ end }}
<img class="card-img-xs" src="{{ $logoImage.RelPermalink }}" alt="{{ .name }}" />
{{ end }}
{{ end }}

<img class="card-img-xs" src="{{ $logoImage.RelPermalink }}" alt="{{ .name }}" />
{{ end }}
{{ end }}

<h5 class="card-title mb-0">{{ .name }}</h5>
</div>
<div class="sub-title">
Expand Down

0 comments on commit fcad9f0

Please sign in to comment.