hugo/tpl
Bjørn Erik Pedersen e1da7cb320 Fix case issues with Params
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
2016-11-22 17:33:52 +01:00
..
reflect_helpers.go Make where accept slice 2016-03-06 13:15:07 +01:00
template.go Fix case issues with Params 2016-11-22 17:33:52 +01:00
template_ast_transformers.go Fix case issues with Params 2016-11-22 17:33:52 +01:00
template_ast_transformers_test.go Fix case issues with Params 2016-11-22 17:33:52 +01:00
template_embedded.go node to page: Don't repeat the RSS title if it is the same 2016-11-22 09:57:03 +01:00
template_funcs.go tpl: Add imageConfig function 2016-11-16 13:00:45 +01:00
template_funcs_test.go tpl: Add imageConfig function 2016-11-16 13:00:45 +01:00
template_i18n.go commands, tpl: Get rid of repeating viper accesses 2016-11-07 00:10:32 +01:00
template_i18n_test.go tpl: Golint fixes 2016-11-05 17:28:14 +01:00
template_resources.go commands, tpl: Get rid of repeating viper accesses 2016-11-07 00:10:32 +01:00
template_resources_test.go all: Unify case of config variable names 2016-10-24 20:56:00 +02:00
template_test.go Add readFile template func 2016-03-31 21:24:18 +02:00