hugolib: Revise paginator alias path handling

This commit is contained in:
Bjørn Erik Pedersen
2017-03-25 19:21:19 +01:00
parent b7ed67d425
commit 24c1770288
2 changed files with 8 additions and 22 deletions

View File

@@ -358,23 +358,6 @@ func GetRelativePath(path, base string) (final string, err error) {
return name, nil
}
// PaginateAliasPath creates a path used to access the aliases in the paginator.
func (p *PathSpec) PaginateAliasPath(base string, page int) string {
paginatePath := p.paginatePath
uglify := p.uglyURLs
var pth string
if base != "" {
pth = filepath.FromSlash(fmt.Sprintf("/%s/%s/%d", base, paginatePath, page))
} else {
pth = filepath.FromSlash(fmt.Sprintf("/%s/%d", paginatePath, page))
}
if uglify {
pth += ".html"
}
return pth
}
// GuessSection returns the section given a source path.
// A section is the part between the root slash and the second slash
// or before the first slash.