You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
update url routing, simplify; new templates
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/hacdias/caddy-hugo/page"
|
||||
"github.com/spf13/hugo/commands"
|
||||
@@ -15,7 +16,9 @@ type fileInfo struct {
|
||||
}
|
||||
|
||||
// Execute sth
|
||||
func Execute(w http.ResponseWriter, r *http.Request, filename string) (int, error) {
|
||||
func Execute(w http.ResponseWriter, r *http.Request) (int, error) {
|
||||
filename := strings.Replace(r.URL.Path, "edit/", "", 1)
|
||||
|
||||
if r.Method == "POST" {
|
||||
r.ParseForm()
|
||||
err := ioutil.WriteFile(filename, []byte(r.Form["content"][0]), 0666)
|
||||
|
||||
Reference in New Issue
Block a user