Add yandex metrica tag

This commit is contained in:
2022-01-05 01:04:27 +01:00
parent 3f10f7b912
commit 26512c2b29
6 changed files with 37 additions and 1 deletions
+7
View File
@@ -23,6 +23,10 @@ type Content struct {
PostsPerPage int `mapstructure:"postsPerPage"`
}
type Site struct {
YandexKey string `mapstructure:"yandexKey"`
}
// Config contains application configuration
type Config struct {
Verbose string `mapstructure:"verbose"`
@@ -30,6 +34,7 @@ type Config struct {
Addr string `mapstructure:"addr"`
Unix string `mapstructure:"unix"`
Content Content `mapstructure:"content"`
Site Site `mapstructure:"site"`
}
// initialize default values on app-start
@@ -50,6 +55,8 @@ func init() {
pflag.String("content.pinned", "contact", "pinned page slug")
pflag.Int("content.postsPerPage", 5, "amount of posts per page")
pflag.String("site.yandexKey", "", "yandex analytics key")
pflag.Parse()
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))