def get_meta_data(filename):
    log.debug('Parsing meta-data from %s' % filename)
    with io.open(filename, 'rt', encoding='utf-8') as f:
        content = f.read()

    meta = {}
    post_match = POST_RE.match(content)

    if post_match:
        meta = load(post_match.group('meta'), Loader=Loader)
        body = post_match.group('body').strip()
        if 'layout' in meta:
            # The body is pure Markdown without any Jinja syntax
            meta['content'] = markdown.markdown(body, ['codehilite'])
            meta['raw'] = wrap_jinja2(body, layout=meta['layout'])
        else:
            # The body contains Jinja syntax
            body_without_jinja = strip_jinja2(body)
            meta['content'] = markdown.markdown(
                body_without_jinja, ['codehilite'])
            meta['raw'] = body
    else:
        meta['raw'] = content.strip()

    meta['filename'] = filename
    return meta
Recursively expand ``nodegroup`` from ``nodegroups``; ignore nodegroups in ``skip``
dataset/ETHPy150Open semk/voldemort/voldemort/template.py/get_meta_data--crossover with--dataset/ETHPy150Open saltstack/salt/salt/utils/minions.py/nodegroup_comp