fix #1327 -- fix submenus in Jinja themes

This is #1327.

cc @tritium21.