mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 06:30:33 +03:00
Add IsHome
To determine if a page is the "Home Page" has inspired lots of creativity in the template department. This commit makes it simpler: IsHome will tell the truth.
This commit is contained in:
parent
be6dfcc495
commit
be535832f7
4 changed files with 10 additions and 0 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
"github.com/spf13/cast"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var EMPTY_PAGE = ""
|
||||
|
@ -368,6 +369,8 @@ func TestCreateNewPage(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("Unable to create a page with frontmatter and body content: %s", err)
|
||||
}
|
||||
|
||||
assert.False(t, p.IsHome)
|
||||
checkPageTitle(t, p, "Simple")
|
||||
checkPageContent(t, p, "<p>Simple Page</p>\n")
|
||||
checkPageSummary(t, p, "Simple Page")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue