mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Reads data files inside data/ and makes data available in .Site.Data
Fixes #476. Conflicts: hugolib/site.go
This commit is contained in:
committed by
bep
parent
4c7e119ca1
commit
773812de6f
@@ -119,6 +119,7 @@ func InitializeConfig() {
|
||||
viper.SetDefault("StaticDir", "static")
|
||||
viper.SetDefault("ArchetypeDir", "archetypes")
|
||||
viper.SetDefault("PublishDir", "public")
|
||||
viper.SetDefault("DataDir", "data")
|
||||
viper.SetDefault("DefaultLayout", "post")
|
||||
viper.SetDefault("BuildDrafts", false)
|
||||
viper.SetDefault("BuildFuture", false)
|
||||
@@ -287,6 +288,7 @@ func getDirList() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
filepath.Walk(helpers.AbsPathify(viper.GetString("DataDir")), walker)
|
||||
filepath.Walk(helpers.AbsPathify(viper.GetString("ContentDir")), walker)
|
||||
filepath.Walk(helpers.AbsPathify(viper.GetString("LayoutDir")), walker)
|
||||
filepath.Walk(helpers.AbsPathify(viper.GetString("StaticDir")), walker)
|
||||
|
@@ -130,6 +130,7 @@ func NewSite(cmd *cobra.Command, args []string) {
|
||||
mkdir(createpath, "content")
|
||||
mkdir(createpath, "archetypes")
|
||||
mkdir(createpath, "static")
|
||||
mkdir(createpath, "data")
|
||||
|
||||
createConfig(createpath, configFormat)
|
||||
}
|
||||
|
Reference in New Issue
Block a user