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 @@ Archived Sites
-

+

Archived Sites
- Archived with: Bookmark Archiver on {date_updated} + Archived with: Bookmark Archiver on ${date_updated}

@@ -76,7 +76,7 @@ Starred - Saved Articles ({num_links}) + Saved Articles (${num_links}) Files PDF Screenshot @@ -84,7 +84,7 @@ Original URL - {rows} + ${rows} diff --git a/templates/index_row.html b/templates/index_row.html index ffe4bb9e..a89769f8 100644 --- a/templates/index_row.html +++ b/templates/index_row.html @@ -1,12 +1,12 @@ - {time} - - - {title} {tags} + ${time} + + + ${title} ${tags} - 📂 - 📄 - 🖼 - 🏛 - 🔗 {url} -📂 + 📄 + 🖼 + 🏛 + 🔗 ${url} +