mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 06:30:33 +03: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:
parent
fd1f4a7860
commit
b93417aa1d
16 changed files with 294 additions and 153 deletions
|
@ -68,8 +68,8 @@ func TestMergeLanguages(t *testing.T) {
|
|||
assert.Equal(4, len(firstNN.Sites()))
|
||||
assert.Equal("en", firstNN.Sites().First().Language.Lang)
|
||||
|
||||
nnBundle := nnSite.getPage("page", "bundle")
|
||||
enBundle := enSite.getPage("page", "bundle")
|
||||
nnBundle, _ := nnSite.getPage(nil, "bundle")
|
||||
enBundle, _ := enSite.getPage(nil, "bundle")
|
||||
|
||||
assert.Equal(6, len(enBundle.Resources))
|
||||
assert.Equal(2, len(nnBundle.Resources))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue