本文整理汇总了Python中resources.Resources.get_about方法的典型用法代码示例。如果您正苦于以下问题:Python Resources.get_about方法的具体用法?Python Resources.get_about怎么用?Python Resources.get_about使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类resources.Resources
的用法示例。
在下文中一共展示了Resources.get_about方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Resources
# 需要导入模块: from resources import Resources [as 别名]
# 或者: from resources.Resources import get_about [as 别名]
from resources import Resources
import io
from flask import render_template
from flask import Flask
resources = Resources()
resources.init()
app = Flask(__name__)
with app.app_context():
with io.open('index.html', 'w') as output:
output.write(render_template("archives.html", posts=resources.posts(), title="archives"))
with io.open('archives.html', 'w') as output:
output.write(render_template("archives.html", posts=resources.posts(), title="archives"))
with io.open('about.html', 'w') as output:
post = resources.get_about()
output.write(render_template("post.html", post=post, title="about"))
with io.open('notes.html', 'w') as output:
post = resources.get_note()
output.write(render_template("post.html", post=post, title="notes"))
with io.open('categories.html', 'w') as output:
output.write(render_template("categories.html", categories=resources.categories(), title="categories"))
for post in resources.posts():
with io.open('archives/' + post.link, 'w') as output:
output.write(render_template("post.html", post=post, title=post.title))