diff --git a/entry.go b/entry.go index 11ee555..376f367 100644 --- a/entry.go +++ b/entry.go @@ -103,8 +103,6 @@ func createEntryFromValueMap(values map[string][]string) (*Entry, error) { } func computeExtraSettings(entry *Entry) error { - now := time.Now() - entry.section = "micro" // Find settings hidden in content var filteredContent bytes.Buffer contentScanner := bufio.NewScanner(strings.NewReader(entry.content)) @@ -142,7 +140,7 @@ func computeExtraSettings(entry *Entry) error { } } entry.content = filteredContent.String() - + now := time.Now() // Compute slug if empty if len(entry.slug) == 0 || entry.slug == "" { random := generateRandomString(now, 5) @@ -153,6 +151,10 @@ func computeExtraSettings(entry *Entry) error { if err != nil { return err } + if len(entry.section) < 1 { + entry.section = "micro" + } + entry.section = strings.ToLower(entry.section) if entry.section == "posts" { entry.filename = "content/" + entry.section + "/" + entry.slug + ".md" entry.location = blogURL + entry.section + "/" + entry.slug