mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +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:
@@ -38,7 +38,7 @@ type FrontMatterHandler struct {
|
||||
// A map of all date keys configured, including any custom.
|
||||
allDateKeys map[string]bool
|
||||
|
||||
logger *loggers.Logger
|
||||
logger loggers.Logger
|
||||
}
|
||||
|
||||
// FrontMatterDescriptor describes how to handle front matter for a given Page.
|
||||
@@ -148,7 +148,7 @@ func (f FrontMatterHandler) newChainedFrontMatterFieldHandler(handlers ...frontM
|
||||
// First successful handler wins.
|
||||
success, err := h(d)
|
||||
if err != nil {
|
||||
f.logger.ERROR.Println(err)
|
||||
f.logger.Errorln(err)
|
||||
} else if success {
|
||||
return true, nil
|
||||
}
|
||||
@@ -262,7 +262,7 @@ func toLowerSlice(in interface{}) []string {
|
||||
|
||||
// NewFrontmatterHandler creates a new FrontMatterHandler with the given logger and configuration.
|
||||
// If no logger is provided, one will be created.
|
||||
func NewFrontmatterHandler(logger *loggers.Logger, cfg config.Provider) (FrontMatterHandler, error) {
|
||||
func NewFrontmatterHandler(logger loggers.Logger, cfg config.Provider) (FrontMatterHandler, error) {
|
||||
|
||||
if logger == nil {
|
||||
logger = loggers.NewErrorLogger()
|
||||
|
Reference in New Issue
Block a user