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 21:40:09 +0300
committerAustin Gebauer <agebauer@hashicorp.com>2020-04-05 21:40:09 +0300
commit6ab28316d4b944a90229d75ab9311986b094a779 (patch)
tree89fe0bd9f9d527f25793403897b6adf581cdda10
parentd97bc710772a58b28bd9e07f2b090d6f2193316c (diff)
feat: package avatar image and use if home_image is not set
-rw-r--r--layouts/partials/header.html4
-rw-r--r--static/images/avatar.pngbin0 -> 16144 bytes
2 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 8cd8bd2..1528e72 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -3,14 +3,14 @@
<div class="col-sm-4 col-12 text-sm-right text-center pt-sm-4">
<a href="/" class="text-decoration-none">
<img id="home-image" class="rounded-circle"
- {{ if isset .Site.Params "home_image" }}
+ {{ if (and (isset .Site.Params "home_image") (fileExists (printf "static/%s" (strings.TrimPrefix "/" .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"
+ src="/images/avatar.png"
{{ end }}
/>
</a>
diff --git a/static/images/avatar.png b/static/images/avatar.png
new file mode 100644
index 0000000..d1e0302
--- /dev/null
+++ b/static/images/avatar.png
Binary files differ