package hugolib
import (
"fmt"
"html/template"
"path/filepath"
"reflect"
"sort"
"strings"
"testing"
"time"
"github.com/spf13/cast"
"github.com/spf13/hugo/helpers"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
)
var EMPTY_PAGE = ""
const (
SIMPLE_PAGE = "---\ntitle: Simple\n---\nSimple Page\n"
INVALID_FRONT_MATTER_MISSING = "This is a test"
RENDER_NO_FRONT_MATTER = "
This is a test"
CONTENT_WITH_COMMENTED_FM = "\n\n# Network configuration\n\n##\nSummary"
CONTENT_WITH_COMMENTED_TEXT_FM = "\n\n# Network configuration\n\n##\nSummary"
CONTENT_WITH_COMMENTED_LONG_FM = "\n\n# Network configuration\n\n##\nSummary"
CONTENT_WITH_COMMENTED_LONG2_FM = "\n\n# Network configuration\n\n##\nSummary"
INVALID_FRONT_MATTER_SHORT_DELIM = `
--
title: Short delim start
---
Short Delim
`
INVALID_FRONT_MATTER_SHORT_DELIM_ENDING = `
---
title: Short delim ending
--
Short Delim
`
INVALID_FRONT_MATTER_LEADING_WS = `
---
title: Leading WS
---
Leading
`
SIMPLE_PAGE_JSON = `
{
"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_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"
SIMPLE_PAGE_JSON_MULTIPLE = `
{
"title": "foobar",
"customData": { "foo": "bar" },
"date": "2012-08-06"
}
Some text
`
SIMPLE_PAGE_JSON_COMPACT = `
{"title":"foobar","customData":{"foo":"bar"},"date":"2012-08-06"}
Text
`
SIMPLE_PAGE_NOLAYOUT = `---
title: simple_no_layout
---
No Layout called out`
SIMPLE_PAGE_LAYOUT_FOOBAR = `---
title: simple layout foobar
layout: foobar
---
Layout foobar`
SIMPLE_PAGE_TYPE_FOOBAR = `---
type: foobar
---
type foobar`
SIMPLE_PAGE_TYPE_LAYOUT = `---
type: barfoo
layout: buzfoo
---
type and layout set`
SIMPLE_PAGE_WITH_SUMMARY_DELIMITER = `---
title: Simple
---
Summary Next Line
Some more text
`
SIMPLE_PAGE_WITH_SHORTCODE_IN_SUMMARY = `---
title: Simple
---
Summary Next Line. {{