hugo/tpl
Tatsushi Demachi 153332706a Make sort tpl func accept field/key chaining arg
'sort' template function used to accept only each element's struct field
name, method name and map key name as its second argument. This extends
it to accept a field/method/key chaining key string like
'Params.foo.bar' as the argument. It evaluates sub elements of each
array or map elements and sorts by them.

Typical use case would be sorting pages by user defined front matter
value. For example, sorting pages by 'Params.foo.bar' is possible by
writing the following template code

    {{ range sort .Data.Pages "Params.foo.bar" }}
        {{ .Content }}
    {{ end }}

It ignores all leading and trailing dots so "Params.foo.bar" can be
written in ".Params.foo.bar"

This also fixes the issue that 'sort' cannot evaluate a pointer value.

Fix #1330
2015-08-07 14:06:06 +02:00
..
template.go On error, return error message, not nil 2015-07-20 14:49:21 +02:00
template_embedded.go Set s.Info.LastChange to Lastmod 2015-05-15 13:10:11 +02:00
template_funcs.go Make sort tpl func accept field/key chaining arg 2015-08-07 14:06:06 +02:00
template_funcs_test.go Make sort tpl func accept field/key chaining arg 2015-08-07 14:06:06 +02:00
template_resources.go Add missing formatting directive in Printf call 2015-08-06 22:46:35 +02:00
template_resources_test.go GetJSON/GetCSV: Add retry on invalid content 2015-06-01 12:05:16 +02:00
template_test.go Add some Ace test cases 2015-05-31 13:13:28 +02:00