[add] pwa, icons, banner, themes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,13 +1,25 @@
|
||||
from flask import Blueprint
|
||||
from flask import make_response, render_template
|
||||
from flask import make_response, render_template, send_from_directory
|
||||
from html_sanitizer import Sanitizer
|
||||
from markdown import markdown
|
||||
from vreader.config import Config
|
||||
import os
|
||||
|
||||
|
||||
bp = Blueprint("common", __name__)
|
||||
sanitizer = Sanitizer()
|
||||
|
||||
|
||||
@bp.route("/static/<path:path>")
|
||||
def static(path):
|
||||
return send_from_directory("static", path)
|
||||
|
||||
|
||||
@bp.route("/manifest.json")
|
||||
def manifest():
|
||||
return send_from_directory("static", "manifest.json")
|
||||
|
||||
|
||||
@bp.route("/", methods=["GET"])
|
||||
def main_entry():
|
||||
# Get Files
|
||||
@@ -30,6 +42,7 @@ def main_entry():
|
||||
|
||||
return make_response(render_template("index.html", articles=articles))
|
||||
|
||||
|
||||
@bp.route("/articles/<id>", methods=["GET"])
|
||||
def article_item(id):
|
||||
|
||||
|
||||
@@ -4,17 +4,9 @@ from flask import Blueprint, request
|
||||
from vreader.config import Config
|
||||
import vreader
|
||||
|
||||
|
||||
bp = Blueprint("v1", __name__, url_prefix="/api/v1")
|
||||
|
||||
@bp.route("/articles", methods=["GET"])
|
||||
def articles():
|
||||
directory = str(Config.DATA_PATH)
|
||||
|
||||
all_files = os.listdir(directory)
|
||||
markdown_files = [file for file in all_files if file.endswith(".md")]
|
||||
articles = [parse_filename(file) for file in markdown_files]
|
||||
|
||||
return articles
|
||||
|
||||
@bp.route("/generate", methods=["POST"])
|
||||
def generate():
|
||||
|
||||
Reference in New Issue
Block a user