Skip to content

Commit 432c546

Browse files
committed
frontend: add BANNER_COLOR to control jumbotron bg
Signed-off-by: Ahmet Alp Balkan <[email protected]>
1 parent 1bc817a commit 432c546

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/frontend/handlers.go

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"frontend/money"
66
"html/template"
77
"net/http"
8+
"os"
89
"strconv"
910
"time"
1011

@@ -62,6 +63,7 @@ func (fe *frontendServer) homeHandler(w http.ResponseWriter, r *http.Request) {
6263
"currencies": currencies,
6364
"products": ps,
6465
"cart_size": len(cart),
66+
"banner_color": os.Getenv("BANNER_COLOR"), // illustrates canary deployments
6567
}); err != nil {
6668
log.Error(err)
6769
}

src/frontend/templates/home.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
{{ template "header" . }}
44
<main role="main">
5-
<section class="jumbotron text-center mb-0">
5+
<section class="jumbotron text-center mb-0"
6+
{{ with $.banner_color }}
7+
style="background-color: {{.}};"
8+
{{ end }}
9+
>
610
<div class="container">
711
<h1 class="jumbotron-heading">
812
One-stop for Hipster Fashion &amp; Style Online

0 commit comments

Comments
 (0)