make frontmatter parser more "DRYer"

This commit is contained in:
Henrique Dias
2015-09-17 15:38:04 +01:00
parent f2362a6dcf
commit 992f1c2c01
8 changed files with 93 additions and 83 deletions

View File

@@ -10,7 +10,6 @@ import (
"github.com/hacdias/caddy-hugo/frontmatter"
"github.com/hacdias/caddy-hugo/page"
"github.com/spf13/hugo/commands"
)
// Execute the page
@@ -46,10 +45,6 @@ func Execute(w http.ResponseWriter, r *http.Request) (int, error) {
w.Header().Set("Content-Type", "application/json")
w.Write([]byte("{}"))
if r.Header.Get("X-Save-Mode") == "publish" {
commands.Execute()
}
} else {
content, err := ioutil.ReadFile("config." + language)