Keats/tera

Is this really the shortest attribute safe get/fetch one-liner

Closed this issue · 2 comments

I know nulls and rust, etc.

But in a templating language with all the extra limitations, some things get cumbersome, like wrapping all gets of Option(al) attributes in {%if% } etc. Am I missed a better one-liner?

[link] | map(attribute="rel") | first

Or is it more of a Zola concern cause of the extra limitations through that context (can't just roll a custom function or filter)

Sorry, and thank you?

You're missing the one liner? It usually depends on what's the data structure but you can use the default filter

Yes but I was originally looking for/missing was the get filter, which your mention of "default" finally led me to when I searched all instances of "default" in the docs. But maybe default with empty string is cleaner; six one way.

I had tried to guess at it, but didn't see it had key named param, which is of course the most obvious name possible.

I thought maybe it was a documentation issue, but no, this is just user error (late night hacking == bad reading comprehension?). Sorry and thanks!