summaryrefslogtreecommitdiff
path: root/megapixels/app
diff options
context:
space:
mode:
Diffstat (limited to 'megapixels/app')
-rw-r--r--megapixels/app/site/builder.py2
-rw-r--r--megapixels/app/site/parser.py18
2 files changed, 16 insertions, 4 deletions
diff --git a/megapixels/app/site/builder.py b/megapixels/app/site/builder.py
index bb1f1701..6b9aa92c 100644
--- a/megapixels/app/site/builder.py
+++ b/megapixels/app/site/builder.py
@@ -41,7 +41,7 @@ def build_page(fn, research_posts, datasets):
elif 'research/' in fn:
# skip_h1 = True
# template = env.get_template("research.html")
- template = env.get_template("datasets.html")
+ template = env.get_template("page.html")
elif 'datasets/index' in fn:
template = env.get_template("datasets.html")
else:
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