summaryrefslogtreecommitdiffstats
path: root/hugolib/config.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-09-25 08:59:02 +0200
committerGitHub <noreply@github.com>2017-09-25 08:59:02 +0200
commitfb33d8286d78a78a74deb44355b621852a1c4033 (patch)
treea726e33fbaa0ca7a315a2e12021306fd5b27690e /hugolib/config.go
parent81ed564793609a32be20a569cc15da2cc02dd734 (diff)
Use Chroma as new default syntax highlighter
If you want to use Pygments, set `pygmentsUseClassic=true` in your site config. Fixes #3888
Diffstat (limited to 'hugolib/config.go')
-rw-r--r--hugolib/config.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/hugolib/config.go b/hugolib/config.go
index dcc56486a..2406ba771 100644
--- a/hugolib/config.go
+++ b/hugolib/config.go
@@ -16,11 +16,12 @@ package hugolib
import (
"fmt"
+ "io"
+ "strings"
+
"github.com/gohugoio/hugo/helpers"
"github.com/spf13/afero"
"github.com/spf13/viper"
- "io"
- "strings"
)
// LoadConfig loads Hugo configuration into a new Viper and then adds
@@ -84,9 +85,12 @@ func LoadConfig(fs afero.Fs, relativeSourcePath, configFilename string) (*viper.
return v, nil
}
-func loadDefaultSettingsFor(v *viper.Viper) {
+func loadDefaultSettingsFor(v *viper.Viper) error {
- c := helpers.NewContentSpec(v)
+ c, err := helpers.NewContentSpec(v)
+ if err != nil {
+ return err
+ }
v.SetDefault("cleanDestinationDir", false)
v.SetDefault("watch", false)
@@ -120,6 +124,7 @@ func loadDefaultSettingsFor(v *viper.Viper) {
v.SetDefault("pygmentsStyle", "monokai")
v.SetDefault("pygmentsUseClasses", false)
v.SetDefault("pygmentsCodeFences", false)
+ v.SetDefault("pygmentsUseClassic", false)
v.SetDefault("pygmentsOptions", "")
v.SetDefault("disableLiveReload", false)
v.SetDefault("pluralizeListTitles", true)
@@ -146,4 +151,6 @@ func loadDefaultSettingsFor(v *viper.Viper) {
v.SetDefault("ignoreFiles", make([]string, 0))
v.SetDefault("disableAliases", false)
v.SetDefault("debug", false)
+
+ return nil
}