mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
Allow getJSON errors to be ignored
This change is mostly motivated to get a more stable CI build (we're building the Hugo site there, with Instagram and Twitter shortcodes sometimes failing). Fixes #7866
This commit is contained in:
@@ -33,11 +33,11 @@ import (
|
||||
|
||||
type aliasHandler struct {
|
||||
t tpl.TemplateHandler
|
||||
log *loggers.Logger
|
||||
log loggers.Logger
|
||||
allowRoot bool
|
||||
}
|
||||
|
||||
func newAliasHandler(t tpl.TemplateHandler, l *loggers.Logger, allowRoot bool) aliasHandler {
|
||||
func newAliasHandler(t tpl.TemplateHandler, l loggers.Logger, allowRoot bool) aliasHandler {
|
||||
return aliasHandler{t, l, allowRoot}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ func (s *Site) writeDestAlias(path, permalink string, outputFormat output.Format
|
||||
func (s *Site) publishDestAlias(allowRoot bool, path, permalink string, outputFormat output.Format, p page.Page) (err error) {
|
||||
handler := newAliasHandler(s.Tmpl(), s.Log, allowRoot)
|
||||
|
||||
s.Log.DEBUG.Println("creating alias:", path, "redirecting to", permalink)
|
||||
s.Log.Debug().Println("creating alias:", path, "redirecting to", permalink)
|
||||
|
||||
targetPath, err := handler.targetPathAlias(path)
|
||||
if err != nil {
|
||||
@@ -153,12 +153,12 @@ func (a aliasHandler) targetPathAlias(src string) (string, error) {
|
||||
if len(msgs) > 0 {
|
||||
if runtime.GOOS == "windows" {
|
||||
for _, m := range msgs {
|
||||
a.log.ERROR.Println(m)
|
||||
a.log.Errorln(m)
|
||||
}
|
||||
return "", fmt.Errorf("cannot create \"%s\": Windows filename restriction", originalAlias)
|
||||
}
|
||||
for _, m := range msgs {
|
||||
a.log.INFO.Println(m)
|
||||
a.log.Infoln(m)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user