diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -19,6 +19,7 @@ import ( "net/url" "os" "os/exec" + "path" "regexp" "strconv" "strings" @@ -51,6 +52,8 @@ var MediaHashs = make(map[string]string) var ActorCache = make(map[string]Actor) +var Themes []string + func main() { CreatedNeededDirectories() @@ -84,6 +87,22 @@ func main() { } } + // get list of themes + themes, err := ioutil.ReadDir("./static/css/themes") + if err != nil { + panic(err) + } + + for _, f := range themes { + if f.Name() == "default" { + continue + } + + if e := path.Ext(f.Name()); e == ".css" { + Themes = append(Themes, strings.TrimSuffix(f.Name(), e)) + } + } + // Allow access to public media folder fileServer := http.FileServer(http.Dir("./public")) http.Handle("/public/", http.StripPrefix("/public", neuter(fileServer))) |