From 7a8171a1cfdd049fb63d291dd296611ebeb96836 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 20 Dec 2022 14:16:26 -0500 Subject: [PATCH] Fix those stupid little errors --- themes/red/layouts/_default/_markup/render-image.html | 6 ++++-- themes/red/layouts/_default/list.html | 4 ++-- themes/red/layouts/partials/footer.html | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/themes/red/layouts/_default/_markup/render-image.html b/themes/red/layouts/_default/_markup/render-image.html index 09ec5c7..0c50804 100644 --- a/themes/red/layouts/_default/_markup/render-image.html +++ b/themes/red/layouts/_default/_markup/render-image.html @@ -2,8 +2,10 @@ {{- $img := .Page.Resources.GetMatch .Destination -}} {{- if and (not $img) .Page.File -}} - {{ $path := path.Join .Page.File.Dir .Destination }} - {{- $img = resources.Get $path -}} + {{ with .Page.File }} + {{ $path := path.Join .Dir .Destination }} + {{- $img = resources.Get $path -}} + {{ end }} {{- end -}} {{- if and (not $img) .Page.File -}} diff --git a/themes/red/layouts/_default/list.html b/themes/red/layouts/_default/list.html index f5f5d9f..57c8979 100644 --- a/themes/red/layouts/_default/list.html +++ b/themes/red/layouts/_default/list.html @@ -5,7 +5,7 @@ - {{ if in .File.Dir "software" }} + {{ if and (.File) (in .File.Dir "software") }} @@ -24,7 +24,7 @@
Name Description Year Created - {{ if in .File.Dir "software" }} + {{ if and (.File) (in .File.Dir "software") }} {{ else }} diff --git a/themes/red/layouts/partials/footer.html b/themes/red/layouts/partials/footer.html index adf09da..96fd1ef 100644 --- a/themes/red/layouts/partials/footer.html +++ b/themes/red/layouts/partials/footer.html @@ -23,7 +23,9 @@ Imprint - Source + {{ with .File }} + Source + {{ end }}