Switching to the rjson library which is more friendly to human generated json.

This commit is contained in:
spf13
2013-10-01 22:45:24 -04:00
parent 48e1068e3e
commit 18f2b82658
4 changed files with 22 additions and 4 deletions

View File

@@ -15,7 +15,6 @@ package hugolib
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"github.com/BurntSushi/toml"
@@ -26,11 +25,12 @@ import (
"html/template"
"io"
"launchpad.net/goyaml"
json "launchpad.net/rjson"
"net/url"
"path"
"sort"
"strings"
"time"
"net/url"
)
type Page struct {
@@ -467,4 +467,3 @@ func (p *Page) TargetPath() (outfile string) {
return path.Join(p.Dir, strings.TrimSpace(outfile))
}

View File

@@ -49,6 +49,21 @@ Leading
"slug": "spf13-vim-3-0-release-and-new-website"
}
Content of the file goes Here
`
SIMPLE_PAGE_JSON_LOOSE = `
{
"title": "spf13-vim 3.0 release and new website"
"description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
"tags": [ ".vimrc", "plugins", "spf13-vim", "vim" ]
"date": "2012-04-06"
"categories": [
"Development"
"VIM"
],
"slug": "spf13-vim-3-0-release-and-new-website"
}
Content of the file goes Here
`
SIMPLE_PAGE_RFC3339_DATE = "---\ntitle: RFC3339 Date\ndate: \"2013-05-17T16:59:30Z\"\n---\nrfc3339 content"
@@ -223,6 +238,7 @@ func TestCreatePage(t *testing.T) {
r string
}{
{SIMPLE_PAGE_JSON},
{SIMPLE_PAGE_JSON_LOOSE},
{SIMPLE_PAGE_JSON_MULTIPLE},
//{strings.NewReader(SIMPLE_PAGE_JSON_COMPACT)},
}