progresses on #23
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
// ServeHTTP serves the editor page
|
||||
func ServeHTTP(w http.ResponseWriter, r *http.Request, c *config.Config) (int, error) {
|
||||
filename := strings.Replace(r.URL.Path, "/admin/edit/", "", 1)
|
||||
filename = c.Path + filename
|
||||
|
||||
switch r.Method {
|
||||
case "POST":
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ func GET(w http.ResponseWriter, r *http.Request, c *config.Config, filename stri
|
||||
// Create a new editor variable and set the extension
|
||||
page := new(editor)
|
||||
page.Mode = strings.TrimPrefix(filepath.Ext(filename), ".")
|
||||
page.Name = filename
|
||||
page.Name = strings.Replace(filename, c.Path, "", 1)
|
||||
page.Config = c
|
||||
page.IsPost = false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user