mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 22:21:07 +03:00
parent
a191b38ac8
commit
5e5ce00d41
2 changed files with 35 additions and 1 deletions
|
@ -621,3 +621,35 @@ Menu Item: 0: <span>Home</span>|/|
|
|||
`)
|
||||
|
||||
}
|
||||
|
||||
// Issue #11062
|
||||
func TestMenusSubDirInBaseURL(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
baseURL = "https://example.com/foo/"
|
||||
title = "Hugo Menu Test"
|
||||
[menus]
|
||||
[[menus.main]]
|
||||
name = "Posts"
|
||||
url = "/posts"
|
||||
weight = 1
|
||||
-- layouts/index.html --
|
||||
{{ range $i, $e := site.Menus.main }}
|
||||
Menu Item: {{ $i }}|{{ .URL }}|
|
||||
{{ end }}
|
||||
`
|
||||
|
||||
b := NewIntegrationTestBuilder(
|
||||
IntegrationTestConfig{
|
||||
T: t,
|
||||
TxtarString: files,
|
||||
},
|
||||
).Build()
|
||||
|
||||
b.AssertFileContent("public/index.html", `
|
||||
Menu Item: 0|/foo/posts|
|
||||
`)
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue