diff --git a/browse/post.go b/browse/post.go index b0f09c7f..6e3280d8 100644 --- a/browse/post.go +++ b/browse/post.go @@ -132,6 +132,8 @@ func upload(w http.ResponseWriter, r *http.Request) (int, error) { w.Write([]byte(err.Error())) return http.StatusInternalServerError, err } + + defer outfile.Close() } } diff --git a/docs.html b/docs.html deleted file mode 100644 index 4c0e67e6..00000000 --- a/docs.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - hugo - Caddy Directives - {{.Include "/includes/docs-head.html"}} - - -
-

hugo
Addon

- -
-
Addon
- This directive is a Caddy extension. Questions should be directed to its maintainer. github.com/hacdias/caddy-hugo -
- -

- hugo allows you to deploy and manage a static site with an web-based admin interface where you can edit content, schedule posts, upload files, etc. The admin interface will be available at /admin on your website. It is built to be used with Hugo - which is bundled with the plugin so you don't have to install it separately. -

- -

- Requirements: this add-on does not create a new Hugo site for you; you'll need to run hugo new site if you don't already have a Hugo site. -

- -

Syntax

- root public -hugo dir { - styles file - args cmd -} - - - -

- All of the directives above are optional. -

- -

- To schedule a post, its date field must be in '2006-01-02 15:04:05-07:00' format. -

- -

- This directive should be used with root, basicauth and errors middleware to have the best experience. See the examples to know more. -

- -

Examples

- -

- A simple configuration to use with Hugo static website generator: -

- - localhost:8080 # website URL and port - -root public # the folder where Hugo generates the website -basicauth /admin user pass # protect the admin area using HTTP basic auth -hugo # enable the admin panel - - -
- - {{.Include "/includes/docs-nav.html"}} - - diff --git a/editor/post.go b/editor/post.go index 5d8b2967..89384e3c 100644 --- a/editor/post.go +++ b/editor/post.go @@ -117,7 +117,7 @@ func parseCompleteFile(r *http.Request, c *config.Config, rawFile map[string]int // Schedule the post if r.Header.Get("X-Schedule") == "true" { - t, err := time.Parse("http.StatusOK6-01-02 15:04:05-07:00", rawFile["date"].(string)) + t, err := time.Parse("2006-01-02 15:04:05-07:00", rawFile["date"].(string)) if err != nil { return []byte{}, http.StatusInternalServerError, err