Don't know if this is a crazy idea, but writing it down just in case it's not.
Rather than adding a conditional to the template language, perhaps there's a way to implement an approach borrowed from the pattern-matching you see in different languages, and to keep it out of the template themselves?
Like, say:
match:
type:
book: ...
article: ...
default: ....
And maybe going further, allow this per-type at the top-level?
Don't know if this is a crazy idea, but writing it down just in case it's not.
Rather than adding a conditional to the template language, perhaps there's a way to implement an approach borrowed from the pattern-matching you see in different languages, and to keep it out of the template themselves?
Like, say:
And maybe going further, allow this per-type at the top-level?