summaryrefslogtreecommitdiffstats
path: root/hugolib/site_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-02-28 14:22:05 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-02-29 18:32:06 +0100
commit1746e8a9b2be46dcd6cecbb4bc90983a9c69b333 (patch)
tree45a8cbb965f9070473e2a4d7a6330fd8fdf77b24 /hugolib/site_test.go
parent6f48146e75e9877c4271ec239b763e6f3bc3babb (diff)
Fix ref/relRef regression for relative refs from bundles
Fixes #6952
Diffstat (limited to 'hugolib/site_test.go')
-rw-r--r--hugolib/site_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
index cd8c87c43..22b078f5a 100644
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -940,6 +940,8 @@ func setupLinkingMockSite(t *testing.T) *Site {
{filepath.FromSlash("level2/level3/common.png"), ""},
{filepath.FromSlash("level2/level3/embedded.dot.md"), ""},
+
+ {filepath.FromSlash("leafbundle/index.md"), ""},
}
cfg, fs := newTestCfg()
@@ -1026,3 +1028,18 @@ func checkLinkCase(site *Site, link string, currentPage page.Page, relative bool
t.Fatalf("[%d] Expected %q from %q to resolve to %q, got %q - error: %s", i, link, currentPage.Path(), expected, out, err)
}
}
+
+// https://github.com/gohugoio/hugo/issues/6952
+func TestRefBundle(t *testing.T) {
+ b := newTestSitesBuilder(t)
+ b.WithContent(
+ "post/b1/index.md", "---\ntitle: pb1\n---\nRef: {{< ref \"b2\" >}}",
+ "post/b2/index.md", "---\ntitle: pb2\n---\n",
+ )
+ b.WithTemplates("index.html", `Home`)
+ b.WithTemplates("_default/single.html", `Content: {{ .Content }}`)
+
+ b.Build(BuildCfg{})
+
+ b.AssertFileContent("public/post/b1/index.html", `Content: <p>Ref: http://example.com/post/b2/</p>`)
+}