mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-01 22:42:45 +02:00
commands, tpl: Get rid of repeating viper accesses
* all: Delete some blank lines * commands, tpl: Get rid of repeating viper accesses
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
4b4ab47553
commit
85a2d81e3c
@@ -65,6 +65,7 @@ func SetI18nTfuncs(bndl *bundle.Bundle) {
|
||||
jww.WARN.Printf("No translation bundle found for default language %q", defaultContentLanguage)
|
||||
}
|
||||
|
||||
enableMissingTranslationPlaceholders := viper.GetBool("enableMissingTranslationPlaceholders")
|
||||
for _, lang := range bndl.LanguageTags() {
|
||||
currentLang := lang
|
||||
|
||||
@@ -78,7 +79,7 @@ func SetI18nTfuncs(bndl *bundle.Bundle) {
|
||||
if Logi18nWarnings {
|
||||
i18nWarningLogger.Printf("i18n|MISSING_TRANSLATION|%s|%s", currentLang, translationID)
|
||||
}
|
||||
if viper.GetBool("enableMissingTranslationPlaceholders") {
|
||||
if enableMissingTranslationPlaceholders {
|
||||
return fmt.Sprintf("[i18n] %s", translationID)
|
||||
}
|
||||
if defaultT != nil {
|
||||
|
@@ -114,7 +114,6 @@ func resDeleteCache(id string, fs afero.Fs) error {
|
||||
|
||||
// resGetRemote loads the content of a remote file. This method is thread safe.
|
||||
func resGetRemote(url string, fs afero.Fs, hc *http.Client) ([]byte, error) {
|
||||
|
||||
c, err := resGetCache(url, fs, viper.GetBool("ignoreCache"))
|
||||
if c != nil && err == nil {
|
||||
return c, nil
|
||||
|
Reference in New Issue
Block a user