diff options
Diffstat (limited to 'megapixels/app/site/parser.py')
| -rw-r--r-- | megapixels/app/site/parser.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/megapixels/app/site/parser.py b/megapixels/app/site/parser.py index b3d3a8c2..f739315a 100644 --- a/megapixels/app/site/parser.py +++ b/megapixels/app/site/parser.py @@ -66,6 +66,8 @@ def format_applet(section, s3_path): opt = None if command == 'python' or command == 'javascript' or command == 'code': return format_section([ section ], s3_path) + if command == '': + return '' applet['command'] = command if opt: @@ -101,6 +103,10 @@ def parse_markdown(sections, s3_path, skip_h1=False): groups.append(format_section(current_group, s3_path)) groups.append(format_metadata(section)) current_group = [] + elif '![fullwidth:' in section: + groups.append(format_section(current_group, s3_path)) + groups.append(format_section([section], s3_path, type='fullwidth')) + current_group = [] elif '![wide:' in section: groups.append(format_section(current_group, s3_path)) groups.append(format_section([section], s3_path, type='wide')) @@ -221,8 +227,20 @@ def read_research_post_index(): """ Generate an index of the research (blog) posts """ + return read_post_index('research') + +def read_datasets_index(): + """ + Generate an index of the datasets + """ + return read_post_index('datasets') + +def read_post_index(basedir): + """ + Generate an index of posts + """ posts = [] - for fn in sorted(glob.glob('../site/content/research/*/index.md')): + for fn in sorted(glob.glob('../site/content/{}/*/index.md'.format(basedir))): metadata, valid_sections = read_metadata(fn) if metadata is None or metadata['status'] == 'private' or metadata['status'] == 'draft': continue |
