Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitea png to logo #13974

Merged
merged 7 commits into from
Dec 19, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ generate-gitignore:
.PHONY: generate-images
generate-images:
npm install --no-save --no-package-lock fabric imagemin-zopfli
node build/generate-images.js
node build/generate-images.js $(TAGS)

.PHONY: pr\#%
pr\#%: clean-all
Expand Down
33 changes: 23 additions & 10 deletions build/generate-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

const imageminZopfli = require('imagemin-zopfli');
const {fabric} = require('fabric');
const {readFile, writeFile} = require('fs').promises;
const {readFile, writeFile, copyFile} = require('fs').promises;
const {resolve} = require('path');
const Svgo = require('svgo');

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

function exit(err) {
if (err) console.error(err);
process.exit(err ? 1 : 0);
Expand Down Expand Up @@ -69,15 +71,26 @@ async function generate(svg, outputFile, {size, bg}) {
}

async function main() {
const svg = await readFile(resolve(__dirname, '../assets/logo.svg'), 'utf8');
await generateSvgFavicon(svg, resolve(__dirname, '../public/img/favicon.svg'));
await generate(svg, resolve(__dirname, '../public/img/gitea-lg.png'), {size: 880});
await generate(svg, resolve(__dirname, '../public/img/gitea-512.png'), {size: 512});
await generate(svg, resolve(__dirname, '../public/img/gitea-192.png'), {size: 192});
await generate(svg, resolve(__dirname, '../public/img/gitea-sm.png'), {size: 120});
await generate(svg, resolve(__dirname, '../public/img/avatar_default.png'), {size: 200});
await generate(svg, resolve(__dirname, '../public/img/favicon.png'), {size: 180});
await generate(svg, resolve(__dirname, '../public/img/apple-touch-icon.png'), {size: 180, bg: true});
const gitea = process.argv.slice(2).includes('gitea');

const svg = await readFile(logoFile, 'utf8');
await Promise.all([
copyFile(logoFile, resolve(__dirname, '../public/img/logo.svg')),
generateSvgFavicon(svg, resolve(__dirname, '../public/img/favicon.svg')),
generate(svg, resolve(__dirname, '../public/img/logo-lg.png'), {size: 880}),
generate(svg, resolve(__dirname, '../public/img/logo-512.png'), {size: 512}),
generate(svg, resolve(__dirname, '../public/img/logo-192.png'), {size: 192}),
generate(svg, resolve(__dirname, '../public/img/logo-sm.png'), {size: 120}),
generate(svg, resolve(__dirname, '../public/img/avatar_default.png'), {size: 200}),
generate(svg, resolve(__dirname, '../public/img/favicon.png'), {size: 180}),
generate(svg, resolve(__dirname, '../public/img/apple-touch-icon.png'), {size: 180, bg: true}),
]);
if (gitea) {
await Promise.all([
copyFile(logoFile, resolve(__dirname, '../public/img/gitea.svg')),
generate(svg, resolve(__dirname, '../public/img/gitea-192.png'), {size: 192}),
]);
}
}

main().then(exit).catch(exit);
Expand Down
31 changes: 31 additions & 0 deletions public/img/gitea.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/logo-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
31 changes: 31 additions & 0 deletions public/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: |
an independent binary distribution across ALL platforms that Go supports,
including Linux, Mac OS X, Windows and ARM.

icon: public/img/gitea-lg.png
icon: public/img/logo-lg.png
confinement: strict
base: core18
adopt-info: gitea
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/hook_new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{end}}
<div class="ui right">
{{if eq .HookType "gitea"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea-sm.png">
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg">
{{else if eq .HookType "gogs"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico">
{{else if eq .HookType "slack"}}
Expand Down
6 changes: 3 additions & 3 deletions templates/base/head.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
</script>
<link rel="icon" href="{{StaticUrlPrefix}}/img/favicon.svg" type="image/svg+xml">
<link rel="alternate icon" href="{{StaticUrlPrefix}}/img/favicon.png" type="image/png">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/gitea-safari.svg" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/logo-safari.svg" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/logo-lg.png" title="{{AppName}}">
{{if .RequireSimpleMDE}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/easymde.css?v={{MD5 AppVer}}">
{{end}}
Expand Down Expand Up @@ -104,7 +104,7 @@
{{else}}
<meta property="og:title" content="{{AppName}}">
<meta property="og:type" content="website" />
<meta property="og:image" content="{{StaticUrlPrefix}}/img/gitea-lg.png" />
<meta property="og:image" content="{{StaticUrlPrefix}}/img/logo-lg.png" />
<meta property="og:url" content="{{AppUrl}}" />
<meta property="og:description" content="{{MetaDescription}}">
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion templates/base/head_navbar.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="ui container" id="navbar">
<div class="item brand" style="justify-content: space-between;">
<a href="{{AppSubUrl}}/">
<img class="ui mini image" src="{{StaticUrlPrefix}}/img/gitea-sm.png">
<img class="ui mini image" src="{{StaticUrlPrefix}}/img/logo.svg">
</a>
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
<i class="sidebar icon"></i>
Expand Down
2 changes: 1 addition & 1 deletion templates/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide center aligned centered column">
<div>
<img class="logo" src="{{StaticUrlPrefix}}/img/gitea-lg.png" />
<img class="logo" src="{{StaticUrlPrefix}}/img/logo.svg" />
</div>
<div class="hero">
<h1 class="ui icon header title">
Expand Down
2 changes: 1 addition & 1 deletion templates/org/settings/hook_new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
<div class="ui right">
{{if eq .HookType "gitea"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea-sm.png">
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg">
{{else if eq .HookType "gogs"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico">
{{else if eq .HookType "slack"}}
Expand Down
8 changes: 4 additions & 4 deletions templates/pwa/manifest_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
"name": "Gitea - Git with a cup of tea",
"icons": [
{
"src": "{{StaticUrlPrefix}}/img/gitea-lg.png",
"src": "{{StaticUrlPrefix}}/img/logo-lg.png",
"type": "image/png",
"sizes": "880x880"
},
{
"src": "{{StaticUrlPrefix}}/img/gitea-sm.png",
"src": "{{StaticUrlPrefix}}/img/logo-sm.png",
"type": "image/png",
"sizes": "120x120"
},
{
"src": "{{StaticUrlPrefix}}/img/gitea-512.png",
"src": "{{StaticUrlPrefix}}/img/logo-512.png",
"type": "image/png",
"sizes": "512x512"
},
{
"src": "{{StaticUrlPrefix}}/img/gitea-192.png",
"src": "{{StaticUrlPrefix}}/img/logo-192.png",
"type": "image/png",
"sizes": "192x192"
}
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/settings/webhook/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div>
<div class="menu">
<a class="item" href="{{.BaseLink}}/gitea/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/gitea-sm.png">Gitea
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/gitea.svg">Gitea
</a>
<a class="item" href="{{.BaseLink}}/gogs/new">
<img width="20" height="20" src="{{StaticUrlPrefix}}/img/gogs.ico">Gogs
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/settings/webhook/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
<div class="ui right">
{{if eq .HookType "gitea"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea-sm.png">
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg">
{{else if eq .HookType "gogs"}}
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico">
{{else if eq .HookType "slack"}}
Expand Down