update to caddy 0.9b2
parent
886f396d8f
commit
67f475ce42
|
@ -1,5 +1,18 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var deleteHandler = function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
let name = this.dataset.delete;
|
||||||
|
|
||||||
|
let element = document.getElementById(name);
|
||||||
|
document.removeChild(element);
|
||||||
|
|
||||||
|
//$('label[for="' + name + '"]').fadeOut().remove();
|
||||||
|
// $('#' + name).fadeOut().remove();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function(event) {
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
//alert("hugo is working");
|
//alert("hugo is working");
|
||||||
|
|
||||||
|
|
3
post.go
3
post.go
|
@ -4,7 +4,6 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -36,8 +35,6 @@ func (h Hugo) POST(w http.ResponseWriter, r *http.Request, filename string) (int
|
||||||
rawBuffer.ReadFrom(r.Body)
|
rawBuffer.ReadFrom(r.Body)
|
||||||
err := json.Unmarshal(rawBuffer.Bytes(), &data)
|
err := json.Unmarshal(rawBuffer.Bytes(), &data)
|
||||||
|
|
||||||
fmt.Println(string(rawBuffer.Bytes()))
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return RespondJSON(w, &response{"Error decrypting json."}, http.StatusInternalServerError, err)
|
return RespondJSON(w, &response{"Error decrypting json."}, http.StatusInternalServerError, err)
|
||||||
}
|
}
|
||||||
|
|
11
setup.go
11
setup.go
|
@ -24,7 +24,7 @@ func init() {
|
||||||
// Setup is the init function of Caddy plugins and it configures the whole
|
// Setup is the init function of Caddy plugins and it configures the whole
|
||||||
// middleware thing.
|
// middleware thing.
|
||||||
func setup(c *caddy.Controller) error {
|
func setup(c *caddy.Controller) error {
|
||||||
cnf := httpserver.GetConfig(c.Key)
|
cnf := httpserver.GetConfig(c)
|
||||||
conf, _ := ParseHugo(c, cnf.Root)
|
conf, _ := ParseHugo(c, cnf.Root)
|
||||||
|
|
||||||
// Checks if there is an Hugo website in the path that is provided.
|
// Checks if there is an Hugo website in the path that is provided.
|
||||||
|
@ -61,10 +61,11 @@ func setup(c *caddy.Controller) error {
|
||||||
Next: next,
|
Next: next,
|
||||||
Configs: []filemanager.Config{
|
Configs: []filemanager.Config{
|
||||||
filemanager.Config{
|
filemanager.Config{
|
||||||
PathScope: conf.Root,
|
HugoEnabled: true,
|
||||||
Root: http.Dir(conf.Root),
|
PathScope: conf.Root,
|
||||||
BaseURL: conf.BaseURL,
|
Root: http.Dir(conf.Root),
|
||||||
StyleSheet: conf.Styles,
|
BaseURL: conf.BaseURL,
|
||||||
|
StyleSheet: conf.Styles,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue