|
|
@ -1,4 +1,6 @@ |
|
|
|
import os |
|
|
|
from glob import glob |
|
|
|
|
|
|
|
from flask import Blueprint, send_from_directory, render_template, request, jsonify |
|
|
|
from flask_httpauth import HTTPDigestAuth |
|
|
|
import ciclostile |
|
|
@ -56,5 +58,5 @@ POST_DIR = "." |
|
|
|
|
|
|
|
@api.route("/posts") |
|
|
|
def posts_list(): |
|
|
|
dirs = os.listdir(os.path.join(POST_DIR)) |
|
|
|
return jsonify(dirs) |
|
|
|
posts = glob(f"{POST_DIR}/**/*.md", recursive=True) |
|
|
|
return jsonify(posts) |
|
|
|