From cf3bc0e41b14465597242e0ea83463893ca2edda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 19 Apr 2017 16:36:28 +0200 Subject: [PATCH] Fix featured image logic --- exampleSite/content/post/chapter-2.md | 1 - exampleSite/content/post/chapter-3.md | 1 - exampleSite/content/post/chapter-4.md | 1 - exampleSite/content/post/chapter-5.md | 1 - layouts/partials/page-header.html | 3 ++- layouts/partials/site-header.html | 3 ++- layouts/partials/summary-with-image.html | 3 ++- layouts/post/summary-with-image.html | 3 ++- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/exampleSite/content/post/chapter-2.md b/exampleSite/content/post/chapter-2.md index b3c7d4f..c9519ce 100644 --- a/exampleSite/content/post/chapter-2.md +++ b/exampleSite/content/post/chapter-2.md @@ -1,7 +1,6 @@ --- date: 2017-04-10T11:00:59-04:00 description: "Pierre Gringoire" -featured_image: "" tags: [] title: "Chapter II: Pierre Gringoire" --- diff --git a/exampleSite/content/post/chapter-3.md b/exampleSite/content/post/chapter-3.md index cd29cee..713b354 100644 --- a/exampleSite/content/post/chapter-3.md +++ b/exampleSite/content/post/chapter-3.md @@ -1,7 +1,6 @@ --- date: 2017-04-11T11:13:32-04:00 description: "Monsieur the Cardinal" -featured_image: "" tags: [] title: "Chapter III: Monsieur the Cardinal" --- diff --git a/exampleSite/content/post/chapter-4.md b/exampleSite/content/post/chapter-4.md index f49d937..2c347bc 100644 --- a/exampleSite/content/post/chapter-4.md +++ b/exampleSite/content/post/chapter-4.md @@ -1,7 +1,6 @@ --- date: 2017-04-12T11:14:48-04:00 description: "Master Jacques Coppenole" -featured_image: "" tags: ["scene"] title: "Chapter IV: Master Jacques Coppenole" --- diff --git a/exampleSite/content/post/chapter-5.md b/exampleSite/content/post/chapter-5.md index e0f5d28..ab74c76 100644 --- a/exampleSite/content/post/chapter-5.md +++ b/exampleSite/content/post/chapter-5.md @@ -1,7 +1,6 @@ --- date: 2017-04-13T11:15:58-04:00 description: "Quasimodo" -featured_image: "" tags: [] title: "Chapter V: Quasimodo" --- diff --git a/layouts/partials/page-header.html b/layouts/partials/page-header.html index 9e408ce..ca21b9c 100644 --- a/layouts/partials/page-header.html +++ b/layouts/partials/page-header.html @@ -1,6 +1,7 @@ {{ $featured_image := $.Param "featured_image" }} {{ if $featured_image }} -
+ {{ $featured_image := (trim $featured_image "/") | absURL }} +
{{ partial "site-navigation.html" . }}
diff --git a/layouts/partials/site-header.html b/layouts/partials/site-header.html index dce121e..2511739 100755 --- a/layouts/partials/site-header.html +++ b/layouts/partials/site-header.html @@ -1,6 +1,7 @@ {{ $featured_image := $.Param "featured_image" }} {{ if $featured_image }} -
+ {{ $featured_image := (trim $featured_image "/") | absURL }} +
{{ partial "site-navigation.html" .}}
diff --git a/layouts/partials/summary-with-image.html b/layouts/partials/summary-with-image.html index d72cb35..8a99ee4 100644 --- a/layouts/partials/summary-with-image.html +++ b/layouts/partials/summary-with-image.html @@ -3,7 +3,8 @@
{{ if .Params.featured_image }}
- image from {{ .Title }} + {{ $imgURL := (trim .Params.featured_image "/") | absURL }} + image from {{ .Title }}
{{ end }}
diff --git a/layouts/post/summary-with-image.html b/layouts/post/summary-with-image.html index d72cb35..8a99ee4 100644 --- a/layouts/post/summary-with-image.html +++ b/layouts/post/summary-with-image.html @@ -3,7 +3,8 @@
{{ if .Params.featured_image }}
- image from {{ .Title }} + {{ $imgURL := (trim .Params.featured_image "/") | absURL }} + image from {{ .Title }}
{{ end }}