Ability to inject extra html into head from env
This commit is contained in:
parent
74c34776dd
commit
d02d093c25
2 changed files with 6 additions and 0 deletions
|
@ -95,6 +95,7 @@ func (fe *frontendServer) homeHandler(w http.ResponseWriter, r *http.Request) {
|
|||
"ad": fe.chooseAd(r.Context(), []string{}, log),
|
||||
"platform_css": plat.css,
|
||||
"platform_name": plat.provider,
|
||||
"extra_headers": template.HTML(os.Getenv("EXTRA_HEADERS")),
|
||||
}); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
@ -171,6 +172,7 @@ func (fe *frontendServer) productHandler(w http.ResponseWriter, r *http.Request)
|
|||
"cart_size": cartSize(cart),
|
||||
"platform_css": plat.css,
|
||||
"platform_name": plat.provider,
|
||||
"extra_headers": template.HTML(os.Getenv("EXTRA_HEADERS")),
|
||||
}); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
|
@ -282,6 +284,7 @@ func (fe *frontendServer) viewCartHandler(w http.ResponseWriter, r *http.Request
|
|||
"expiration_years": []int{year, year + 1, year + 2, year + 3, year + 4},
|
||||
"platform_css": plat.css,
|
||||
"platform_name": plat.provider,
|
||||
"extra_headers": template.HTML(os.Getenv("EXTRA_HEADERS")),
|
||||
}); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
|
@ -351,6 +354,7 @@ func (fe *frontendServer) placeOrderHandler(w http.ResponseWriter, r *http.Reque
|
|||
"recommendations": recommendations,
|
||||
"platform_css": plat.css,
|
||||
"platform_name": plat.provider,
|
||||
"extra_headers": template.HTML(os.Getenv("EXTRA_HEADERS")),
|
||||
}); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
|
@ -410,6 +414,7 @@ func renderHTTPError(log logrus.FieldLogger, r *http.Request, w http.ResponseWri
|
|||
"request_id": r.Context().Value(ctxKeyRequestID{}),
|
||||
"error": errMsg,
|
||||
"status_code": code,
|
||||
"extra_headers": template.HTML(os.Getenv("EXTRA_HEADERS")),
|
||||
"status": http.StatusText(code)})
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="/static/styles/cart.css">
|
||||
<link rel="stylesheet" type="text/css" href="/static/styles/order.css">
|
||||
<link rel='shortcut icon' type='image/x-icon' href='/static/favicon.ico' />
|
||||
{{$.extra_headers}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
Loading…
Add table
Reference in a new issue