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. --- create/content.go | 6 +++--- create/content_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'create') 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")) -- cgit v1.2.3