mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 22:21:07 +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
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/spf13/hugo/target"
|
||||
"github.com/spf13/hugo/tpl"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -419,6 +420,10 @@ func doTest404ShouldAlwaysHaveUglyUrls(t *testing.T, uglyURLs bool) {
|
|||
{filepath.FromSlash("sitemap.xml"), "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n<root>SITEMAP</root>"},
|
||||
}
|
||||
|
||||
for _, p := range s.Pages {
|
||||
assert.False(t, p.IsHome)
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
file, err := hugofs.DestinationFS.Open(test.doc)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue