Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Code

392 commit(s) on main

Merge change request 01M70WES5ZZDJ6RP226WB11BBZ: Let people rename and remove their own passkeys keenan · 1h ago 4b8c9e1d
history blame raw 1.2 KiB
1package web
2
3// File icons are a small extension table rather than a language detector: they
4// decorate the tree and the directory list, and a wrong colour is a hint, not a
5// fact the page depends on.
6
7import (
8 "path"
9 "strings"
10)
11
12func fileIcon(name string) string {
13 ext := strings.ToLower(path.Ext(name))
14 switch ext {
15 case ".go", ".rs", ".js", ".mjs", ".cjs", ".jsx", ".ts", ".tsx", ".py",
16 ".rb", ".java", ".c", ".h", ".cc", ".cpp", ".cxx", ".hpp", ".cs",
17 ".php", ".swift", ".kt", ".scala", ".lua", ".pl", ".ex", ".exs":
18 return "file-code"
19 case ".sh", ".bash", ".zsh", ".fish":
20 return "terminal"
21 case ".md", ".markdown", ".mdown", ".mkd", ".txt", ".rst":
22 return "book-open"
23 case ".json", ".yaml", ".yml", ".toml", ".ini", ".xml", ".conf":
24 return "sliders-horizontal"
25 case ".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".ico":
26 return "image"
27 case ".lock":
28 return "lock"
29 }
30 switch strings.ToLower(name) {
31 case "dockerfile", "containerfile", "makefile", "makefile.am", "cmakelists.txt":
32 return "server"
33 case "go.mod", "go.sum":
34 return "file-code"
35 case ".gitignore", ".gitattributes", ".editorconfig":
36 return "sliders-horizontal"
37 }
38 return "file"
39}
40