-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
I'm parsing YAML into a Aeson.Value and passing it straight to the template using bindJson, for using like this (tags would be a YAML field with list value):
<with var="tags">
<a title="Tag" class="px-1 bg-gray-100 rounded">
<value />
</a>
</with>This however doesn't work when the YAML has no fields named "tag"; Heist throws: expression error: can't find "tags" in JSON object (<with> tag)
I'd like to be able to specify a "else" case to render if there is no such field, based on the similar behaviour if the IfElse splice, i.e.
<with var="tags">
<a title="Tag" class="px-1 bg-gray-100 rounded">
<value />
</a>
<else />
<p>This note is not tagged</p> <!-- Can also be empty -->
</with>What do you folks think of this feature? It may be extended to <value> and <snippet> as well.
fiatjaf
Metadata
Metadata
Assignees
Labels
No labels