diff options
author | Vas Sudanagunta <[email protected]> | 2018-05-29 21:35:27 -0400 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2018-07-18 00:07:20 +0200 |
commit | b93417aa1d3d38a9e56bad25937e0e638a113faf (patch) | |
tree | 86d0ab6972b845b81204516c2716c597e851c03c /hugolib/disableKinds_test.go | |
parent | fd1f4a7860c4b989865b47c727239cf924a52fa4 (diff) | |
download | hugo-b93417aa1d3d38a9e56bad25937e0e638a113faf.tar.gz hugo-b93417aa1d3d38a9e56bad25937e0e638a113faf.zip |
Unify page lookups
This commit unifies the core internal page index for all page kinds.
This enables the `ref` and `relref` shortcodes to support all pages kinds, and adds a new page-relative `.GetPage` method with simplified signature.
See #4147
See #4727
See #4728
See #4728
See #4726
See #4652
Diffstat (limited to 'hugolib/disableKinds_test.go')
-rw-r--r-- | hugolib/disableKinds_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hugolib/disableKinds_test.go b/hugolib/disableKinds_test.go index edada1419..d94307e46 100644 --- a/hugolib/disableKinds_test.go +++ b/hugolib/disableKinds_test.go @@ -130,7 +130,7 @@ func assertDisabledKinds(th testHelper, s *Site, disabled ...string) { }, disabled, KindPage, "public/sect/p1/index.html", "Single|P1") assertDisabledKind(th, func(isDisabled bool) bool { - p := s.getPage(KindHome) + p, _ := s.getPage(nil, "/") if isDisabled { return p == nil } @@ -138,7 +138,7 @@ func assertDisabledKinds(th testHelper, s *Site, disabled ...string) { }, disabled, KindHome, "public/index.html", "Home") assertDisabledKind(th, func(isDisabled bool) bool { - p := s.getPage(KindSection, "sect") + p, _ := s.getPage(nil, "sect") if isDisabled { return p == nil } @@ -146,7 +146,7 @@ func assertDisabledKinds(th testHelper, s *Site, disabled ...string) { }, disabled, KindSection, "public/sect/index.html", "Sects") assertDisabledKind(th, func(isDisabled bool) bool { - p := s.getPage(KindTaxonomy, "tags", "tag1") + p, _ := s.getPage(nil, "tags/tag1") if isDisabled { return p == nil @@ -156,7 +156,7 @@ func assertDisabledKinds(th testHelper, s *Site, disabled ...string) { }, disabled, KindTaxonomy, "public/tags/tag1/index.html", "Tag1") assertDisabledKind(th, func(isDisabled bool) bool { - p := s.getPage(KindTaxonomyTerm, "tags") + p, _ := s.getPage(nil, "tags") if isDisabled { return p == nil } @@ -165,7 +165,7 @@ func assertDisabledKinds(th testHelper, s *Site, disabled ...string) { }, disabled, KindTaxonomyTerm, "public/tags/index.html", "Tags") assertDisabledKind(th, func(isDisabled bool) bool { - p := s.getPage(KindTaxonomyTerm, "categories") + p, _ := s.getPage(nil, "categories") if isDisabled { return p == nil @@ -175,7 +175,7 @@ func assertDisabledKinds(th testHelper, s *Site, disabled ...string) { }, disabled, KindTaxonomyTerm, "public/categories/index.html", "Category Terms") assertDisabledKind(th, func(isDisabled bool) bool { - p := s.getPage(KindTaxonomy, "categories", "hugo") + p, _ := s.getPage(nil, "categories/hugo") if isDisabled { return p == nil } |