Skip to content

Commit

Permalink
Add awesome icon in project cards (#920)
Browse files Browse the repository at this point in the history
Co-authored-by: Emruz Hossain <[email protected]>
  • Loading branch information
BernatBC and hossainemruz authored May 10, 2024
1 parent 2b47657 commit 6f4e23a
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 6f4e23a

Please sign in to comment.