mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 06:17:45 +00:00
restored behavior of respecting config values unless set by command flags. fixed #116
This commit is contained in:
1 parent
ef595aedfc
commit
6017599a3c
1 file changed
+12
-3
+12
-3
@@ -71,9 +71,18 @@ func init() {
|
|||||||
|
|
||||||
func InitializeConfig() {
|
func InitializeConfig() {
|
||||||
Config = hugolib.SetupConfig(&CfgFile, &Source)
|
Config = hugolib.SetupConfig(&CfgFile, &Source)
|
||||||
Config.BuildDrafts = Draft
|
|
||||||
Config.UglyUrls = UglyUrls
|
if HugoCmd.PersistentFlags().Lookup("build-drafts").Changed {
|
||||||
Config.Verbose = Verbose
|
Config.BuildDrafts = Draft
|
||||||
|
}
|
||||||
|
|
||||||
|
if HugoCmd.PersistentFlags().Lookup("uglyurls").Changed {
|
||||||
|
Config.UglyUrls = UglyUrls
|
||||||
|
}
|
||||||
|
|
||||||
|
if HugoCmd.PersistentFlags().Lookup("verbose").Changed {
|
||||||
|
Config.Verbose = Verbose
|
||||||
|
}
|
||||||
if BaseUrl != "" {
|
if BaseUrl != "" {
|
||||||
Config.BaseUrl = BaseUrl
|
Config.BaseUrl = BaseUrl
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user