Added draft blogs

Fixed paths
This commit is contained in:
Caleb Gardner
2024-08-10 10:18:43 -05:00
parent da2db3ea9a
commit 55ae9a0f05
2 changed files with 9 additions and 11 deletions
+5 -8
View File
@@ -105,14 +105,11 @@ func mainHandle(w http.ResponseWriter, r *http.Request) {
return
}
spl := strings.Split(path, "/")
stat, err = os.Stat(filepath.Join(*webRoot, spl[0]))
if stat.IsDir() {
ind := filepath.Join(*webRoot, spl[0], "index.html")
stat, err = os.Stat(ind)
if err == nil {
http.ServeFile(w, r, ind)
return
}
ind := filepath.Join(*webRoot, spl[0], "index.html")
_, err = os.Stat(ind)
if err == nil {
http.ServeFile(w, r, ind)
return
}
blogHandle(w, r, path)
}