mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 20:14:58 +00:00
target: Simplify
This commit is contained in:
1 parent
3739871f1e
commit
a721fbed1d
1 file changed
+1
-3
@@ -104,9 +104,7 @@ func (h *HTMLRedirectAlias) Translate(alias string) (aliasPath string, err error
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the final touch
|
// Add the final touch
|
||||||
if strings.HasPrefix(alias, helpers.FilePathSeparator) {
|
alias = strings.TrimPrefix(alias, helpers.FilePathSeparator)
|
||||||
alias = alias[1:]
|
|
||||||
}
|
|
||||||
if strings.HasSuffix(alias, helpers.FilePathSeparator) {
|
if strings.HasSuffix(alias, helpers.FilePathSeparator) {
|
||||||
alias = alias + "index.html"
|
alias = alias + "index.html"
|
||||||
} else if !strings.HasSuffix(alias, ".html") {
|
} else if !strings.HasSuffix(alias, ".html") {
|
||||||
|
|||||||
Reference in new issue
Block a user