mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
helpers: Golint fixes
This commit is contained in:
parent
72156e403c
commit
d4830fc4fd
2 changed files with 5 additions and 0 deletions
|
@ -35,6 +35,7 @@ type PathSpec struct {
|
|||
multilingual bool
|
||||
}
|
||||
|
||||
// NewPathSpecFromConfig creats a new PathSpec from the given ConfigProvider.
|
||||
func NewPathSpecFromConfig(config ConfigProvider) *PathSpec {
|
||||
return &PathSpec{
|
||||
disablePathToLower: config.GetBool("disablePathToLower"),
|
||||
|
@ -49,6 +50,7 @@ func NewPathSpecFromConfig(config ConfigProvider) *PathSpec {
|
|||
}
|
||||
}
|
||||
|
||||
// PaginatePath returns the configured root path used for paginator pages.
|
||||
func (p *PathSpec) PaginatePath() string {
|
||||
return p.paginatePath
|
||||
}
|
||||
|
|
|
@ -288,10 +288,13 @@ func AddContextRoot(baseURL, relativePath string) string {
|
|||
return newPath
|
||||
}
|
||||
|
||||
// URLizeAndPrep applies misc sanitation to the given URL to get it in line
|
||||
// with the Hugo standard.
|
||||
func (p *PathSpec) URLizeAndPrep(in string) string {
|
||||
return URLPrep(p.uglyURLs, p.URLize(in))
|
||||
}
|
||||
|
||||
// URLPrep applies misc sanitation to the given URL.
|
||||
func URLPrep(ugly bool, in string) string {
|
||||
if ugly {
|
||||
x := Uglify(SanitizeURL(in))
|
||||
|
|
Loading…
Reference in a new issue