frontend: add BANNER_COLOR to control jumbotron bg

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan 2018-07-19 11:27:22 -07:00
parent 1bc817a013
commit 432c5462a0
2 changed files with 7 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"frontend/money"
"html/template"
"net/http"
"os"
"strconv"
"time"
@ -62,6 +63,7 @@ func (fe *frontendServer) homeHandler(w http.ResponseWriter, r *http.Request) {
"currencies": currencies,
"products": ps,
"cart_size": len(cart),
"banner_color": os.Getenv("BANNER_COLOR"), // illustrates canary deployments
}); err != nil {
log.Error(err)
}

View File

@ -2,7 +2,11 @@
{{ template "header" . }}
<main role="main">
<section class="jumbotron text-center mb-0">
<section class="jumbotron text-center mb-0"
{{ with $.banner_color }}
style="background-color: {{.}};"
{{ end }}
>
<div class="container">
<h1 class="jumbotron-heading">
One-stop for Hipster Fashion &amp; Style Online