add recursive search

This commit is contained in:
subnixr 2018-04-24 18:17:54 +02:00
parent eccff07b8f
commit a32f16e07e

View File

@ -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)