diff --git a/caddyhugo.go b/caddyhugo.go index ca39304..2f9926c 100644 --- a/caddyhugo.go +++ b/caddyhugo.go @@ -477,7 +477,7 @@ func (ch CaddyHugo) NewContent(w http.ResponseWriter, r *http.Request) (int, err } // serve redirect - http.Redirect(w, r, filepath.Join("/hugo/edit/", ch.Site.Root, "content", filename), http.StatusFound) + http.Redirect(w, r, filepath.Join("/hugo/edit/", "content", filename), http.StatusFound) return http.StatusFound, nil } diff --git a/templates.go b/templates.go index 689ee32..b5443fb 100644 --- a/templates.go +++ b/templates.go @@ -7,6 +7,7 @@ import ( "os" "path" "path/filepath" + "strings" "git.stephensearles.com/stephen/acedoc" @@ -106,23 +107,18 @@ func baseNoExt(name string) string { func (t tmplData) IframeSource() string { name := baseNoExt(t.docref.name) ctype := baseNoExt(path.Dir(t.docref.name)) - return fmt.Sprintf("/hugo/draft/%s/%s/%s/", base64.RawURLEncoding.EncodeToString([]byte(t.docref.name)), ctype, name) + return fmt.Sprintf("/hugo/draft/%s/%s/%s/", base64.RawURLEncoding.EncodeToString([]byte(t.docref.name)), ctype, strings.Replace(name, " ", "-", -1)) } var EditPage = ` - - - - -