Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/austingebauer/devise.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Gebauer <agebauer@hashicorp.com>2020-04-05 06:42:40 +0300
committerAustin Gebauer <agebauer@hashicorp.com>2020-04-05 06:42:40 +0300
commit254232f5ab21291eb1e0fe655ab26e681f09411d (patch)
treea7a99c05924e3a342e9ad1c0b636bf7d5075e461
parent9876e9e37ae3378a54a2f62e5eb521653f73714e (diff)
fix: append / prefix to image if not exists
-rw-r--r--layouts/partials/header.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 0c72c6c..de8a0a7 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -4,7 +4,11 @@
<a href="/" class="text-decoration-none">
<img id="home-image" class="rounded-circle"
{{ if (fileExists (printf "static/%s" (strings.TrimPrefix "/" .Site.Params.home_image))) }}
- src="{{ .Site.Params.home_image }}"
+ {{ if hasPrefix .Site.Params.home_image "/" }}
+ src="{{ .Site.Params.home_image }}"
+ {{ else }}
+ src="{{ printf "/%s" .Site.Params.home_image }}"
+ {{ end }}
{{ else }}
src="https://cdn.clipart.email/83451492858686fbb12fdf8df0957c94_lil-silhouettes-by-lil-squid_481-512.png"
{{ end }}