From 30b31921b9f14595d5ce08768982d62d4eca0443 Mon Sep 17 00:00:00 2001 From: Chip Senkbeil Date: Sun, 27 Sep 2015 14:42:32 -0500 Subject: Added fallback image if one is not set for projects --- layouts/partials/project/item.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 }} -- cgit v1.2.3