Browse Source

Add task to generate images from SVG and change to new logo (#2194)

* Add makefile task to generate images from SVG and change to new logo

* use absolute path on generate-images
Lauris BH 1 year ago
parent
commit
60d7e56c69

+ 26 - 0
Makefile

@@ -21,6 +21,7 @@ GOFMT ?= gofmt -s
21 21
 
22 22
 GOFLAGS := -i -v
23 23
 EXTRA_GOFLAGS ?=
24
+PWD := $(shell pwd)
24 25
 
25 26
 LDFLAGS := -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')" -X "main.Tags=$(TAGS)"
26 27
 
@@ -296,3 +297,28 @@ update-translations:
296 297
 	$(SED_INPLACE) -e 's/\\"/"/g' ./translations/*.ini
297 298
 	mv ./translations/*.ini ./options/locale/
298 299
 	rmdir ./translations
300
+
301
+.PHONY: generate-images
302
+generate-images:
303
+	mkdir -p $(TMPDIR)/images
304
+	inkscape -f $(PWD)/assets/logo.svg -w 400 -h 400 -e $(PWD)/public/img/gitea-lg.png
305
+	inkscape -f $(PWD)/assets/logo.svg -w 30 -h 30 -jC -i layer1 -e $(TMPDIR)/images/30-1.png
306
+	inkscape -f $(PWD)/assets/logo.svg -w 30 -h 30 -jC -i layer2 -e $(TMPDIR)/images/30-2.png
307
+	composite -compose atop $(TMPDIR)/images/30-2.png $(TMPDIR)/images/30-1.png $(PWD)/public/img/gitea-sm.png
308
+	inkscape -f $(PWD)/assets/logo.svg -w 200 -h 200 -e $(PWD)/public/img/avatar_default.png
309
+	inkscape -f $(PWD)/assets/logo.svg -w 180 -h 180 -e $(PWD)/public/img/favicon.png
310
+	inkscape -f $(PWD)/assets/logo.svg -w 128 -h 128 -e $(TMPDIR)/images/128-raw.png
311
+	inkscape -f $(PWD)/assets/logo.svg -w 64 -h 64 -e $(TMPDIR)/images/64-raw.png
312
+	inkscape -f $(PWD)/assets/logo.svg -w 32 -h 32 -jC -i layer1 -e $(TMPDIR)/images/32-1.png
313
+	inkscape -f $(PWD)/assets/logo.svg -w 32 -h 32 -jC -i layer2 -e $(TMPDIR)/images/32-2.png
314
+	composite -compose atop $(TMPDIR)/images/32-2.png $(TMPDIR)/images/32-1.png $(TMPDIR)/images/32-raw.png
315
+	inkscape -f $(PWD)/assets/logo.svg -w 16 -h 16 -jC -i layer1 -e $(TMPDIR)/images/16-raw.png
316
+	zopflipng $(TMPDIR)/images/128-raw.png $(TMPDIR)/images/128.png
317
+	zopflipng $(TMPDIR)/images/64-raw.png $(TMPDIR)/images/64.png
318
+	zopflipng $(TMPDIR)/images/32-raw.png $(TMPDIR)/images/32.png
319
+	zopflipng $(TMPDIR)/images/16-raw.png $(TMPDIR)/images/16.png
320
+	rm -f $(TMPDIR)/images/*-*.png
321
+	convert $(TMPDIR)/images/16.png $(TMPDIR)/images/32.png \
322
+					$(TMPDIR)/images/64.png $(TMPDIR)/images/128.png \
323
+					$(PWD)/public/img/favicon.ico
324
+	rm -rf $(TMPDIR)/images

File diff suppressed because it is too large
+ 160 - 0
assets/logo.svg


BIN
public/img/avatar_default.png


BIN
public/img/favicon.ico


BIN
public/img/favicon.png


BIN
public/img/gitea-large-resize.png


BIN
public/img/gitea-lg.png


BIN
public/img/gitea-sm.png


+ 1 - 1
templates/base/head.tmpl

@@ -90,7 +90,7 @@
90 90
 						<div class="column">
91 91
 							<div class="ui top secondary menu">
92 92
 								<a class="item brand" href="{{AppSubUrl}}/">
93
-									<img class="ui mini image" src="{{AppSubUrl}}/img/favicon.png">
93
+									<img class="ui mini image" src="{{AppSubUrl}}/img/gitea-sm.png">
94 94
 								</a>
95 95
 
96 96
 								{{if .IsSigned}}

+ 1 - 1
templates/org/settings/hook_new.tmpl

@@ -10,7 +10,7 @@
10 10
 					{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
11 11
 					<div class="ui right">
12 12
 						{{if eq .HookType "gitea"}}
13
-							<img class="img-13" src="{{AppSubUrl}}/img/favicon.png">
13
+							<img class="img-13" src="{{AppSubUrl}}/img/gitea-sm.png">
14 14
 						{{else if eq .HookType "gogs"}}
15 15
 							<img class="img-13" src="{{AppSubUrl}}/img/gogs.ico">
16 16
 						{{else if eq .HookType "slack"}}

+ 1 - 1
templates/repo/settings/hook_list.tmpl

@@ -6,7 +6,7 @@
6 6
 			<div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div>
7 7
 			<div class="menu">
8 8
 				<a class="item" href="{{.BaseLink}}/settings/hooks/gitea/new">
9
-					<img class="img-10" src="{{AppSubUrl}}/img/favicon.png">Gitea
9
+					<img class="img-10" src="{{AppSubUrl}}/img/gitea-sm.png">Gitea
10 10
 				</a>
11 11
 				<a class="item" href="{{.BaseLink}}/settings/hooks/gogs/new">
12 12
 					<img class="img-10" src="{{AppSubUrl}}/img/gogs.ico">Gogs

+ 1 - 1
templates/repo/settings/hook_new.tmpl

@@ -8,7 +8,7 @@
8 8
 			{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
9 9
 			<div class="ui right">
10 10
 				{{if eq .HookType "gitea"}}
11
-					<img class="img-13" src="{{AppSubUrl}}/img/favicon.png">
11
+					<img class="img-13" src="{{AppSubUrl}}/img/gitea-sm.png">
12 12
 				{{else if eq .HookType "gogs"}}
13 13
 					<img class="img-13" src="{{AppSubUrl}}/img/gogs.ico">
14 14
 				{{else if eq .HookType "slack"}}