From 494c7aac6a3e2179a4ec8daca325f3be9c1b2c71 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Thu, 1 Jul 2021 10:36:45 -0400 Subject: [PATCH] put the whole content in the Atom feed --- build.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 51179b4..9bb3a2b 100644 --- a/build.py +++ b/build.py @@ -7,7 +7,6 @@ # TODO: replace gallery.tinyletterapp.com images with locally hosted content. # TODO: in template.html, add apple touch icon, maybe other favicon sizes. # TODO: local mirrors of all papers in publications.html -# TODO: just put the whole HTML content in the Atom feed? # TODO: atom feed logo in the top-right. # Requirements: @@ -118,6 +117,7 @@ def process_markdown_files(): blog_entry['url'] = 'https://www.mcmillen.dev/' + page_url blog_entry['date'] = update_date blog_entry['summary'] = find_summary(html_content) + blog_entry['content'] = html_content blog_entries.append(blog_entry) os.makedirs(out_dirpath, exist_ok=True) @@ -144,7 +144,7 @@ def make_atom_feed(): Colin McMillen's Blog - + {last_update} Colin McMillen @@ -160,9 +160,12 @@ def make_atom_feed(): {title} {url} - + + + {updated} - {summary} (...) ''' @@ -178,7 +181,8 @@ def make_atom_feed(): url=entry['url'], title=entry['title'], updated=update_date, - summary=entry['summary'])) + summary=entry['summary'], + content=entry['content'])) entries_text = entries_io.getvalue() @@ -187,7 +191,7 @@ def make_atom_feed(): entries=entries_io.getvalue()) entries_io.close() - atom_filename = os.path.join(output_directory, 'atom.xml') + atom_filename = os.path.join(output_directory, 'feed.atom') print_file('', atom_filename) atom_file = open(atom_filename, 'w') atom_file.write(atom_feed)