summaryrefslogtreecommitdiff
path: root/megapixels/app/site/parser.py
diff options
context:
space:
mode:
authorjules@lens <julescarbon@gmail.com>2019-10-10 13:33:31 +0200
committerjules@lens <julescarbon@gmail.com>2019-10-10 13:33:31 +0200
commit7d72cbb935ec53ce66c6a0c5cdc68f157be1d35f (patch)
treea44049683c3c5e44449fe2698bb080329ecf7e61 /megapixels/app/site/parser.py
parent488a65aa5caba91c1384e7bcb2023056e913fc22 (diff)
parentcdc0c7ad21eb764cfe36d7583e126660d87fe02d (diff)
Merge branch 'master' of asdf.us:megapixels_dev
Diffstat (limited to 'megapixels/app/site/parser.py')
-rw-r--r--megapixels/app/site/parser.py30
1 files changed, 29 insertions, 1 deletions
diff --git a/megapixels/app/site/parser.py b/megapixels/app/site/parser.py
index 3700efd1..6ab8c700 100644
--- a/megapixels/app/site/parser.py
+++ b/megapixels/app/site/parser.py
@@ -163,6 +163,35 @@ def intro_section(metadata, s3_path):
"""
section = "<section class='intro_section' style='background-image: url({})'>".format(s3_path + metadata['image'])
+ # section += "<div class='inner'>"
+
+ # parts = []
+ # if 'desc' in metadata:
+ # desc = metadata['desc']
+ # # colorize the first instance of the database name in the header
+ # if 'color' in metadata and metadata['title'] in desc:
+ # desc = desc.replace(metadata['title'], "<span style='color: {}'>{}</span>".format(metadata['color'], metadata['title']), 1)
+ # section += "<div class='hero_desc'><span class='bgpad'>{}</span></div>".format(desc, desc)
+
+ # if 'subdesc' in metadata:
+ # subdesc = markdown(metadata['subdesc']).replace('<p>', '').replace('</p>', '')
+ # section += "<div class='hero_subdesc'><span class='bgpad'>{}</span></div>".format(subdesc, subdesc)
+
+ # section += "</div>"
+ section += "</section>"
+
+ if 'caption' in metadata:
+ section += "<section><div class='image'><div class='intro-caption caption'>{}</div></div></section>".format(metadata['caption'])
+
+ return section
+
+
+def intro_section_v1(metadata, s3_path):
+ """
+ Build the intro section for datasets
+ """
+
+ section = "<section class='intro_section' style='background-image: url({})'>".format(s3_path + metadata['image'])
section += "<div class='inner'>"
parts = []
@@ -185,7 +214,6 @@ def intro_section(metadata, s3_path):
return section
-
def fix_images(lines, s3_path):
"""
do our own transformation of the markdown around images to handle wide images etc