husk/freezer.py

30 lines
548 B
Python
Raw Normal View History

2022-09-02 09:05:59 +02:00
from flask_frozen import Freezer
from start_site import app, list_files
#@app.route('/<path:path>')
#def feed(path):
# ...
# return feed
freezer = Freezer(app)
_path = "templates/content/"
_files = list_files(_path)
_files = [file[len(_path):-len(".md")] for file in _files]
print(_files)
@freezer.register_generator
def content():
for _file in _files:
yield {"path": _file }
#@freezer.register_generator
#def errorhandler():
# yield "/404"
if __name__ == '__main__':
freezer.freeze()
#freezer.run(debug=True)