def METHOD_NAME(self, path, content=None, onefile=False, is_page=False, **kw):
    """Create post file with optional metadata."""
    metadata = OrderedDict()
    metadata.update(self.default_metadata)
    metadata.update(kw)
    makedirs(os.path.dirname(path))
    if not content.endswith('\n'):
        content += '\n'
    with codecs.open(path, "wb+", "utf8") as fd:
        if onefile:
            fd.write('<!--\n')
            fd.write(write_metadata(metadata).rstrip())
            fd.write('\n-->\n\n')
        fd.write(content)