Where should I store API keys?

I currently have my API key stored in config.tml file as a param. However, I don’t want to commit that file to source control as it has an API key in it. Can the the config file read in Environmental variables? If so how? Not sure the best way to do this.

Go templates have {{ getenv "FOO" }} but Hugo doesn’t seem to export that function.

Related http://discuss.gohugo.io/t/how-do-i-get-environment-variables-in-the-template/597

I don’t think Go templates has a getenv func (if it did, it would work), but Hugo should. PRs are welcome.

Working on trying to merge https://github.com/kelseyhightower/confd/issues/149 into but having some problems.

I wouldn’t try to merge it - just add the getenv as a template func in Hugo’s template.go that delegates to Go’s builtin function.

Hey @cgray9, how did you end up loading your environment variable with the getenv template function? I didn’t think the site config could parse Go template syntax.