Skip to content

Commit 373c221

Browse files
committed
Update favicon to new logo from bb-storage
1 parent daafd4f commit 373c221

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

cmd/bb_browser/BUILD.bazel

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@ load("@io_bazel_rules_docker//go:image.bzl", "go_image")
33
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
44
load("@npm//:purgecss/package_json.bzl", purgecss_bin = "bin")
55

6+
genrule(
7+
name = "favicon",
8+
srcs = ["@com_github_buildbarn_bb_storage//:buildbarn_logo_svg"],
9+
outs = ["favicon.svg"],
10+
cmd = "tr -d '\n' < $(location //:buildbarn_logo_svg) | sed -e 's/ content=\"[^\"]*\"//' -e 's/<!--[^!]*-->//g' > $@",
11+
)
12+
613
go_library(
714
name = "bb_browser_lib",
815
srcs = [
916
"browser_service.go",
1017
"main.go",
1118
],
1219
embedsrcs = [
13-
"favicon.png",
20+
":favicon",
1421
"stylesheet.css",
1522
"templates/error.html",
1623
"templates/footer.html",

cmd/bb_browser/favicon.png

-5.38 KB
Binary file not shown.

cmd/bb_browser/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var (
5555
templatesFS embed.FS
5656
//go:embed stylesheet.css
5757
stylesheet template.CSS
58-
//go:embed favicon.png
58+
//go:embed favicon.svg
5959
favicon []byte
6060
)
6161

@@ -130,7 +130,7 @@ func main() {
130130
routePrefix += "/"
131131
}
132132

133-
faviconURL := template.URL("data:image/png;base64," + base64.StdEncoding.EncodeToString(favicon))
133+
faviconURL := template.URL("data:image/svg+xml;base64," + base64.StdEncoding.EncodeToString(favicon))
134134
templates, err := template.New("templates").Funcs(template.FuncMap{
135135
"basename": path.Base,
136136
"favicon_url": func() template.URL { return faviconURL },

0 commit comments

Comments
 (0)