Simplify prepare_html_pages by getting rid of the second loop to generate the html pages. Defined a function to generate html file name and use is as a custom filter for the template. Modified simple-basic.html to use the custom filter.