summaryrefslogtreecommitdiff
path: root/megapixels/app/site/parser.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-02-28 17:29:16 +0100
committerJules Laplace <julescarbon@gmail.com>2019-02-28 17:29:16 +0100
commitc33406d4da0f03a986db62b0d6b75c5a70114abe (patch)
tree31acecea03e26782512ae3122427ba3f68f9bd3e /megapixels/app/site/parser.py
parent0801726d7a3fd18fb7c4d1ec92e3581699d95ccc (diff)
sidebar on about pages
Diffstat (limited to 'megapixels/app/site/parser.py')
-rw-r--r--megapixels/app/site/parser.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/megapixels/app/site/parser.py b/megapixels/app/site/parser.py
index 9e904e00..b8bbf289 100644
--- a/megapixels/app/site/parser.py
+++ b/megapixels/app/site/parser.py
@@ -43,17 +43,19 @@ def parse_markdown(metadata, sections, s3_path, skip_h1=False):
footnotes.append(section)
elif ignoring:
continue
- elif '### Statistics' in section:
+ 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.append(section)
+ if 'sidebar' not in section.lower():
+ current_group.append(section)
in_stats = True
- elif in_stats and not section.strip().startswith('## '):
+ elif in_stats and not section.strip().startswith('## ') and 'end sidebar' not in section.lower():
current_group.append(section)
- elif in_stats and section.strip().startswith('## '):
+ elif in_stats and section.strip().startswith('## ') or 'end sidebar' in section.lower():
current_group = [format_section(current_group, s3_path, 'right-sidebar', tag='div')]
- current_group.append(section)
+ if 'end sidebar' not in section.lower():
+ current_group.append(section)
in_stats = False
elif section.strip().startswith('```'):
groups.append(format_section(current_group, s3_path))