Simpler Custom Logo Workflow #6512

Closed
opened 2025-11-02 06:58:10 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @kdumontnu on GitHub (Dec 12, 2020).

  • Gitea version (or commit ref): develop, ee7133d135

Description

generate-images.js (which is an incredible piece of code!) creates logo pngs with 'gitea' in the title (ex. gitea-lg.png). I propose we use generic naming 'logo' (ex. logo-lg.png) to allow users to take advantage of the generate-images code and update the logo without having to customize the template file for each logo image reference.

Specifically, users would be able to replace assets/logo.svg with a custom logo and run make generate-images to have the logo updated across the app. Admittedly, we COULD use the code as is, but the logo name reference gitea... would technically not be correct.

I would add that this might be considered a breaking change, as it would result in many existing HTML template references to break. I'm not sure if the gitea community considers this when creating releases.

I'm happy to implement a change if I can get some initial feedback.

Ex. code from home.tmpl

{{template "base/head" .}}
<div class="home">
	<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" />
			</div>
			<div class="hero">
				<h1 class="ui icon header title">
					{{AppName}}
				</h1>
				<h2>{{.i18n.Tr "startpage.app_desc"}}</h2>
			</div>
		</div>
	</div>
Originally created by @kdumontnu on GitHub (Dec 12, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): develop, ee7133d135e1bf746ccd558371edd4fcdf185e7f ## Description `generate-images.js` (which is an incredible piece of code!) creates logo pngs with 'gitea' in the title (ex. `gitea-lg.png`). I propose we use generic naming 'logo' (ex. `logo-lg.png`) to allow users to take advantage of the `generate-images` code and update the logo without having to customize the template file for each logo image reference. Specifically, users would be able to replace `assets/logo.svg` with a custom logo and run `make generate-images` to have the logo updated across the app. Admittedly, we COULD use the code as is, but the logo name reference `gitea...` would technically not be correct. I would add that this might be considered a breaking change, as it would result in many existing HTML template references to break. I'm not sure if the gitea community considers this when creating releases. I'm happy to implement a change if I can get some initial feedback. Ex. code from `home.tmpl` ``` {{template "base/head" .}} <div class="home"> <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" /> </div> <div class="hero"> <h1 class="ui icon header title"> {{AppName}} </h1> <h2>{{.i18n.Tr "startpage.app_desc"}}</h2> </div> </div> </div> ```
GiteaMirror added the pr/breakingtype/refactoring labels 2025-11-02 06:58:10 -06:00
Author
Owner

@zeripath commented on GitHub (Dec 12, 2020):

Unfortunately we break templates all the time as they're still rather tightly integrated with our rendering code. Therefore this proposal is a +1 from me.

@zeripath commented on GitHub (Dec 12, 2020): Unfortunately we break templates all the time as they're still rather tightly integrated with our rendering code. Therefore this proposal is a +1 from me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6512