def get_yaml(path):
    """
    Return the Yaml block of a post and the linenumbers of it.
    """
    end = False
    yaml = ""
    num = 0

    with open(path, 'r', encoding='utf-8') as f:
        for line in f.readlines():
            if line.strip() == '---':
                if end:
                    break
                else:
                    end = True
                    continue
            else:
                num += 1

            yaml += line

    return yaml, num