From fcd19ef4c46407e30b9453bb2c1c9d195be8020e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 28 Jun 2019 02:40:06 -0400 Subject: fix up research blog index --- megapixels/app/site/parser.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'megapixels/app') diff --git a/megapixels/app/site/parser.py b/megapixels/app/site/parser.py index 1e35e977..3700efd1 100644 --- a/megapixels/app/site/parser.py +++ b/megapixels/app/site/parser.py @@ -5,6 +5,7 @@ import glob import simplejson as json import mistune from jinja2 import Environment, FileSystemLoader, select_autoescape +import dateutil import app.settings.app_cfg as cfg import app.site.s3 as s3 @@ -316,15 +317,26 @@ def parse_research_index(research_posts): print("No path attribute for post") return "" s3_path = s3.make_s3_path(cfg.S3_SITE_PATH, post['path']) + post_date = dateutil.parser.parse(post['published']).strftime('%d %B %Y') if 'image' in post: post_image = s3_path + post['image'] else: post_image = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' - row = "
Research post

{}

{}

".format( + row = """ +
+
+

{}

+

{}

+

{}

+

Read more...

+
+
+ """.format( post['path'], post_image, - post['title'], - post['tagline']) + post_date, + post['desc'], + post['subdesc']) content += row content += '' return content -- cgit v1.2.3-70-g09d2