feat(ui): dedicated icon for CITATION file (#10873)

Fix forgejo/forgejo#7864

Screenshot:
https://codeberg.org/attachments/62fbd43e-fe08-45dd-97a6-224353fd94a9

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10873
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
This commit is contained in:
oliverpool 2026-01-17 10:10:56 +01:00 committed by 0ko
parent a2462adca0
commit fdf4dfd2a5
4 changed files with 29 additions and 6 deletions

View file

@ -118,9 +118,17 @@ func EntryIcon(entry *git.TreeEntry) string {
return "file-submodule"
}
if IsCitationFile(entry) {
return "cross-reference"
}
return "file"
}
func IsCitationFile(entry *git.TreeEntry) bool {
return entry.Name() == "CITATION.cff" || entry.Name() == "CITATION.bib"
}
// SetupGiteaRoot Sets GITEA_ROOT if it is not already set and returns the value
func SetupGiteaRoot() string {
giteaRoot := os.Getenv("GITEA_ROOT")