diff --git a/main.go b/main.go index 45257ad..9a6178b 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,11 @@ var data = &Index { Title: "MBot", } +func fileHandler(file string, path string) { + fs := http.FileServer(http.Dir("./" + file)) + http.Handle("/" + path + "/", http.StripPrefix("/" + path + "/", fs)) +} + func aboutHandler(w http.ResponseWriter, req *http.Request) { templates := template.Must(template.ParseFiles( "src/index.tmpl", @@ -50,8 +55,10 @@ func main() { log.Fatal("Template file does not exist:\n", err) } - fs := http.FileServer(http.Dir("./src/")) - http.Handle("/src/", http.StripPrefix("/src/", fs)) + fileHandler("src/assets", "assets"); + fileHandler("src/styles", "styles"); + fileHandler("src/scripts", "scripts"); + fileHandler("src/fonts", "fonts"); port := ":3939" diff --git a/src/assets/main/botprofilehighres.png b/src/assets/main/botprofilehighres.png new file mode 100644 index 0000000..aaf7186 Binary files /dev/null and b/src/assets/main/botprofilehighres.png differ diff --git a/src/assets/main/favicon.ico b/src/assets/main/favicon.ico new file mode 100644 index 0000000..31588a2 Binary files /dev/null and b/src/assets/main/favicon.ico differ diff --git a/src/index.tmpl b/src/index.tmpl index d8c16f0..839402b 100644 --- a/src/index.tmpl +++ b/src/index.tmpl @@ -6,13 +6,14 @@