Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pkg/logo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

# Minify the logo into a favicon.
genrule(
name = "favicon",
srcs = [":buildbarn_logo.svg"],
outs = ["favicon.svg"],
# Remove embedded draw.io content attribute and svg comments.
cmd = "tr -d '\n' < $(location :buildbarn_logo.svg) | sed -e 's/ content=\"[^\"]*\"//' -e 's/<!--[^!]*-->//g' > $@",
)

go_library(
name = "logo",
srcs = ["logo.go"],
embedsrcs = [
"favicon.svg",
],
importpath = "github.com/buildbarn/bb-storage/pkg/logo",
visibility = ["//visibility:public"],
)
21 changes: 21 additions & 0 deletions pkg/logo/buildbarn_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions pkg/logo/logo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package logo

import (
_ "embed" // For "go:embed".
)

//go:embed favicon.svg
var faviconSvg []byte

// FaviconSvg holds the Buildbarn logo and can be used as favicon in web browsers.
var FaviconSvg = faviconSvg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why the indirection? We can't make the go:embed variable public? I think we should also call this FaviconSVG, as in Go they tend to write abbreviations like HTTP, XML, etc. in all caps.