Private
Public Access
1
0

first commit

This commit is contained in:
2025-12-22 06:29:13 +01:00
commit 08cb8f4cc9
7 changed files with 105 additions and 0 deletions

29
app.py Normal file
View File

@@ -0,0 +1,29 @@
from flask import Flask, render_template
from flask_flatpages import FlatPages
DEBUG = True
FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_EXTENSION = '.md'
app = Flask(__name__)
app.config.from_object(__name__)
pages = FlatPages(app)
FLATPAGES_MARKDOWN_EXTENSIONS = ['fenced_code', 'tables']
app.config['FLATPAGES_MARKDOWN_EXTENSIONS'] = FLATPAGES_MARKDOWN_EXTENSIONS
@app.route('/')
def index():
posts = sorted(pages, key=lambda p: p.meta.get('date'), reverse=True)
return render_template('index.html', posts=posts)
@app.route('/<path:path>/')
def post(path):
page = pages.get_or_404(path)
return render_template('post.html', page=page)
@app.route('/about')
def about():
return render_template('about.html')
if __name__ == "__main__":
app.run(port=5001)