mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-02 22:52:51 +02:00
Switching to the rjson library which is more friendly to human generated json.
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
|
@@ -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)},
|
||||
}
|
||||
|
Reference in New Issue
Block a user