1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-30 08:48:59 +01:00

variables subcommand converts []byte to string

This commit is contained in:
Oliver Steele 2017-08-09 09:29:37 -04:00
parent 3c98743ec2
commit 0d4d05f9ca

View File

@ -8,7 +8,7 @@ import (
"strings"
"time"
yaml "gopkg.in/yaml.v2"
yaml "gopkg.in/yaml.v1"
"github.com/montanaflynn/stats"
"github.com/osteele/gojekyll/pages"
@ -159,7 +159,15 @@ func variablesCommand(site *site.Site) (err error) {
default:
data = site
}
b, err := yaml.Marshal(liquid.FromDrop(data))
data = liquid.FromDrop(data)
if m, ok := data.(map[string]interface{}); ok {
for k, v := range m {
if b, ok := v.([]byte); ok {
m[k] = string(b)
}
}
}
b, err := yaml.Marshal(data)
if err != nil {
return err
}