hugo/hugolib
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
..
alias_test.go Implement support for alias templates 2016-10-15 15:25:05 +02:00
author.go Revert the "standardize author data" 2016-09-18 19:16:39 +02:00
benchmark_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
case_insensitive_test.go Fix case issues with Params 2016-11-22 17:33:52 +01:00
config.go commands, tpl: Get rid of repeating viper accesses 2016-11-07 00:10:32 +01:00
config_test.go all: Unify case of config variable names 2016-10-24 20:56:00 +02:00
datafiles_test.go Add data tests 2016-09-06 18:32:20 +03:00
embedded_shortcodes_test.go node to page: Remove Node 2016-11-22 09:57:03 +01:00
gitinfo.go node to page: Remove Node 2016-11-22 09:57:03 +01:00
handler_base.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
handler_file.go helpers: Remove ToReader funcs 2016-06-25 17:57:05 -05:00
handler_meta.go Add parent as owner to Site 2016-09-06 18:32:18 +03:00
handler_page.go commands, tpl: Get rid of repeating viper accesses 2016-11-07 00:10:32 +01:00
handler_test.go all: Unify case of config variable names 2016-10-24 20:56:00 +02:00
hugo_info.go Move HugoSites to hugolib 2016-09-06 18:32:16 +03:00
hugo_sites.go node to page: Fix site pages sort 2016-11-22 09:57:03 +01:00
hugo_sites_build.go node to page: Handle URLs 2016-11-22 09:57:03 +01:00
hugo_sites_build_test.go node to page: Handle URLs 2016-11-22 09:57:03 +01:00
i18n.go Log on error in translation file 2016-10-12 16:54:29 +02:00
media.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
menu.go node to page: Remove Node 2016-11-22 09:57:03 +01:00
menu_test.go node to page: Handle URLs 2016-11-22 09:57:03 +01:00
multilingual.go Remove now superfluous lowercasing 2016-10-24 21:33:11 +02:00
node_as_page_test.go node to page: Fixe index page translation issues 2016-11-22 09:57:03 +01:00
page.go Fix case issues with Params 2016-11-22 17:33:52 +01:00
page_collections.go node to page: Final TODO-fixes 2016-11-22 09:57:03 +01:00
page_permalink_test.go node to page: Fix the Page copy() 2016-11-22 09:57:03 +01:00
page_taxonomy_test.go hugolib: Fix some more Golint warnings 2016-03-23 10:10:28 +01:00
page_test.go node to page: Fix the Page copy() 2016-11-22 09:57:03 +01:00
page_time_integration_test.go hugoblib: Clean up the time tests 2016-03-24 13:30:08 +01:00
pageCache.go Apply gofmt -s 2016-02-06 13:09:52 +01:00
pageCache_test.go hugolib: Some more GoLint fixes 2016-03-24 14:11:04 +01:00
pageGroup.go hugolib: Add GroupByExpireDate function 2016-06-14 15:45:26 +02:00
pageGroup_test.go hugolib: Fix typos in tests 2016-09-12 10:56:16 +02:00
pageSort.go hugolib: Fix page sorting when weight is zero 2016-11-06 15:39:33 +01:00
pageSort_test.go node to page: Fix the Page copy() 2016-11-22 09:57:03 +01:00
pagesPrevNext.go huglib: Add even more missing GoDoc 2016-04-07 16:05:23 +02:00
pagesPrevNext_test.go hugolib: Remove unused code 2016-03-14 15:41:03 +01:00
pagination.go node to page: Remove Node 2016-11-22 09:57:03 +01:00
pagination_test.go node to page: Fix the Page copy() 2016-11-22 09:57:03 +01:00
path_separators_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
path_separators_windows_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
permalinks.go node to page: Handle sections 2016-11-22 09:57:03 +01:00
permalinks_test.go Avoid reading from Viper for path and URL funcs 2016-10-24 13:45:30 +02:00
planner.go Add parent as owner to Site 2016-09-06 18:32:18 +03:00
redis.cn.md [Docs] Copyediting 2015-01-28 18:02:40 -07:00
robotstxt_test.go all: Unify case of config variable names 2016-10-24 20:56:00 +02:00
rss_test.go Fix RSS Title regression 2016-10-28 14:46:33 +02:00
scratch.go Do not use defer for unlocking in Scratch 2016-03-24 16:03:31 +01:00
scratch_test.go Be explicit about the type in Scratch test 2016-03-24 19:57:26 +01:00
shortcode.go Add context to asciidoc/-tor error logging 2016-10-13 13:48:43 +02:00
shortcode_test.go node to page: Remove Node 2016-11-22 09:57:03 +01:00
shortcodeparser.go all: Remove dead code 2016-10-13 13:51:16 +02:00
shortcodeparser_test.go Fix half-broken self-closing shortcodes 2016-09-27 21:11:34 +02:00
site.go Fix case issues with Params 2016-11-22 17:33:52 +01:00
site_render.go Fix case issues with Params 2016-11-22 17:33:52 +01:00
site_show_plan_test.go all: Unify case of config variable names 2016-10-24 20:56:00 +02:00
site_test.go node to page: Remove Node 2016-11-22 09:57:03 +01:00
site_url_test.go all: Unify case of config variable names 2016-10-24 20:56:00 +02:00
siteJSONEncode_test.go node to page: Remove Node 2016-11-22 09:57:03 +01:00
sitemap.go hugolib: Fix some more Golint warnings 2016-03-23 10:10:28 +01:00
sitemap_test.go node to page: Add all nodes to sitemap 2016-11-22 09:57:03 +01:00
summary.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
taxonomy.go node to page: Remove Node 2016-11-22 09:57:03 +01:00
taxonomy_test.go node to page: Handle translations 2016-11-22 09:57:03 +01:00
translations.go node to page: Re-add translations sort of regular pages 2016-11-22 09:57:03 +01:00