diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-06-28 10:27:39 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-06-29 10:14:19 +0200 |
commit | 7917961d59b0dc216e49f59dc0255f9b46534115 (patch) | |
tree | ee9a348c2555fdbbac8022ade50c5d440a81ae4e /hugolib/site_url_test.go | |
parent | 80ecb958951783eb03e23a81800102d0e33db6e1 (diff) | |
download | hugo-7917961d59b0dc216e49f59dc0255f9b46534115.tar.gz hugo-7917961d59b0dc216e49f59dc0255f9b46534115.zip |
Misc permalinks adjustments
* Move config loading to the page package
* Fix a lower bound panic for the `:sections` slice syntax.
* Always return the `:title`
* Add some permalinks integration tests
* Also see issues below
Fixes #9448
Fixes #11184
See #8523
Diffstat (limited to 'hugolib/site_url_test.go')
-rw-r--r-- | hugolib/site_url_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/hugolib/site_url_test.go b/hugolib/site_url_test.go index 62483093c..cb69be4ca 100644 --- a/hugolib/site_url_test.go +++ b/hugolib/site_url_test.go @@ -160,3 +160,25 @@ Do not go gentle into that good night. th.assertFileContent(filepath.Join("public", "ss1", "index.html"), "P1|URL: /ss1/|Next: /ss1/page/2/") th.assertFileContent(filepath.Join("public", "ss1", "page", "2", "index.html"), "P2|URL: /ss1/page/2/|Next: /ss1/page/3/") } + +func TestSectionsEntries(t *testing.T) { + files := ` +-- hugo.toml -- +-- content/withfile/_index.md -- +-- content/withoutfile/p1.md -- +-- layouts/_default/list.html -- +SectionsEntries: {{ .SectionsEntries }} + + +` + + b := NewIntegrationTestBuilder( + IntegrationTestConfig{ + T: t, + TxtarString: files, + }, + ).Build() + + b.AssertFileContent("public/withfile/index.html", "SectionsEntries: [withfile]") + b.AssertFileContent("public/withoutfile/index.html", "SectionsEntries: [withoutfile]") +} |