mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
all: Refactor to nonglobal Viper, i18n etc.
This is a final rewrite that removes all the global state in Hugo, which also enables the use if `t.Parallel` in tests. Updates #2701 Fixes #3016
This commit is contained in:
@@ -32,7 +32,6 @@ import (
|
||||
bp "github.com/spf13/hugo/bufferpool"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
"github.com/spf13/pflag"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// FilePathSeparator as defined by os.Separator.
|
||||
@@ -196,8 +195,8 @@ func ReaderContains(r io.Reader, subslice []byte) bool {
|
||||
}
|
||||
|
||||
// ThemeSet checks whether a theme is in use or not.
|
||||
func ThemeSet() bool {
|
||||
return viper.GetString("theme") != ""
|
||||
func (p *PathSpec) ThemeSet() bool {
|
||||
return p.theme != ""
|
||||
}
|
||||
|
||||
type logPrinter interface {
|
||||
|
Reference in New Issue
Block a user