forked from unit/ciclostile
add recursive search
This commit is contained in:
parent
eccff07b8f
commit
a32f16e07e
|
@ -1,4 +1,6 @@
|
||||||
import os
|
import os
|
||||||
|
from glob import glob
|
||||||
|
|
||||||
from flask import Blueprint, send_from_directory, render_template, request, jsonify
|
from flask import Blueprint, send_from_directory, render_template, request, jsonify
|
||||||
from flask_httpauth import HTTPDigestAuth
|
from flask_httpauth import HTTPDigestAuth
|
||||||
import ciclostile
|
import ciclostile
|
||||||
|
@ -56,5 +58,5 @@ POST_DIR = "."
|
||||||
|
|
||||||
@api.route("/posts")
|
@api.route("/posts")
|
||||||
def posts_list():
|
def posts_list():
|
||||||
dirs = os.listdir(os.path.join(POST_DIR))
|
posts = glob(f"{POST_DIR}/**/*.md", recursive=True)
|
||||||
return jsonify(dirs)
|
return jsonify(posts)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user