From c740fb3da890e09270ac3723f6d5c16133fbca92 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 17 Jun 2017 15:14:15 +0200 Subject: [PATCH] Added brand images --- assets.go | 2 +- config.json | 19 +++++++++++++++---- images/brand/{favicon-300.png => 300.png} | Bin images/brand/{favicon-300.webp => 300.webp} | Bin images/brand/{favicon-600.png => 600.png} | Bin images/brand/{favicon-600.webp => 600.webp} | Bin images/brand/{favicon-64.png => 64.png} | Bin images/brand/{favicon-64.webp => 64.webp} | Bin utils/icons.go | 4 ++-- 9 files changed, 18 insertions(+), 7 deletions(-) rename images/brand/{favicon-300.png => 300.png} (100%) rename images/brand/{favicon-300.webp => 300.webp} (100%) rename images/brand/{favicon-600.png => 600.png} (100%) rename images/brand/{favicon-600.webp => 600.webp} (100%) rename images/brand/{favicon-64.png => 64.png} (100%) rename images/brand/{favicon-64.webp => 64.webp} (100%) diff --git a/assets.go b/assets.go index c2af7e48..a8398dcd 100644 --- a/assets.go +++ b/assets.go @@ -15,7 +15,7 @@ func init() { }) // Favicon - app.Get("/favicon/:size", func(ctx *aero.Context) string { + app.Get("/images/brand/:size", func(ctx *aero.Context) string { return ctx.TryWebP("images/brand/"+ctx.Get("size"), ".png") }) diff --git a/config.json b/config.json index fbc3d6af..37de51fa 100644 --- a/config.json +++ b/config.json @@ -28,14 +28,25 @@ "static": [ "images" ], - "icons": [ - "images/characters/arn-waifu.png" - ], "manifest": { "short_name": "notify.moe", "gcm_sender_id": "941298467524", "theme_color": "#f8a582", - "background_color": "#ffffff" + "background_color": "#ffffff", + "icons": [ + { + "src": "images/brand/64", + "sizes": "64x64" + }, + { + "src": "images/brand/300", + "sizes": "300x300" + }, + { + "src": "images/brand/600", + "sizes": "600x600" + } + ] }, "ports": { "http": 4000, diff --git a/images/brand/favicon-300.png b/images/brand/300.png similarity index 100% rename from images/brand/favicon-300.png rename to images/brand/300.png diff --git a/images/brand/favicon-300.webp b/images/brand/300.webp similarity index 100% rename from images/brand/favicon-300.webp rename to images/brand/300.webp diff --git a/images/brand/favicon-600.png b/images/brand/600.png similarity index 100% rename from images/brand/favicon-600.png rename to images/brand/600.png diff --git a/images/brand/favicon-600.webp b/images/brand/600.webp similarity index 100% rename from images/brand/favicon-600.webp rename to images/brand/600.webp diff --git a/images/brand/favicon-64.png b/images/brand/64.png similarity index 100% rename from images/brand/favicon-64.png rename to images/brand/64.png diff --git a/images/brand/favicon-64.webp b/images/brand/64.webp similarity index 100% rename from images/brand/favicon-64.webp rename to images/brand/64.webp diff --git a/utils/icons.go b/utils/icons.go index fcbcefab..f830531e 100644 --- a/utils/icons.go +++ b/utils/icons.go @@ -8,11 +8,11 @@ import ( var svgIcons = make(map[string]string) func init() { - files, _ := ioutil.ReadDir("images/icons/svg/") + files, _ := ioutil.ReadDir("images/icons/") for _, file := range files { name := strings.Replace(file.Name(), ".svg", "", 1) - data, _ := ioutil.ReadFile("images/icons/svg/" + name + ".svg") + data, _ := ioutil.ReadFile("images/icons/" + name + ".svg") svgIcons[name] = strings.Replace(string(data), "