'Load a YAML config.
Raise BuildEnvironmentError if failed due to syntax errors.'

def load_yaml_config(self):

    try:
        return yaml.safe_load(open(os.path.join(self.root_path, 'mkdocs.yml'), 'r'))
    except IOError:
        return {'site_name': self.version.project.name}
    except yaml.YAMLError as exc:
        note = ''
        if hasattr(exc, 'problem_mark'):
            mark = exc.problem_mark
            note = ('    (line    %d,    column    %d)' % ((mark.line + 1), (mark.column + 1)))
        raise BuildEnvironmentError(('Your    mkdocs.yml    could    not    be    loaded,    possibly    due    to    a    syntax    error%s' % (note,)))
