From 9679023f2b0d7c55b70f23fd94603f301a841079 Mon Sep 17 00:00:00 2001 From: Helder Pereira Date: Wed, 17 Jun 2020 00:05:53 +0100 Subject: Fix aliases with path in baseURL --- hugolib/alias_test.go | 1 + hugolib/site_render.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'hugolib') diff --git a/hugolib/alias_test.go b/hugolib/alias_test.go index a1736e7e8..8f3b756ec 100644 --- a/hugolib/alias_test.go +++ b/hugolib/alias_test.go @@ -52,6 +52,7 @@ func TestAlias(t *testing.T) { settings map[string]interface{} }{ {"/index.html", "http://example.com", "/", map[string]interface{}{"baseURL": "http://example.com"}}, + {"/index.html", "http://example.com/some/path", "/", map[string]interface{}{"baseURL": "http://example.com/some/path"}}, {"/index.html", "http://example.com", "/", map[string]interface{}{"baseURL": "http://example.com", "canonifyURLs": true}}, {"/index.html", "../..", "/", map[string]interface{}{"relativeURLs": true}}, {".html", "", ".html", map[string]interface{}{"uglyURLs": true}}, diff --git a/hugolib/site_render.go b/hugolib/site_render.go index 1d397dafa..88b5e6fb7 100644 --- a/hugolib/site_render.go +++ b/hugolib/site_render.go @@ -338,7 +338,7 @@ func (s *Site) renderAliases() error { if isRelative { // Make alias relative, where "." will be on the // same directory level as the current page. - basePath := path.Join(of.RelPermalink(), "..") + basePath := path.Join(p.targetPaths().SubResourceBaseLink, "..") a = path.Join(basePath, a) } else { -- cgit v1.2.3