diff --git a/target/htmlredirect.go b/target/htmlredirect.go index 34e05cbad..b5b47a889 100644 --- a/target/htmlredirect.go +++ b/target/htmlredirect.go @@ -26,15 +26,15 @@ import ( jww "github.com/spf13/jwalterweatherman" ) -const ALIAS = "
" -const ALIAS_XHTML = "" +const alias = "" +const aliasXHtml = "" -var DefaultAliasTemplates *template.Template +var defaultAliasTemplates *template.Template func init() { - DefaultAliasTemplates = template.New("") - template.Must(DefaultAliasTemplates.New("alias").Parse(ALIAS)) - template.Must(DefaultAliasTemplates.New("alias-xhtml").Parse(ALIAS_XHTML)) + defaultAliasTemplates = template.New("") + template.Must(defaultAliasTemplates.New("alias").Parse(alias)) + template.Must(defaultAliasTemplates.New("alias-xhtml").Parse(aliasXHtml)) } type AliasPublisher interface { @@ -96,10 +96,9 @@ func (h *HTMLRedirectAlias) Translate(alias string) (aliasPath string, err error jww.ERROR.Println(m) } return "", fmt.Errorf("Cannot create \"%s\": Windows filename restriction", originalAlias) - } else { - for _, m := range msgs { - jww.WARN.Println(m) - } + } + for _, m := range msgs { + jww.WARN.Println(m) } } @@ -134,7 +133,7 @@ func (h *HTMLRedirectAlias) Publish(path string, permalink string) (err error) { t = "alias-xhtml" } - template := DefaultAliasTemplates + template := defaultAliasTemplates if h.Templates != nil { template = h.Templates }