From 6aaeb3d4655e6854ac66a8a18ec886e0f52bb203 Mon Sep 17 00:00:00 2001 From: Leon Rosenshein Date: Fri, 20 May 2022 10:00:16 -0600 Subject: Relative paths for preview images --- layouts/partials/header.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 442fffe..3fb6ff4 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -52,6 +52,13 @@ {{$imageLink = .Site.Params.authorImgPath -}} {{ end -}} + + {{- if .File.Dir -}} + {{ if not (hasPrefix $imageLink "/") -}} + {{ $imageLink = path.Join .File.Dir $imageLink -}} + {{ end -}} + {{ end -}} + {{ "" | safeHTML }} @@ -71,4 +78,4 @@ {{ partial "custom_header.html" . }} {{ template "_internal/google_analytics.html" . }} - + \ No newline at end of file -- cgit v1.2.3