mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
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
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
fd1f4a7860
commit
b93417aa1d
@@ -150,7 +150,7 @@ Len Pages: {{ .Kind }} {{ len .Site.RegularPages }} Page Number: {{ .Paginator.P
|
||||
s := h.Sites[0]
|
||||
require.Equal(t, "en", s.Language.Lang)
|
||||
|
||||
home := s.getPage(KindHome)
|
||||
home, _ := s.getPage(nil, "/")
|
||||
|
||||
require.NotNil(t, home)
|
||||
|
||||
@@ -325,7 +325,7 @@ baseName = "customdelimbase"
|
||||
th.assertFileContent("public/customdelimbase_del", "custom delim")
|
||||
|
||||
s := h.Sites[0]
|
||||
home := s.getPage(KindHome)
|
||||
home, _ := s.getPage(nil, "/")
|
||||
require.NotNil(t, home)
|
||||
|
||||
outputs := home.OutputFormats()
|
||||
|
Reference in New Issue
Block a user