-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
First, thanks for sigil. I prefer it already to envsubst and shell evaluation.
% print "{{ \$x | default \"foo\" }}" | tee template
{{ $x | default "foo" }}This did not behave as I expected:
% sigil -f template
template: template:1: undefined variable "$x"
Interestingly, in this case, the default works:
% sigil -f template x=
foo
Regular behavior, of course, is fine:
% sigil -f template x=bar
bar
I'm using sigil 0.6.0 on macOS.
Now, after reading how Hugo does templating, I tried using $.x instead of $x, and...
% print "{{ \$.x | default \"foo\" }}" | tee template
{{ $.x | default "foo" }}
% sigil -f template
foo
Ok, this is the result I wanted, but it took a lot of horsing around.
At the least, I'd suggest more documentation.
Metadata
Metadata
Assignees
Labels
No labels