summaryrefslogtreecommitdiffhomepage
path: root/helpers/pygments.go
diff options
context:
space:
mode:
authorAlbert Nigmatzianov <[email protected]>2016-10-24 20:56:00 +0200
committerBjørn Erik Pedersen <[email protected]>2016-10-24 20:56:00 +0200
commitf21e2f25c99c547a2f35d209935f8f1c52fa2671 (patch)
treef2bb860213e88b0244c31144cfcd872665096f06 /helpers/pygments.go
parentd9f54a13c14f12ccc8af33e9dbd611c2cd113324 (diff)
downloadhugo-f21e2f25c99c547a2f35d209935f8f1c52fa2671.tar.gz
hugo-f21e2f25c99c547a2f35d209935f8f1c52fa2671.zip
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.
Diffstat (limited to 'helpers/pygments.go')
-rw-r--r--helpers/pygments.go21
1 files changed, 11 insertions, 10 deletions
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"