summaryrefslogtreecommitdiff
path: root/megapixels/app/site/parser.py
diff options
context:
space:
mode:
authorAdam Harvey <adam@ahprojects.com>2019-04-03 14:35:41 +0200
committerAdam Harvey <adam@ahprojects.com>2019-04-03 14:35:41 +0200
commit0224090a9dcc79de897871cfa573f99cf8f005a5 (patch)
treeec5967fa3d6ca197af1ac12092fe168fdf499d48 /megapixels/app/site/parser.py
parent04677d60e9e867a6d02fa2c99f07f83dff6e6005 (diff)
parentdf707e4316c79375499974fb2a3443f1c049b93c (diff)
.
Diffstat (limited to 'megapixels/app/site/parser.py')
-rw-r--r--megapixels/app/site/parser.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/megapixels/app/site/parser.py b/megapixels/app/site/parser.py
index 06c45f41..dc2a09f2 100644
--- a/megapixels/app/site/parser.py
+++ b/megapixels/app/site/parser.py
@@ -55,7 +55,7 @@ def parse_markdown(metadata, sections, s3_path, skip_h1=False):
elif '### statistics' in section.lower() or '### sidebar' in section.lower():
if len(current_group):
groups.append(format_section(current_group, s3_path))
- current_group = []
+ current_group = [format_include("{% include 'sidebar.html' %}", metadata)]
if 'sidebar' not in section.lower():
current_group.append(section)
in_stats = True
@@ -267,15 +267,6 @@ def format_include(section, metadata):
include_fn = section.strip().strip('\n').strip().strip('{%').strip().strip('%}').strip()
include_fn = include_fn.strip('include').strip().strip('"').strip().strip("'").strip()
return includes_env.get_template(include_fn).render(metadata=metadata)
- # include_dir = cfg.DIR_SITE_INCLUDES
- # try:
- # includes_env.get_template(fp_html)
- # with open(join(include_dir, fp_html), 'r') as fp:
- # html = fp.read().replace('\n', '')
- # return html
- # except Exception as e:
- # print(f'Error parsing include: {e}')
- # return ''
def format_applet(section, s3_path):
"""