diff --git a/' b/' new file mode 100644 index 0000000..a9e4de4 --- /dev/null +++ b/' @@ -0,0 +1,28 @@ +from flask import Flask +from app import build +from pathlib import Path +import markdown +import os +from dotenv import load_dotenv + +app = Flask(__name__) + +PRIVATE_VAULT_DIR = Path("/vault") +PUBLIC_VAULT_DIR = "/content" + +build.obsidian_vault(PRIVATE_VAULT_DIR) # initialize the private obsidian repo +build.public_vault(PRIVATE_VAULT_DIR, PUBLIC_VAULT_DIR) # initialize the public notes from the private repo + +@app.route("/") +def index(): + md_content = "# Welcome to my blog!\nThis is rendered from **Markdown**.\n##[test](http://localhost/test)" + html_content = markdown.markdown(md_content) + return html_content +@app.route("/api/vault-update") #webhook for vault updated +def update_vault(): +# TODO SECURE THIS WITH SECRETTTTT or auth header + print(build.public_vault(PRIVATE_VAULT_DIR, PUBLIC_VAULT_DIR))# initialize the public notes from the private repo + return "vault-rebuilt" +@app.route ("/") # renders a filename if not otherwise specified +def render_post(filename): + return build.html_file(filename, PUBLIC_VAULT_DIR) diff --git a/app/__init__.py b/app/__init__.py index 3722a8d..a9e4de4 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -18,19 +18,11 @@ def index(): md_content = "# Welcome to my blog!\nThis is rendered from **Markdown**.\n##[test](http://localhost/test)" html_content = markdown.markdown(md_content) return html_content -<<<<<<< HEAD @app.route("/api/vault-update") #webhook for vault updated def update_vault(): # TODO SECURE THIS WITH SECRETTTTT or auth header print(build.public_vault(PRIVATE_VAULT_DIR, PUBLIC_VAULT_DIR))# initialize the public notes from the private repo return "vault-rebuilt" - - - -======= -@app.route("/api/push") #webhook for vault updated ->>>>>>> 399920b (updated compose) - @app.route ("/") # renders a filename if not otherwise specified def render_post(filename): return build.html_file(filename, PUBLIC_VAULT_DIR)