@staticmethod
def detect_file_content(path):
    """ Check if a file is valid entry file, by check its front matter """
    with open(path, 'rt', encoding='utf8') as mf:
        all_lines = ''.join(mf.readlines())
        try:
            start_index = all_lines.index('---\n', 0)
            end_index = all_lines.index('---\n', 4)
            all_lines.index('\nid: ', start_index, end_index)
            all_lines.index('\ntitle: ', start_index, end_index)
        except Exception:
            return False
        else:
            return True
