hugolib: Add ConfigSourceDescriptor

To prepare for config in themes

See #4490
This commit is contained in:
Bjørn Erik Pedersen
2018-03-18 10:32:29 +01:00
parent b6798ee867
commit 3d1a6e109c
6 changed files with 39 additions and 20 deletions

View File

@@ -34,7 +34,7 @@ func TestLoadConfig(t *testing.T) {
writeToFs(t, mm, "hugo.toml", configContent)
cfg, err := LoadConfig(mm, "", "hugo.toml")
cfg, err := LoadConfig(ConfigSourceDescriptor{Fs: mm, Name: "hugo.toml"})
require.NoError(t, err)
assert.Equal(t, "side", cfg.GetString("paginatePath"))
@@ -59,7 +59,7 @@ func TestLoadMultiConfig(t *testing.T) {
writeToFs(t, mm, "override.toml", configContentSub)
cfg, err := LoadConfig(mm, "", "base.toml,override.toml")
cfg, err := LoadConfig(ConfigSourceDescriptor{Fs: mm, Name: "base.toml,override.toml"})
require.NoError(t, err)
assert.Equal(t, "top", cfg.GetString("paginatePath"))