Skip to content

Commit 60d7e56

Browse files
lafrikslunny
authored andcommitted
Add task to generate images from SVG and change to new logo (go-gitea#2194)
* Add makefile task to generate images from SVG and change to new logo * use absolute path on generate-images
1 parent 04c4028 commit 60d7e56

File tree

12 files changed

+190
-4
lines changed

12 files changed

+190
-4
lines changed

Makefile

+26
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ GOFMT ?= gofmt -s
2121

2222
GOFLAGS := -i -v
2323
EXTRA_GOFLAGS ?=
24+
PWD := $(shell pwd)
2425

2526
LDFLAGS := -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')" -X "main.Tags=$(TAGS)"
2627

@@ -296,3 +297,28 @@ update-translations:
296297
$(SED_INPLACE) -e 's/\\"/"/g' ./translations/*.ini
297298
mv ./translations/*.ini ./options/locale/
298299
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

assets/logo.svg

+160
Loading

public/img/avatar_default.png

-22.9 KB
Loading

public/img/favicon.ico

87.9 KB
Binary file not shown.

public/img/favicon.png

1.19 KB
Loading

public/img/gitea-large-resize.png

-15.9 KB
Binary file not shown.

public/img/gitea-lg.png

-7.34 KB
Loading

public/img/gitea-sm.png

1.12 KB
Loading

templates/base/head.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
<div class="column">
9191
<div class="ui top secondary menu">
9292
<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">
9494
</a>
9595

9696
{{if .IsSigned}}

templates/org/settings/hook_new.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
1111
<div class="ui right">
1212
{{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">
1414
{{else if eq .HookType "gogs"}}
1515
<img class="img-13" src="{{AppSubUrl}}/img/gogs.ico">
1616
{{else if eq .HookType "slack"}}

templates/repo/settings/hook_list.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div>
77
<div class="menu">
88
<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
1010
</a>
1111
<a class="item" href="{{.BaseLink}}/settings/hooks/gogs/new">
1212
<img class="img-10" src="{{AppSubUrl}}/img/gogs.ico">Gogs

templates/repo/settings/hook_new.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
99
<div class="ui right">
1010
{{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">
1212
{{else if eq .HookType "gogs"}}
1313
<img class="img-13" src="{{AppSubUrl}}/img/gogs.ico">
1414
{{else if eq .HookType "slack"}}

0 commit comments

Comments
 (0)