Skip to content

Commit 1bf7d71

Browse files
silverwind6543lunnytechknowlogick
authored
Consolidate Logos and update README header (#14136)
* Consolidate Logos and update README header - Remove unused `logo-lg.png`, `logo-sm.png` and `logo-192.png`. - Consolidate `favicon.svg` and `logo.svg` to just `logo.svg`. - Remove Safari Mask icon, it seems to work fine with just `favicon.png` (no SVG support). - Remove Fluid Icon. It only served Firefox and SVG works just fine there. - Update customization instructions. - Update README.md to use SVG icon, increase logo size and center it and badges. * Update README_ZH.md Co-authored-by: Lunny Xiao <[email protected]> * Update README_ZH.md Co-authored-by: 6543 <[email protected]> Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent 21adeaa commit 1bf7d71

File tree

17 files changed

+138
-96
lines changed

17 files changed

+138
-96
lines changed

README.md

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,52 @@
1-
[简体中文](README_ZH.md)
2-
3-
<h1> <img src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea-192.png" alt="logo" width="30" height="30"> Gitea - Git with a cup of tea</h1>
4-
5-
[![Build Status](https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/master)](https://drone.gitea.io/go-gitea/gitea)
6-
[![Join the Discord chat at https://discord.gg/Gitea](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
7-
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
8-
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
9-
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
10-
[![GoDoc](https://godoc.org/code.gitea.io/gitea?status.svg)](https://godoc.org/code.gitea.io/gitea)
11-
[![GitHub release](https://img.shields.io/github/release/go-gitea/gitea.svg)](https://github.com/go-gitea/gitea/releases/latest)
12-
[![Help Contribute to Open Source](https://www.codetriage.com/go-gitea/gitea/badges/users.svg)](https://www.codetriage.com/go-gitea/gitea)
13-
[![Become a backer/sponsor of gitea](https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen)](https://opencollective.com/gitea)
14-
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
15-
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
16-
[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea)](https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea)
1+
<p align="center">
2+
<a href="https://gitea.io/">
3+
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea.svg" width="220"/>
4+
</a>
5+
</p>
6+
<h1 align="center">Gitea - Git with a cup of tea</h1>
7+
8+
<p align="center">
9+
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
10+
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/master">
11+
</a>
12+
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
13+
<img src="https://img.shields.io/discord/322538954119184384.svg">
14+
</a>
15+
<a href="https://microbadger.com/images/gitea/gitea" title="Get your own image badge on microbadger.com">
16+
<img src="https://images.microbadger.com/badges/image/gitea/gitea.svg">
17+
</a>
18+
<a href="https://codecov.io/gh/go-gitea/gitea" title="Codecov">
19+
<img src="https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg">
20+
</a>
21+
<a href="https://godoc.org/code.gitea.io/gitea" title="Go Report Card">
22+
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
23+
</a>
24+
<a href="https://godoc.org/code.gitea.io/gitea" title="GoDoc">
25+
<img src="https://godoc.org/code.gitea.io/gitea?status.svg">
26+
</a>
27+
<a href="https://github.com/go-gitea/gitea/releases/latest" title="GitHub release">
28+
<img src="https://img.shields.io/github/release/go-gitea/gitea.svg">
29+
</a>
30+
<a href="https://www.codetriage.com/go-gitea/gitea" title="Help Contribute to Open Source">
31+
<img src="https://www.codetriage.com/go-gitea/gitea/badges/users.svg">
32+
</a>
33+
<a href="https://opencollective.com/gitea" title="Become a backer/sponsor of gitea">
34+
<img src="https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen">
35+
</a>
36+
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
37+
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
38+
</a>
39+
<a href="https://crowdin.com/project/gitea" title="Crowdin">
40+
<img src="https://badges.crowdin.net/gitea/localized.svg">
41+
</a>
42+
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea" title="TODOs">
43+
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea">
44+
</a>
45+
</p>
46+
47+
<p align="center">
48+
<a href="README_ZH.md">View the chinese version of this document</a>
49+
</p>
1750

1851
## Purpose
1952

README_ZH.md

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,52 @@
1-
[English](README.md)
2-
3-
<h1> <img src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea-192.png" alt="logo" width="30" height="30"> Gitea - Git with a cup of tea</h1>
4-
5-
[![Build Status](https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg)](https://drone.gitea.io/go-gitea/gitea)
6-
[![Join the Discord chat at https://discord.gg/Gitea](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
7-
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
8-
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
9-
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
10-
[![GoDoc](https://godoc.org/code.gitea.io/gitea?status.svg)](https://godoc.org/code.gitea.io/gitea)
11-
[![GitHub release](https://img.shields.io/github/release/go-gitea/gitea.svg)](https://github.com/go-gitea/gitea/releases/latest)
12-
[![Help Contribute to Open Source](https://www.codetriage.com/go-gitea/gitea/badges/users.svg)](https://www.codetriage.com/go-gitea/gitea)
13-
[![Become a backer/sponsor of gitea](https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen)](https://opencollective.com/gitea)
14-
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
15-
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
1+
<p align="center">
2+
<a href="https://gitea.io/">
3+
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea.svg" width="220"/>
4+
</a>
5+
</p>
6+
<h1 align="center">Gitea - Git with a cup of tea</h1>
7+
8+
<p align="center">
9+
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
10+
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/master">
11+
</a>
12+
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
13+
<img src="https://img.shields.io/discord/322538954119184384.svg">
14+
</a>
15+
<a href="https://microbadger.com/images/gitea/gitea" title="Get your own image badge on microbadger.com">
16+
<img src="https://images.microbadger.com/badges/image/gitea/gitea.svg">
17+
</a>
18+
<a href="https://codecov.io/gh/go-gitea/gitea" title="Codecov">
19+
<img src="https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg">
20+
</a>
21+
<a href="https://godoc.org/code.gitea.io/gitea" title="Go Report Card">
22+
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
23+
</a>
24+
<a href="https://godoc.org/code.gitea.io/gitea" title="GoDoc">
25+
<img src="https://godoc.org/code.gitea.io/gitea?status.svg">
26+
</a>
27+
<a href="https://github.com/go-gitea/gitea/releases/latest" title="GitHub release">
28+
<img src="https://img.shields.io/github/release/go-gitea/gitea.svg">
29+
</a>
30+
<a href="https://www.codetriage.com/go-gitea/gitea" title="Help Contribute to Open Source">
31+
<img src="https://www.codetriage.com/go-gitea/gitea/badges/users.svg">
32+
</a>
33+
<a href="https://opencollective.com/gitea" title="Become a backer/sponsor of gitea">
34+
<img src="https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen">
35+
</a>
36+
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
37+
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
38+
</a>
39+
<a href="https://crowdin.com/project/gitea" title="Crowdin">
40+
<img src="https://badges.crowdin.net/gitea/localized.svg">
41+
</a>
42+
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea" title="TODOs">
43+
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea">
44+
</a>
45+
</p>
46+
47+
<p align="center">
48+
<a href="README.md">View the english version of this document</a>
49+
</p>
1650

1751
## 目标
1852

build/generate-images.js

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
'use strict';
33

44
const imageminZopfli = require('imagemin-zopfli');
5+
const Svgo = require('svgo');
56
const {fabric} = require('fabric');
67
const {readFile, writeFile} = require('fs').promises;
78
const {resolve} = require('path');
8-
const Svgo = require('svgo');
99

1010
const logoFile = resolve(__dirname, '../assets/logo.svg');
1111

@@ -22,32 +22,20 @@ function loadSvg(svg) {
2222
});
2323
}
2424

25-
async function generateSvgFavicon(svg, outputFile) {
26-
const svgo = new Svgo({
27-
plugins: [
28-
{removeDimensions: true},
29-
{
30-
addAttributesToSVGElement: {
31-
attributes: [
32-
{'width': '32'},
33-
{'height': '32'},
34-
],
35-
},
36-
},
37-
],
38-
});
39-
40-
const {data} = await svgo.optimize(svg);
41-
await writeFile(outputFile, data);
42-
}
25+
async function generate(svg, outputFile, {size, bg}) {
26+
if (outputFile.endsWith('.svg')) {
27+
const svgo = new Svgo({
28+
plugins: [
29+
{removeDimensions: true},
30+
{addAttributesToSVGElement: {attributes: [{width: size}, {height: size}]}},
31+
],
32+
});
4333

44-
async function generateSvg(svg, outputFile) {
45-
const svgo = new Svgo();
46-
const {data} = await svgo.optimize(svg);
47-
await writeFile(outputFile, data);
48-
}
34+
const {data} = await svgo.optimize(svg);
35+
await writeFile(outputFile, data);
36+
return;
37+
}
4938

50-
async function generate(svg, outputFile, {size, bg}) {
5139
const {objects, options} = await loadSvg(svg);
5240
const canvas = new fabric.Canvas();
5341
canvas.setDimensions({width: size, height: size});
@@ -78,25 +66,16 @@ async function generate(svg, outputFile, {size, bg}) {
7866

7967
async function main() {
8068
const gitea = process.argv.slice(2).includes('gitea');
81-
8269
const svg = await readFile(logoFile, 'utf8');
70+
8371
await Promise.all([
84-
generateSvgFavicon(svg, resolve(__dirname, '../public/img/favicon.svg')),
85-
generateSvg(svg, resolve(__dirname, '../public/img/logo.svg')),
86-
generate(svg, resolve(__dirname, '../public/img/logo-lg.png'), {size: 880}),
87-
generate(svg, resolve(__dirname, '../public/img/logo-512.png'), {size: 512}),
88-
generate(svg, resolve(__dirname, '../public/img/logo-192.png'), {size: 192}),
89-
generate(svg, resolve(__dirname, '../public/img/logo-sm.png'), {size: 120}),
90-
generate(svg, resolve(__dirname, '../public/img/avatar_default.png'), {size: 200}),
72+
generate(svg, resolve(__dirname, '../public/img/logo.svg'), {size: 32}),
73+
generate(svg, resolve(__dirname, '../public/img/logo.png'), {size: 512}),
9174
generate(svg, resolve(__dirname, '../public/img/favicon.png'), {size: 180}),
75+
generate(svg, resolve(__dirname, '../public/img/avatar_default.png'), {size: 200}),
9276
generate(svg, resolve(__dirname, '../public/img/apple-touch-icon.png'), {size: 180, bg: true}),
77+
gitea && generate(svg, resolve(__dirname, '../public/img/gitea.svg'), {size: 32}),
9378
]);
94-
if (gitea) {
95-
await Promise.all([
96-
generateSvg(svg, resolve(__dirname, '../public/img/gitea.svg')),
97-
generate(svg, resolve(__dirname, '../public/img/gitea-192.png'), {size: 192}),
98-
]);
99-
}
10079
}
10180

10281
main().then(exit).catch(exit);

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,20 @@ the url `http://gitea.domain.tld/image.png`.
5959

6060
## Changing the default logo
6161

62-
To automatically update custom logo png and svg files replace `assets/logo.svg` and run `make generate-images`. This will update the user-designated logo files served in `public/img`. Alternatively, you can manually update each `logo-X.png` and `logo.svg` file in `public/img`.
62+
To build a custom logo replace `assets/logo.svg` and run `make generate-images`. This will update
63+
these customizable logo files which you can then place in `custom/public/img` on your server:
64+
65+
- `public/img/logo.svg`
66+
- `public/img/logo.png`
67+
- `public/img/favicon.png`
68+
- `public/img/avatar_default.png`
69+
- `public/img/apple-touch-icon.png`
6370

6471
## Changing the default avatar
6572

66-
Place the png image at the following path: `custom/public/img/avatar_default.png`
73+
Either generate it via above method or place the png image at the following path:
74+
75+
- `custom/public/img/avatar_default.png`
6776

6877
## Customizing Gitea pages and resources
6978

modules/setting/setting.go

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,24 +1089,14 @@ func MakeManifestData(appName string, appURL string, absoluteAssetURL string) []
10891089
StartURL: appURL,
10901090
Icons: []manifestIcon{
10911091
{
1092-
Src: absoluteAssetURL + "/img/logo-lg.png",
1093-
Type: "image/png",
1094-
Sizes: "880x880",
1095-
},
1096-
{
1097-
Src: absoluteAssetURL + "/img/logo-512.png",
1092+
Src: absoluteAssetURL + "/img/logo.png",
10981093
Type: "image/png",
10991094
Sizes: "512x512",
11001095
},
11011096
{
1102-
Src: absoluteAssetURL + "/img/logo-192.png",
1103-
Type: "image/png",
1104-
Sizes: "192x192",
1105-
},
1106-
{
1107-
Src: absoluteAssetURL + "/img/logo-sm.png",
1108-
Type: "image/png",
1109-
Sizes: "120x120",
1097+
Src: absoluteAssetURL + "/img/logo.svg",
1098+
Type: "image/svg+xml",
1099+
Sizes: "512x512",
11101100
},
11111101
},
11121102
})

public/img/gitea-192.png

-4.64 KB
Binary file not shown.

public/img/gitea.svg

Lines changed: 1 addition & 1 deletion
Loading

public/img/logo-192.png

-4.64 KB
Binary file not shown.

public/img/logo-lg.png

-26.2 KB
Binary file not shown.

public/img/logo-safari.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/img/logo-sm.png

-2.94 KB
Binary file not shown.
File renamed without changes.

0 commit comments

Comments
 (0)