Replies: 6 comments 15 replies
-
Dates, along with other YAML metadata, can be accessed in the HTML templates. Example, emanote/default/templates/filters/query-timeline.tpl Lines 9 to 13 in 31aa931 The problem is that it will spit out an error if any note does not have that meta property. I've detailed one approach to solve this here: snapframework/heist#128 ... basically we extend the template syntax to provide "or else" case (which can be empty text, and it has to be done in the Heist library ... however, none of my issues/PRs to that library so far has received a response from the maintainers. |
Beta Was this translation helpful? Give feedback.
-
Great, thank you! I will try editing the HTML template |
Beta Was this translation helpful? Give feedback.
-
For anyone who finds this discussion later, this is what I wrote in <ema:metadata>
<span class="mr-2 text-right text-gray-600">
<value var="date" />
</span>
</ema:metadata> |
Beta Was this translation helpful? Give feedback.
-
For anyone bothered by the error case, this is a solution that uses our friend JavaScript to remove the date error when there is no date set on the note: <div class="flex items-center justify-center mt-2">
<ema:metadata>
<span id="notedate" class="mr-2 text-right text-gray-600">
<value var="date" />
</span>
</ema:metadata>
<script>if (notedate.innerText.includes('error')) notedate.innerText = ''</script>
</div> |
Beta Was this translation helpful? Give feedback.
-
Would be nice to have a template variable for a nicely-formatted date instead of just the raw "date" string as it is in the frontmatter. |
Beta Was this translation helpful? Give feedback.
-
To avoid the decoding error, you can also add an empty date to the index.yaml :) |
Beta Was this translation helpful? Give feedback.
-
Hello!
Just curious whether it would be possible to render the dates associated with neuron-style notes, e.g.
This might only apply to the neuron-style template.
Beta Was this translation helpful? Give feedback.
All reactions