Skip to content

Commit

Permalink
image loader fix for all images
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamankoji committed May 15, 2024
1 parent 6890b3b commit ec79bdf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layouts/contests/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ <h1 class="lg:text-6xl mb-0 inline-block mx-auto gradient-text sm:text-2xl">{{
<div class="max-w-5xl mx-auto ancor-blue sm:w-3/4 mb-4 sm:mb-0 order-1 md:order-2 sm:order-2 pb-4">

<div class="max-w-3xl mx-auto">
{{ partial "featured" .}}
{{ partial "contest_featured" .}}
</div>
{{ $author := .Site.GetPage (print "/authors/" (anchorize
.Params.Author)) }}
Expand Down
17 changes: 17 additions & 0 deletions layouts/partials/contest_featured.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{ $img := print .Permalink "img/featured.webp" }}

{{ if not (fileExists (print .RelPermalink "img/featured.webp")) }}
{{ $img = "/img/default-cover.webp" }}
{{ end }}

<div class="mx-auto pb-3">
<div class="bg-gray-200 overflow-hidden rounded-b-lg shadow-lg">
<img class="!w-full text-center rounded-t-lg card_load !h-[28rem]" src="{{ $img | absURL }}" alt="Featured Image">
<figcaption class="bottom-0 left-0 right-0 bg-transparent text-center text-xs text-gray4 py-1">
<!-- Customizing your shell prompt can enhance your development environment.
<a href="https://github.com/gautamankoji" target="_blank" rel="noopener noreferrer" class="">
@<span class="font-semibold underline">gautamankoji</span></a> -->
{{ .Params.figcaption | default .Description }}
</figcaption>
</div>
</div>
2 changes: 1 addition & 1 deletion public

0 comments on commit ec79bdf

Please sign in to comment.