diff options
| author | adamhrv <adam@ahprojects.com> | 2019-07-03 13:47:23 +0200 |
|---|---|---|
| committer | adamhrv <adam@ahprojects.com> | 2019-07-03 13:47:23 +0200 |
| commit | 2816f045090b99f48f0b26d305eee27e1ab94d85 (patch) | |
| tree | 7b2179baa6ab6dcce970218ae9e4935b62b64561 /megapixels/app/site/parser.py | |
| parent | 36a226c3fb3379f4f332c1daad7fe85e2bbea954 (diff) | |
| parent | 411aa602b9cf886758c4ff5ca5550c43ae7b7804 (diff) | |
fix merge
Diffstat (limited to 'megapixels/app/site/parser.py')
| -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 |
