some updates related to #28
This commit is contained in:
@@ -29,11 +29,12 @@ func Pretty(content []byte) (interface{}, error) {
|
||||
}
|
||||
|
||||
type frontmatter struct {
|
||||
Name string
|
||||
Title string
|
||||
Content interface{}
|
||||
Type string
|
||||
Parent *frontmatter
|
||||
Name string
|
||||
Title string
|
||||
Content interface{}
|
||||
Type string
|
||||
HTMLType string
|
||||
Parent *frontmatter
|
||||
}
|
||||
|
||||
func rawToPretty(config interface{}, parent *frontmatter) interface{} {
|
||||
@@ -129,6 +130,15 @@ func handleFlatValues(content interface{}, parent *frontmatter, name string) *fr
|
||||
c.Type = "string"
|
||||
}
|
||||
|
||||
switch strings.ToLower(name) {
|
||||
case "description":
|
||||
c.HTMLType = "textarea"
|
||||
case "date", "publishdate":
|
||||
c.HTMLType = "datetime"
|
||||
default:
|
||||
c.HTMLType = "text"
|
||||
}
|
||||
|
||||
if parent.Type == "array" {
|
||||
c.Name = parent.Name + "[]"
|
||||
c.Title = content.(string)
|
||||
|
||||
Reference in New Issue
Block a user