mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
hugolib, output: Handle aliases for all HTML formats
This commit is contained in:
@@ -88,18 +88,6 @@ func (s *Site) publishDestAlias(allowRoot bool, path, permalink string, p *Page)
|
||||
|
||||
isXHTML := strings.HasSuffix(path, ".xhtml")
|
||||
|
||||
if s.Info.relativeURLs {
|
||||
// convert `permalink` into URI relative to location of `path`
|
||||
baseURL := helpers.SanitizeURLKeepTrailingSlash(s.Cfg.GetString("baseURL"))
|
||||
if strings.HasPrefix(permalink, baseURL) {
|
||||
permalink = "/" + strings.TrimPrefix(permalink, baseURL)
|
||||
}
|
||||
permalink, err = helpers.GetRelativePath(permalink, path)
|
||||
if err != nil {
|
||||
s.Log.ERROR.Println("Failed to make a RelativeURL alias:", path, "redirecting to", permalink)
|
||||
}
|
||||
permalink = filepath.ToSlash(permalink)
|
||||
}
|
||||
s.Log.DEBUG.Println("creating alias:", path, "redirecting to", permalink)
|
||||
|
||||
targetPath, err := handler.targetPathAlias(path)
|
||||
|
Reference in New Issue
Block a user