diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-06-28 02:40:06 -0400 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-06-28 02:40:06 -0400 |
| commit | fcd19ef4c46407e30b9453bb2c1c9d195be8020e (patch) | |
| tree | df29d3722b84ed07c3b0d02a90173c118e037690 /megapixels/app | |
| parent | cd529774334bf719bc9ba086f54b4521d2b03700 (diff) | |
fix up research blog index
Diffstat (limited to 'megapixels/app')
| -rw-r--r-- | megapixels/app/site/parser.py | 18 |
1 files changed, 15 insertions, 3 deletions
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 = "<a href='{}'><section class='wide'><img src='{}' alt='Research post' /><section><h1>{}</h1><h2>{}</h2></section></section></a>".format( + row = """ + <a href='{}'><section class='wide' style='background-image: url({});' /> + <section> + <h4><span class='bgpad'>{}</span></h4> + <h2><span class='bgpad'>{}</span></h2> + <h3><span class='bgpad'>{}</span></h3> + <h4 class='readmore'><span class='bgpad'>Read more...</span></h4> + </section> + </section></a> + """.format( post['path'], post_image, - post['title'], - post['tagline']) + post_date, + post['desc'], + post['subdesc']) content += row content += '</div>' return content |
