In Go 1.23, you can now do "else with" logic branches in templates

From Go 1.23 Release Notes - The Go Programming Language :

text/template

Templates now support the new “else with” action, which reduces template complexity in some use cases.

Past: Support proposal to add "else with" like "else if" feature in templates

4 Likes

This is correct, but you need to wait for the next Hugo release (or build from source).

2 Likes