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 @@ {{ .Title }} - + + {{ template "navbar" . }} {{ template "body" . }} {{ template "footer" . }} - + {{ end }} diff --git a/src/pages/about.tmpl b/src/pages/about.tmpl index 3af316d..1f04cc6 100644 --- a/src/pages/about.tmpl +++ b/src/pages/about.tmpl @@ -1,6 +1,6 @@ {{ define "head" }} - + {{ end }} diff --git a/src/pages/home.tmpl b/src/pages/home.tmpl index 24d8545..ffc6c46 100644 --- a/src/pages/home.tmpl +++ b/src/pages/home.tmpl @@ -1,6 +1,6 @@ {{ define "head" }} - + {{ end }} @@ -12,7 +12,7 @@

MBot is a new Discord bot that allows you do powerful moderation, play music with your friends, and is built to do way more in the future! This project is currentaly in alpha and MBot is very limited, please wait paintely for new updates comming your way! 😎

- Bot Profile + Bot Profile
@@ -23,14 +23,14 @@

Powerful Moderation!

Moderate your server with ban or kick commands – this will get rid of any naughty people that break your server rules! You can also manage messages using the clear command – this will get rid of a big chunk of messages that you may not want on your server.

- Bot Moderation + Bot Moderation
  • Music!

    Play music from YouTube with our bot for free! Control your music how youd like by skipping, pausing, or stopping the queue entirely, to play what you want on your server! You may also look at what the queue is storing for your server.

    - Bot Music + Bot Music
  • diff --git a/src/styles/home.css b/src/styles/home.css index 765fc47..42d1951 100644 --- a/src/styles/home.css +++ b/src/styles/home.css @@ -7,7 +7,7 @@ header { margin-bottom: 0; width: calc(100% + 2 * var(--pad)); height: 600px; - background: #103161 no-repeat center / cover url(/src/assets/home/header-background.svg); + background: #103161 no-repeat center / cover url(../assets/home/header-background.svg); #header-wrapped-content { display: flex; @@ -87,7 +87,7 @@ header { justify-content: center; width: 100%; height: 350px; - background: #1e7ebf no-repeat center / cover url(/src/assets/home/invite-banner.svg); + background: #1e7ebf no-repeat center / cover url(../assets/home/invite-banner.svg); border-radius: 20px; text-align: center; diff --git a/src/styles/main.css b/src/styles/main.css index 81dc4cc..f58ccf8 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -1,18 +1,18 @@ @font-face { font-family: Poppins; - src: url(/src/fonts/poppins/Poppins-Medium.ttf); + src: url(../fonts/poppins/Poppins-Medium.ttf); font-weight: 400; } @font-face { font-family: Poppins; - src: url(/src/fonts/poppins/Poppins-Light.ttf); + src: url(../fonts/poppins/Poppins-Light.ttf); font-weight: 200; } @font-face { font-family: Poppins; - src: url(/src/fonts/poppins/Poppins-Bold.ttf); + src: url(../fonts/poppins/Poppins-Bold.ttf); font-weight: 800; }