mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
e1da7cb320
There are currently several Params and case related issues floating around in Hugo. This is very confusing for users and one of the most common support questions on the forum. And while there have been done some great leg work in Viper etc., this is of limited value since this and similar doesn't work: `Params.myCamelCasedParam` Hugo has control over all the template method invocations, and can take care of all the lower-casing of the map lookup keys. But that doesn't help with direct template lookups of type `Site.Params.TWITTER_CONFIG.USER_ID`. This commit solves that by doing some carefully crafted modifications of the templates' AST -- lowercasing the params keys. This is low-level work, but it's not like the template API wil change -- and this is important enough to defend such "bit fiddling". Tests are added for all the template engines: Go templates, Ace and Amber. Fixes #2615 Fixes #1129 Fixes #2590 |
||
---|---|---|
.. | ||
reflect_helpers.go | ||
template.go | ||
template_ast_transformers.go | ||
template_ast_transformers_test.go | ||
template_embedded.go | ||
template_funcs.go | ||
template_funcs_test.go | ||
template_i18n.go | ||
template_i18n_test.go | ||
template_resources.go | ||
template_resources_test.go | ||
template_test.go |