aboutsummaryrefslogtreecommitdiffhomepage
path: root/helpers/configProvider.go
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/configProvider.go')
-rw-r--r--helpers/configProvider.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/helpers/configProvider.go b/helpers/configProvider.go
index 16a203302..35500f6de 100644
--- a/helpers/configProvider.go
+++ b/helpers/configProvider.go
@@ -17,9 +17,20 @@
// string operations on content.
package helpers
+import (
+ "github.com/spf13/viper"
+)
+
// ConfigProvider provides the configuration settings for Hugo.
type ConfigProvider interface {
GetString(key string) string
+ GetInt(key string) int
GetStringMap(key string) map[string]interface{}
GetStringMapString(key string) map[string]string
}
+
+// Config returns the currently active Hugo config. This will be set
+// per site (language) rendered.
+func Config() ConfigProvider {
+ return viper.Get("CurrentContentLanguage").(ConfigProvider)
+}