Commit f0a94758 authored by Greg Wilson's avatar Greg Wilson
Browse files

Adding checks for things that commonly go wrong during template conversion.

1. Checking that `` has `root` set to '.'
2. Checking that `_config.yml` has `root` set to '..'
parent 68c14937
......@@ -155,6 +155,10 @@ def check_config(reporter, source_dir):
reporter.check_field(config_file, 'configuration', config, 'title')
reporter.check_field(config_file, 'configuration', config, 'email')
reporter.check({'values': {'root': '..'}} in config.get('defaults', []),
'"root" not set to ".." in configuration')
def read_all_markdown(source_dir, parser):
"""Read source files, returning
......@@ -424,6 +428,12 @@ class CheckIndex(CheckBase):
super(CheckIndex, self).__init__(args, filename, metadata, metadata_len, text, lines, doc)
self.layout = 'lesson'
def check_metadata(self):
super(CheckIndex, self).check_metadata()
self.reporter.check(self.metadata.get('root', '') == '.',
'Root not set to "."')
class CheckEpisode(CheckBase):
"""Check an episode page."""
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment