I've looked at Liquid and the like, but I cannot find a way to make a "one file" template that can handle all situations. I don't want to reinvent the wheel, but I will if I cannot find an existing solution.
The template system looks like this:
{block:Text}
<li class="post text">
{block:Title}
<h3><a href="{Permalink}">{Title}</a></h3>
{/block:Title}
{Body}
</li>
{/block:Text}