Skip to content

Enable the possibility to load a favicon which differs from the logo #18541

Closed
@je-s

Description

@je-s

Feature Description

After following this instructions, you've successfully changed the logo. However there are scenarios, where you (i.e.) want the favicon to have a background for better visibility in a Desktop, whereas your main logo has no background at all.

My first attempt was to try and overwrite

<link rel="icon" href="/assets/img/logo.svg" type="image/svg+xml">
<link rel="alternate icon" href="/assets/img/favicon.png" type="image/png">

with other files/filenames (which I've dropped in the public/img folder in gitea just like all other custom content) via header.tmpl. But despite the injection being successful, that doesn't work since the favicon's get set and loaded earlier in the page building process. You can not overwrite this/alter this after the initial page buildup.

My idea would be to just easily alter <link rel="icon" href="/assets/img/logo.svg" type="image/svg+xml"> to <link rel="icon" href="/assets/img/favicon.svg" type="image/svg+xml"> here.

Adjusting that and copying the icon.svg to favicon.svg would make this work out of the box, and users would be able to adjust the favicon to their likes, in case they want a favicon which differs from their main logo.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions