mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
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:
parent
a2462adca0
commit
fdf4dfd2a5
4 changed files with 29 additions and 6 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue