31 lines
727 B
Go
31 lines
727 B
Go
|
|
package domain
|
||
|
|
|
||
|
|
// Brand is product identity for hermes email chrome (logo / name / link).
|
||
|
|
type Brand struct {
|
||
|
|
Name string // e.g. Harbor Desk
|
||
|
|
Link string // public site origin
|
||
|
|
LogoURL string // absolute URL to logo (email clients need absolute)
|
||
|
|
Copyright string
|
||
|
|
}
|
||
|
|
|
||
|
|
// DefaultBrand when config incomplete.
|
||
|
|
func DefaultBrand(publicWebBase string) Brand {
|
||
|
|
base := stringsTrimRightSlash(publicWebBase)
|
||
|
|
if base == "" {
|
||
|
|
base = "http://127.0.0.1:5173"
|
||
|
|
}
|
||
|
|
return Brand{
|
||
|
|
Name: "Harbor Desk",
|
||
|
|
Link: base,
|
||
|
|
LogoURL: base + "/brand-mark.jpg",
|
||
|
|
Copyright: "© Harbor Desk",
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func stringsTrimRightSlash(s string) string {
|
||
|
|
for len(s) > 0 && s[len(s)-1] == '/' {
|
||
|
|
s = s[:len(s)-1]
|
||
|
|
}
|
||
|
|
return s
|
||
|
|
}
|