diff --git a/cmd/bb_browser/BUILD.bazel b/cmd/bb_browser/BUILD.bazel index 468ee21..0b1be8d 100644 --- a/cmd/bb_browser/BUILD.bazel +++ b/cmd/bb_browser/BUILD.bazel @@ -3,6 +3,13 @@ load("@io_bazel_rules_docker//go:image.bzl", "go_image") load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") load("@npm//:purgecss/package_json.bzl", purgecss_bin = "bin") +genrule( + name = "favicon", + srcs = ["@com_github_buildbarn_bb_storage//:buildbarn_logo_svg"], + outs = ["favicon.svg"], + cmd = "tr -d '\n' < $(location //:buildbarn_logo_svg) | sed -e 's/ content=\"[^\"]*\"//' -e 's///g' > $@", +) + go_library( name = "bb_browser_lib", srcs = [ @@ -10,7 +17,7 @@ go_library( "main.go", ], embedsrcs = [ - "favicon.png", + ":favicon", "stylesheet.css", "templates/error.html", "templates/footer.html", diff --git a/cmd/bb_browser/favicon.png b/cmd/bb_browser/favicon.png deleted file mode 100644 index b16eaee..0000000 Binary files a/cmd/bb_browser/favicon.png and /dev/null differ diff --git a/cmd/bb_browser/main.go b/cmd/bb_browser/main.go index 4927678..65a4c1c 100644 --- a/cmd/bb_browser/main.go +++ b/cmd/bb_browser/main.go @@ -55,7 +55,7 @@ var ( templatesFS embed.FS //go:embed stylesheet.css stylesheet template.CSS - //go:embed favicon.png + //go:embed favicon.svg favicon []byte ) @@ -130,7 +130,7 @@ func main() { routePrefix += "/" } - faviconURL := template.URL("data:image/png;base64," + base64.StdEncoding.EncodeToString(favicon)) + faviconURL := template.URL("data:image/svg+xml;base64," + base64.StdEncoding.EncodeToString(favicon)) templates, err := template.New("templates").Funcs(template.FuncMap{ "basename": path.Base, "favicon_url": func() template.URL { return faviconURL },