Templates: Fast and pythonic built-in template engine and support for mako, jinja2 and cheetah templates.
From bottle's website.
You can use Mako, which is a templating language for Python. You can use it with bottle. Here is a section on Defs and Blocks.