Skip to content

Commit

Permalink
Skip resource if not found
Browse files Browse the repository at this point in the history
  • Loading branch information
auloin committed Aug 13, 2024
1 parent bc9dc03 commit e222e48
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions themes/casper3/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,18 @@ <h4 class="author-name">{{ .Param "author" }}</h4>
</header>

{{ if .Param "feature_image" }}
{{ $image := resources.Get (.Param "feature_image") }}
{{ if .Param "aspect_ratio" }}
<figure class="post-full-image">
{{ else if eq .Section "use-case" }}
<figure class="post-full-image use-case">
{{ else if eq .Section "blog" }}
<figure class="post-full-image blog">
{{ end }}
<img src="{{ $image.RelPermalink }}" alt="{{ $image.Title }}"/>
</figure>
{{ $image := resources.Get (.Param "feature_image") }}
{{ if .Param "aspect_ratio" }}
<figure class="post-full-image">
{{ else if eq .Section "use-case" }}
<figure class="post-full-image use-case">
{{ else if eq .Section "blog" }}
<figure class="post-full-image blog">
{{ end }}
{{ with $image }}
<img src="{{ $image.RelPermalink }}" alt="{{ $image.Title }}"/>
{{ end }}
</figure>
{{ end }}

<section class="post-full-content">
Expand Down

0 comments on commit e222e48

Please sign in to comment.