Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix case issues with Params #2630

Merged
merged 1 commit into from Nov 22, 2016
Merged

Fix case issues with Params #2630

merged 1 commit into from Nov 22, 2016

Commits on Nov 22, 2016

  1. 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 gohugoio#2615
    Fixes gohugoio#1129
    Fixes gohugoio#2590
    bep committed Nov 22, 2016
    Copy the full SHA
    1aee3b7 View commit details
    Browse the repository at this point in the history