THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

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
tags/v1.2.0-rc1
Lauris BH 1 year ago
parent
commit
60d7e56c69

+ 26
- 0
Makefile View File

@@ -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

+ 160
- 0
assets/logo.svg View File

@@ -0,0 +1,160 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+<svg
5
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+   xmlns:cc="http://creativecommons.org/ns#"
7
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+   xmlns:svg="http://www.w3.org/2000/svg"
9
+   xmlns="http://www.w3.org/2000/svg"
10
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+   width="512"
13
+   height="512"
14
+   viewBox="0 0 135.46667 135.46667"
15
+   version="1.1"
16
+   id="svg8"
17
+   sodipodi:docname="logo.svg"
18
+   inkscape:version="0.92.1 r15371"
19
+   inkscape:export-filename=""
20
+   inkscape:export-xdpi="48.000004"
21
+   inkscape:export-ydpi="48.000004">
22
+  <defs
23
+     id="defs2" />
24
+  <sodipodi:namedview
25
+     id="base"
26
+     pagecolor="#ffffff"
27
+     bordercolor="#666666"
28
+     borderopacity="1.0"
29
+     inkscape:pageopacity="0"
30
+     inkscape:pageshadow="2"
31
+     inkscape:zoom="0.70710678"
32
+     inkscape:cx="418.13805"
33
+     inkscape:cy="177.57445"
34
+     inkscape:document-units="mm"
35
+     inkscape:current-layer="layer2"
36
+     showgrid="false"
37
+     units="px"
38
+     width="256px"
39
+     showguides="false"
40
+     inkscape:window-width="1920"
41
+     inkscape:window-height="1137"
42
+     inkscape:window-x="1912"
43
+     inkscape:window-y="-8"
44
+     inkscape:window-maximized="1"
45
+     inkscape:pagecheckerboard="false"
46
+     inkscape:measure-start="283.373,243.952"
47
+     inkscape:measure-end="290.267,236.527">
48
+    <sodipodi:guide
49
+       position="0,0"
50
+       orientation="0,512"
51
+       id="guide3699"
52
+       inkscape:locked="false" />
53
+    <sodipodi:guide
54
+       position="135.46667,0"
55
+       orientation="-512,0"
56
+       id="guide3701"
57
+       inkscape:locked="false" />
58
+    <sodipodi:guide
59
+       position="135.46667,135.46667"
60
+       orientation="0,-512"
61
+       id="guide3703"
62
+       inkscape:locked="false" />
63
+    <sodipodi:guide
64
+       position="0,135.46667"
65
+       orientation="512,0"
66
+       id="guide3705"
67
+       inkscape:locked="false" />
68
+  </sodipodi:namedview>
69
+  <metadata
70
+     id="metadata5">
71
+    <rdf:RDF>
72
+      <cc:Work
73
+         rdf:about="">
74
+        <dc:format>image/svg+xml</dc:format>
75
+        <dc:type
76
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
77
+        <dc:title></dc:title>
78
+      </cc:Work>
79
+    </rdf:RDF>
80
+  </metadata>
81
+  <g
82
+     inkscape:label="Layer 1"
83
+     inkscape:groupmode="layer"
84
+     id="layer1"
85
+     transform="translate(0,-161.53334)"
86
+     style="display:inline">
87
+    <path
88
+       style="fill:#609926;fill-opacity:1;stroke:#428f29;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
89
+       d="m 27.709937,195.15095 c -9.546573,-0.0272 -22.3392732,6.79805 -21.6317552,23.90397 1.105534,26.72889 25.4565952,29.20839 35.1916502,29.42301 1.068023,5.01357 12.521798,22.30563 21.001818,23.21667 h 37.15277 c 22.27763,-1.66785 38.9607,-75.75671 26.59321,-76.03825 -46.781583,2.47691 -49.995146,2.13838 -88.599758,0 -2.495053,-0.0266 -5.972321,-0.49474 -9.707935,-0.5054 z m 2.491319,9.45886 c 1.351378,13.69267 3.555849,21.70359 8.018216,33.94345 -11.382872,-1.50473 -21.069822,-5.22443 -22.851515,-19.10984 -0.950962,-7.4112 2.390428,-15.16769 14.833299,-14.83361 z"
90
+       id="path3722"
91
+       inkscape:connector-curvature="0"
92
+       sodipodi:nodetypes="sscccccsccsc" />
93
+  </g>
94
+  <g
95
+     inkscape:groupmode="layer"
96
+     id="layer2"
97
+     inkscape:label="Layer 2"
98
+     style="display:inline">
99
+    <rect
100
+       style="display:inline;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.24757317;stroke-opacity:1"
101
+       id="rect4599"
102
+       width="34.762054"
103
+       height="34.762054"
104
+       x="87.508659"
105
+       y="18.291576"
106
+       transform="rotate(25.914715)"
107
+       ry="5.4825778" />
108
+    <path
109
+       style="display:inline;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26644793px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
110
+       d="m 79.804947,57.359056 3.241146,1.609954 V 35.255731 h -3.262698 z"
111
+       id="path4525"
112
+       inkscape:connector-curvature="0"
113
+       sodipodi:nodetypes="ccccc" />
114
+  </g>
115
+  <g
116
+     inkscape:groupmode="layer"
117
+     id="layer3"
118
+     inkscape:label="Layer 3"
119
+     style="display:inline">
120
+    <g
121
+       style="display:inline"
122
+       id="g4539">
123
+      <circle
124
+         transform="rotate(-19.796137)"
125
+         r="3.4745038"
126
+         cy="90.077766"
127
+         cx="49.064713"
128
+         id="path4606"
129
+         style="fill:#609926;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-opacity:1" />
130
+      <circle
131
+         transform="rotate(-19.796137)"
132
+         r="3.4745038"
133
+         cy="102.1049"
134
+         cx="36.810425"
135
+         id="path4606-3"
136
+         style="fill:#609926;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-opacity:1" />
137
+      <circle
138
+         transform="rotate(-19.796137)"
139
+         r="3.4745038"
140
+         cy="111.43928"
141
+         cx="46.484283"
142
+         id="path4606-1"
143
+         style="fill:#609926;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-opacity:1" />
144
+      <rect
145
+         transform="rotate(26.024158)"
146
+         y="18.061695"
147
+         x="97.333458"
148
+         height="27.261492"
149
+         width="2.6726954"
150
+         id="rect4629-8"
151
+         style="fill:#609926;fill-opacity:1;stroke:none;stroke-width:0.27444693;stroke-opacity:1" />
152
+      <path
153
+         sodipodi:nodetypes="cc"
154
+         inkscape:connector-curvature="0"
155
+         id="path4514"
156
+         d="m 76.558096,68.116343 c 12.97589,6.395378 13.012989,4.101862 4.890858,20.907244"
157
+         style="fill:none;stroke:#609926;stroke-width:2.68000007;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
158
+    </g>
159
+  </g>
160
+</svg>

BIN
public/img/avatar_default.png View File


BIN
public/img/favicon.ico View File


BIN
public/img/favicon.png View File


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


BIN
public/img/gitea-lg.png View File


BIN
public/img/gitea-sm.png View File


+ 1
- 1
templates/base/head.tmpl View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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"}}

Loading…
Cancel
Save