def create_blog(blog, author, title, subtitle):
    document = Document("blogs@%" % blog)
    if not document.exists():
        document.create(
            index_content = title,
            format = "html", author = author,
        )
    else:
        document.set_raw_index(title, "html")
    document.meta.author = author
    document.meta.title = title
    document.meta.subtitle = subtitle
    document.meta.url = "/%s/" % blog
    document.meta.type = "blog"
    document.meta.save()

    # create blog folder
    blog_folder = gsettings.LOCAL_REPO_PATH.joinpath("blogs/%s" % blog)
    if not blog_folder.exists(): blog_folder.makedirs()

    labels_folder = gsettings.LOCAL_REPO_PATH.joinpath("blogs/%s/labels" % blog)
    if not labels_folder.exists(): labels_folder.makedirs()
# }}}

# create_label # {{{
dataset/ETHPy150Open amitu/gitology/src/gitology/blog.py/create_blog/original