summaryrefslogtreecommitdiffstats
path: root/create
diff options
context:
space:
mode:
authorAlbert Nigmatzianov <albertnigma@gmail.com>2016-10-24 20:56:00 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-10-24 20:56:00 +0200
commitf21e2f25c99c547a2f35d209935f8f1c52fa2671 (patch)
treef2bb860213e88b0244c31144cfcd872665096f06 /create
parentd9f54a13c14f12ccc8af33e9dbd611c2cd113324 (diff)
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 'create')
-rw-r--r--create/content.go6
-rw-r--r--create/content_test.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/create/content.go b/create/content.go
index 0daebc3ad..fb9ef7a04 100644
--- a/create/content.go
+++ b/create/content.go
@@ -67,7 +67,7 @@ func NewContent(fs afero.Fs, kind, name string) (err error) {
return err
}
- if err = page.SetSourceMetaData(metadata, parser.FormatToLeadRune(viper.GetString("MetaDataFormat"))); err != nil {
+ if err = page.SetSourceMetaData(metadata, parser.FormatToLeadRune(viper.GetString("metaDataFormat"))); err != nil {
return
}
@@ -78,7 +78,7 @@ func NewContent(fs afero.Fs, kind, name string) (err error) {
}
jww.FEEDBACK.Println(helpers.AbsPathify(filepath.Join(viper.GetString("contentDir"), name)), "created")
- editor := viper.GetString("NewContentEditor")
+ editor := viper.GetString("newContentEditor")
if editor != "" {
jww.FEEDBACK.Printf("Editing %s with %q ...\n", name, editor)
@@ -137,7 +137,7 @@ func createMetadata(archetype parser.Page, name string) (map[string]interface{},
metadata["title"] = helpers.MakeTitle(helpers.Filename(name))
}
- if x := parser.FormatSanitize(viper.GetString("MetaDataFormat")); x == "json" || x == "yaml" || x == "toml" {
+ if x := parser.FormatSanitize(viper.GetString("metaDataFormat")); x == "json" || x == "yaml" || x == "toml" {
metadata["date"] = time.Now().Format(time.RFC3339)
}
diff --git a/create/content_test.go b/create/content_test.go
index 0ccbd03ea..50acc89b4 100644
--- a/create/content_test.go
+++ b/create/content_test.go
@@ -69,7 +69,7 @@ func TestNewContent(t *testing.T) {
func initViper() {
viper.Reset()
- viper.Set("MetaDataFormat", "toml")
+ viper.Set("metaDataFormat", "toml")
viper.Set("archetypeDir", filepath.Join(os.TempDir(), "archetypes"))
viper.Set("contentDir", filepath.Join(os.TempDir(), "content"))
viper.Set("themesDir", filepath.Join(os.TempDir(), "themes"))