I'm building a web site with flask and have run into the following problem: I have several different pages that use the exact same navigation bar. So far I've just coped and pasted the HTML code that produces the navbar to each of the files but this seems inefficient.

One solution I thought of was to just put {{navbar|safe}} in each of the template files and then store the navbar html in a single file and pass it as an argument to render\_template. However, the navbar code also contains placeholders so this doesn't work.

What would be a good approach to accomplishing this?