Skip to content

Commit

Permalink
Add a second check for image files (checking "content/") - Fix devops…
Browse files Browse the repository at this point in the history
  • Loading branch information
somatorio committed Dec 10, 2018
1 parent f446db5 commit 13ef2b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion layouts/shortcodes/list_organizers.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ <h4>Organizer</h4>
</div>
{{- if .image -}}
{{ $imagefile := printf "static/events/%s/organizers/%s" $e.name .image }}
{{ if (fileExists $imagefile) -}}
{{ $imagefile2 := printf "content/events/%s/organizers/%s" $e.name .image }}
{{ if or (fileExists $imagefile) (fileExists $imagefile2) -}}
<img class="card-img-top organizer-image" src="{{ (printf "events/%s/organizers/%s" $e.name .image) | absURL }}" alt="{{ .name }}">
{{- else }}
{{ errorf "%s not found" $imagefile }}
Expand Down
3 changes: 2 additions & 1 deletion layouts/speaker/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ <h3>{{ .Title }} at {{ $e.city }} {{$e.year}}</h3>
{{- if isset .Params "image" -}}
{{- if ne .Params.image "" -}}
{{ $imagefile := printf "static/events/%s/speakers/%s" $e.name .Params.image }}
{{ if fileExists $imagefile }}
{{ $imagefile2 := printf "content/events/%s/speakers/%s" $e.name .Params.image }}
{{ if or (fileExists $imagefile) (fileExists $imagefile2) }}
<img src = "{{ (printf "events/%s/speakers/%s" $e.name .Params.image) |absURL }}" class="img-fluid" alt="{{ .Title }}"/><br />
{{ else }}
{{ errorf "%s not found" $imagefile }}
Expand Down
3 changes: 2 additions & 1 deletion layouts/speakers/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
{{- if isset .Params "image" -}}
{{- if ne .Params.image "" -}}
{{ $imagefile := printf "static/events/%s/speakers/%s" $e.name .Params.image }}
{{ if fileExists $imagefile }}
{{ $imagefile2 := printf "content/events/%s/speakers/%s" $e.name .Params.image }}
{{ if or (fileExists $imagefile) (fileExists $imagefile2) }}
<img src = "{{ (printf "events/%s/speakers/%s" $e.name .Params.image) | absURL}}" class="speakers-page img-fluid" alt="{{ .Title }}"/><br />
{{ else }}
{{ errorf "%s not found" $imagefile }}
Expand Down

0 comments on commit 13ef2b2

Please sign in to comment.