mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-15 14:16:29 +00:00
Fix aliases with path in baseURL
This commit is contained in:
1 parent
0a9172672a
commit
9679023f2b
2 files changed
+2
-1
No files matched your search
@@ -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}},
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user