Skip to content

Commit

Permalink
Thumb for "Monthly Reviews" is hardcoded to "/img/blog/review-thumb.png"
Browse files Browse the repository at this point in the history
  • Loading branch information
antongit committed Jun 6, 2024
1 parent 58a15e5 commit 6b16b2a
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions layouts/_default/thumb.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{{ $thumb := ""}}
{{ with .Params.thumb}}
{{ with $.Resources.GetMatch .}}
{{ $thumb = .Fill "80x80 jpg q99"}}
{{ with $thumb}}
<div class="post-thumb"><img src="{{ $thumb.Permalink }}" class="img-fluid"/></div>
{{ end }}
{{ $category := .Params.categories }}

{{ if ne $category "Monthly Reviews" }}
{{ with .Params.thumb}}
{{ with $.Resources.GetMatch .}}
{{ $thumb = .Fill "80x80 jpg q99"}}
{{ end }}
{{ end }}
{{ end }}

{{ if eq $thumb ""}}
<div class="post-thumb"><img src="/img/blog/grey-thumb.png" class="img-fluid"/></div>
{{ end }}
{{ if eq $category "Monthly Reviews" }}
<div class="post-thumb"><img src="/img/blog/review-thumb.png" class="img-fluid"/></div>
{{ else if ne $thumb "" }}
<div class="post-thumb"><img src="{{ $thumb.Permalink }}" class="img-fluid"/></div>
{{ else }}
<div class="post-thumb"><img src="/img/blog/grey-thumb.png" class="img-fluid"/></div>
{{ end }}

0 comments on commit 6b16b2a

Please sign in to comment.