mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
Add warnidf template function
Also rename config `ignoreErrors` => `ignoreLogs` But the old still works. Closes #9189
This commit is contained in:
@@ -206,7 +206,7 @@ func (c Config) cloneForLang() *Config {
|
||||
x.DisableKinds = copyStringSlice(x.DisableKinds)
|
||||
x.DisableLanguages = copyStringSlice(x.DisableLanguages)
|
||||
x.MainSections = copyStringSlice(x.MainSections)
|
||||
x.IgnoreErrors = copyStringSlice(x.IgnoreErrors)
|
||||
x.IgnoreLogs = copyStringSlice(x.IgnoreLogs)
|
||||
x.IgnoreFiles = copyStringSlice(x.IgnoreFiles)
|
||||
x.Theme = copyStringSlice(x.Theme)
|
||||
|
||||
@@ -299,9 +299,9 @@ func (c *Config) CompileConfig(logger loggers.Logger) error {
|
||||
}
|
||||
}
|
||||
|
||||
ignoredErrors := make(map[string]bool)
|
||||
for _, err := range c.IgnoreErrors {
|
||||
ignoredErrors[strings.ToLower(err)] = true
|
||||
ignoredLogIDs := make(map[string]bool)
|
||||
for _, err := range c.IgnoreLogs {
|
||||
ignoredLogIDs[strings.ToLower(err)] = true
|
||||
}
|
||||
|
||||
baseURL, err := urls.NewBaseURLFromString(c.BaseURL)
|
||||
@@ -357,7 +357,7 @@ func (c *Config) CompileConfig(logger loggers.Logger) error {
|
||||
BaseURLLiveReload: baseURL,
|
||||
DisabledKinds: disabledKinds,
|
||||
DisabledLanguages: disabledLangs,
|
||||
IgnoredErrors: ignoredErrors,
|
||||
IgnoredLogs: ignoredLogIDs,
|
||||
KindOutputFormats: kindOutputFormats,
|
||||
CreateTitle: helpers.GetTitleFunc(c.TitleCaseStyle),
|
||||
IsUglyURLSection: isUglyURL,
|
||||
@@ -394,7 +394,7 @@ type ConfigCompiled struct {
|
||||
KindOutputFormats map[string]output.Formats
|
||||
DisabledKinds map[string]bool
|
||||
DisabledLanguages map[string]bool
|
||||
IgnoredErrors map[string]bool
|
||||
IgnoredLogs map[string]bool
|
||||
CreateTitle func(s string) string
|
||||
IsUglyURLSection func(section string) bool
|
||||
IgnoreFile func(filename string) bool
|
||||
@@ -501,8 +501,8 @@ type RootConfig struct {
|
||||
// Enable to disable the build lock file.
|
||||
NoBuildLock bool
|
||||
|
||||
// A list of error IDs to ignore.
|
||||
IgnoreErrors []string
|
||||
// A list of log IDs to ignore.
|
||||
IgnoreLogs []string
|
||||
|
||||
// A list of regexps that match paths to ignore.
|
||||
// Deprecated: Use the settings on module imports.
|
||||
|
@@ -89,8 +89,8 @@ func (c ConfigLanguage) IsLangDisabled(lang string) bool {
|
||||
return c.config.C.DisabledLanguages[lang]
|
||||
}
|
||||
|
||||
func (c ConfigLanguage) IgnoredErrors() map[string]bool {
|
||||
return c.config.C.IgnoredErrors
|
||||
func (c ConfigLanguage) IgnoredLogs() map[string]bool {
|
||||
return c.config.C.IgnoredLogs
|
||||
}
|
||||
|
||||
func (c ConfigLanguage) NoBuildLock() bool {
|
||||
|
@@ -141,6 +141,7 @@ func (l configLoader) applyConfigAliases() error {
|
||||
{Key: "indexes", Value: "taxonomies"},
|
||||
{Key: "logI18nWarnings", Value: "printI18nWarnings"},
|
||||
{Key: "logPathWarnings", Value: "printPathWarnings"},
|
||||
{Key: "ignoreErrors", Value: "ignoreLogs"},
|
||||
}
|
||||
|
||||
for _, alias := range aliases {
|
||||
|
@@ -67,7 +67,7 @@ type AllProvider interface {
|
||||
NewContentEditor() string
|
||||
Timeout() time.Duration
|
||||
StaticDirs() []string
|
||||
IgnoredErrors() map[string]bool
|
||||
IgnoredLogs() map[string]bool
|
||||
WorkingDir() string
|
||||
EnableEmoji() bool
|
||||
}
|
||||
|
Reference in New Issue
Block a user