diff options
author | Chip Senkbeil <chip.senkbeil@gmail.com> | 2015-09-27 22:42:32 +0300 |
---|---|---|
committer | Chip Senkbeil <chip.senkbeil@gmail.com> | 2015-09-27 22:42:32 +0300 |
commit | 30b31921b9f14595d5ce08768982d62d4eca0443 (patch) | |
tree | 352d61c6b4dacd97255b588d871cbf9a63d0d6c9 | |
parent | dd713c8169cd43f3dc920b00a81d82d99d87c21a (diff) |
Added fallback image if one is not set for projects
-rw-r--r-- | layouts/partials/project/item.html | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/layouts/partials/project/item.html b/layouts/partials/project/item.html index 4d1a7c7..1706760 100644 --- a/layouts/partials/project/item.html +++ b/layouts/partials/project/item.html @@ -1,6 +1,11 @@ {{ $url := $.Site.BaseURL }} -{{ $image := .Params.image | urlize }} +{{ if isset .Params "image" }} + {{ $.Scratch.Set "image" .Params.image }} +{{ else }} + {{ $.Scratch.Set "image" "/img/placeholder.jpg" }} +{{ end }} +{{ $image := $.Scratch.Get "image" | urlize }} {{ $title := .Title }} {{ $summary := .Summary }} {{ $link := .Permalink }} |