diff options
author | Austin Gebauer <agebauer@hashicorp.com> | 2020-04-05 21:40:09 +0300 |
---|---|---|
committer | Austin Gebauer <agebauer@hashicorp.com> | 2020-04-05 21:40:09 +0300 |
commit | 6ab28316d4b944a90229d75ab9311986b094a779 (patch) | |
tree | 89fe0bd9f9d527f25793403897b6adf581cdda10 | |
parent | d97bc710772a58b28bd9e07f2b090d6f2193316c (diff) |
feat: package avatar image and use if home_image is not set
-rw-r--r-- | layouts/partials/header.html | 4 | ||||
-rw-r--r-- | static/images/avatar.png | bin | 0 -> 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 Binary files differnew file mode 100644 index 0000000..d1e0302 --- /dev/null +++ b/static/images/avatar.png |