Browse Source

add recursive search

master
subnixr 4 years ago
parent
commit
a32f16e07e
  1. 6
      src/ciclostile/web/api.py

6
src/ciclostile/web/api.py

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

Loading…
Cancel
Save