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)
