From f21e2f25c99c547a2f35d209935f8f1c52fa2671 Mon Sep 17 00:00:00 2001 From: Albert Nigmatzianov Date: Mon, 24 Oct 2016 20:56:00 +0200 Subject: all: Unify case of config variable names All config variables starts with low-case and uses camelCase. If there is abbreviation at the beginning of the name, the whole abbreviation will be written in low-case. If there is abbreviation at the end of the name, the whole abbreviation will be written in upper-case. For example, rssURI. --- helpers/pygments.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'helpers/pygments.go') diff --git a/helpers/pygments.go b/helpers/pygments.go index 6f7485845..d729be5dc 100644 --- a/helpers/pygments.go +++ b/helpers/pygments.go @@ -17,15 +17,16 @@ import ( "bytes" "crypto/sha1" "fmt" - "github.com/spf13/hugo/hugofs" - jww "github.com/spf13/jwalterweatherman" - "github.com/spf13/viper" "io" "io/ioutil" "os/exec" "path/filepath" "sort" "strings" + + "github.com/spf13/hugo/hugofs" + jww "github.com/spf13/jwalterweatherman" + "github.com/spf13/viper" ) const pygmentsBin = "pygmentize" @@ -62,8 +63,8 @@ func Highlight(code, lang, optsStr string) string { fs := hugofs.Os() - ignoreCache := viper.GetBool("IgnoreCache") - cacheDir := viper.GetString("CacheDir") + ignoreCache := viper.GetBool("ignoreCache") + cacheDir := viper.GetString("cacheDir") var cachefile string if !ignoreCache && cacheDir != "" { @@ -198,17 +199,17 @@ func createOptionsString(options map[string]string) string { func parseDefaultPygmentsOpts() (map[string]string, error) { options := make(map[string]string) - err := parseOptions(options, viper.GetString("PygmentsOptions")) + err := parseOptions(options, viper.GetString("pygmentsOptions")) if err != nil { return nil, err } - if viper.IsSet("PygmentsStyle") { - options["style"] = viper.GetString("PygmentsStyle") + if viper.IsSet("pygmentsStyle") { + options["style"] = viper.GetString("pygmentsStyle") } - if viper.IsSet("PygmentsUseClasses") { - if viper.GetBool("PygmentsUseClasses") { + if viper.IsSet("pygmentsUseClasses") { + if viper.GetBool("pygmentsUseClasses") { options["noclasses"] = "false" } else { options["noclasses"] = "true" -- cgit v1.2.3