You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add support for named filter arguments (fixes#42)
Implement filter parameters for Shopify Liquid compatibility.
Filters can now accept named arguments alongside positional args.
Examples:
{{image | img_url: '580x', scale: 2}}
{{ order.created_at | date: format: 'date' }}
{{ 'customer.order.title' | t: name: order.name }}
Filter functions receive named args as map[string]any in their last parameter.
BREAKING CHANGE: The expressions.Context interface signature changed.
External implementations of ApplyFilter must update their signature from
ApplyFilter(string, valueFn, []valueFn) (any, error)
to
ApplyFilter(string, valueFn, []filterParam) (any, error)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+63-2Lines changed: 63 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,69 @@ fmt.Println(out)
58
58
59
59
See the [API documentation][godoc-url] for additional examples.
60
60
61
+
### Filters
62
+
63
+
Filters transform template values. The library includes [standard Shopify Liquid filters](https://shopify.github.io/liquid/filters/abs/), and you can also define custom filters.
0 commit comments