From: Bjørn Erik Pedersen Date: Wed, 23 Nov 2016 17:46:32 +0000 (+0100) Subject: target: Simplify X-Git-Tag: v0.18~52 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a721fbed;p=brevno-suite%2Fhugo target: Simplify --- diff --git a/target/htmlredirect.go b/target/htmlredirect.go index 20e064c8..81a15fa7 100644 --- a/target/htmlredirect.go +++ b/target/htmlredirect.go @@ -104,9 +104,7 @@ func (h *HTMLRedirectAlias) Translate(alias string) (aliasPath string, err error } // Add the final touch - if strings.HasPrefix(alias, helpers.FilePathSeparator) { - alias = alias[1:] - } + alias = strings.TrimPrefix(alias, helpers.FilePathSeparator) if strings.HasSuffix(alias, helpers.FilePathSeparator) { alias = alias + "index.html" } else if !strings.HasSuffix(alias, ".html") {