本文整理汇总了Python中writer.Writer.write_blog方法的典型用法代码示例。如果您正苦于以下问题:Python Writer.write_blog方法的具体用法?Python Writer.write_blog怎么用?Python Writer.write_blog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类writer.Writer
的用法示例。
在下文中一共展示了Writer.write_blog方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_build
# 需要导入模块: from writer import Writer [as 别名]
# 或者: from writer.Writer import write_blog [as 别名]
def do_build(args):
#load config
config_file = os.path.join(args.src_dir,"_config.py")
try:
config.init(config_file)
except config.ConfigNotFoundException:
print >>sys.stderr, ("No configuration found: %s" % config_file)
parser.exit(1, "Want to make a new site? Try `blogofile init`\n")
logger.info("Running user's pre_build() function..")
writer = Writer(output_dir="_site")
if config.blog_enabled == True:
config.pre_build()
posts = post.parse_posts("_posts")
if args.include_drafts:
drafts = post.parse_posts("_drafts", config)
for p in drafts:
p.draft = True
else:
drafts = None
writer.write_blog(posts, drafts)
else:
#Build the site without a blog
writer.write_site()
logger.info("Running user's post_build() function..")
config.post_build()