fixed a couple minor bugs
This commit is contained in:
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
+8
-10
@@ -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 = `<html>
|
||||
<head>
|
||||
<script src="/hugo/simplemde.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/ace.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/ext-settings_menu.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/ext-keybinding_menu.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/keybinding-vim.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/mode-markdown.js"></script>
|
||||
<style type="text/css" media="screen">
|
||||
#editor {
|
||||
#editor-wrapper {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
bottom: 150px;
|
||||
left: 40%;
|
||||
}
|
||||
#draft {
|
||||
@@ -151,8 +147,10 @@ var EditPage = `<html>
|
||||
<span v-else>saved</span>
|
||||
<span v-if="connectionError">, ${connectionError}</span>
|
||||
</div>
|
||||
<textarea id="editor">{{ .LoadContent }}</textarea>
|
||||
<div id="draft"><!--<iframe src="{{ .IframeSource }}">Loading draft...</iframe>--></div>
|
||||
<div id="editor-wrapper">
|
||||
<textarea id="editor">{{ .LoadContent }}</textarea>
|
||||
</div>
|
||||
<div id="draft"><iframe src="{{ .IframeSource }}">Loading draft...</iframe></div>
|
||||
</div>
|
||||
<script>
|
||||
var uiBindings = {
|
||||
|
||||
Reference in New Issue
Block a user