diff --git a/index.py b/index.py index d8a5910a..ab80a70b 100644 --- a/index.py +++ b/index.py @@ -1,5 +1,6 @@ import os from datetime import datetime +from string import Template from config import INDEX_TEMPLATE, INDEX_ROW_TEMPLATE from parse import derived_link_info @@ -16,7 +17,7 @@ def dump_index(links, service): link_html = f.read() article_rows = '\n'.join( - link_html.format(**derived_link_info(link)) for link in links + Template(link_html).substitute(**derived_link_info(link)) for link in links ) template_vars = { @@ -27,4 +28,4 @@ def dump_index(links, service): } with open(os.path.join(service, 'index.html'), 'w', encoding='utf-8') as f: - f.write(index_html.format(**template_vars)) + f.write(Template(index_html).substitute(template_vars)) diff --git a/templates/index.html b/templates/index.html index f6287e5d..1f358aea 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,7 +3,7 @@