You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
fix #2
This commit is contained in:
@@ -12,6 +12,24 @@ import (
|
||||
"github.com/hacdias/caddy-hugo/assets"
|
||||
)
|
||||
|
||||
// CanBeEdited checks if a filename has a supported extension
|
||||
func CanBeEdited(filename string) bool {
|
||||
extensions := [...]string{".markdown", ".md",
|
||||
".json", ".toml", ".yaml",
|
||||
".css", ".sass", ".scss",
|
||||
".js",
|
||||
".html",
|
||||
}
|
||||
|
||||
for _, extension := range extensions {
|
||||
if strings.HasSuffix(filename, extension) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// GetTemplate is used to get a ready to use template based on the url and on
|
||||
// other sent templates
|
||||
func GetTemplate(r *http.Request, functions template.FuncMap, templates ...string) (*template.Template, error) {
|
||||
|
||||
Reference in New Issue
Block a user