new updates

This commit is contained in:
Henrique Dias
2016-01-31 22:14:17 +00:00
parent f66f5af562
commit 94a71a6eb3
22 changed files with 548 additions and 910 deletions

View File

@@ -72,7 +72,7 @@ func GET(w http.ResponseWriter, r *http.Request, c *config.Config, filename stri
// Parses the page content and the frontmatter
page.Content = strings.TrimSpace(string(file.Content()))
page.FrontMatter, err = frontmatter.Pretty(file.FrontMatter())
page.FrontMatter, page.Name, err = frontmatter.Pretty(file.FrontMatter())
page.Class = "complete"
} else {
// The editor will handle only content
@@ -86,9 +86,9 @@ func GET(w http.ResponseWriter, r *http.Request, c *config.Config, filename stri
// Checks if the file already has the frontmatter rune and parses it
if hasFrontMatterRune(file) {
page.FrontMatter, err = frontmatter.Pretty(file)
page.FrontMatter, _, err = frontmatter.Pretty(file)
} else {
page.FrontMatter, err = frontmatter.Pretty(appendFrontMatterRune(file, page.Mode))
page.FrontMatter, _, err = frontmatter.Pretty(appendFrontMatterRune(file, page.Mode))
}
// Check if there were any errors