From bc00607685ee7d75c424151d11904d68ac8ab5fa Mon Sep 17 00:00:00 2001 From: venus Date: Wed, 11 Mar 2026 18:24:04 -0500 Subject: [PATCH] updated index --- ' | 28 ---------------------------- app/__init__.py | 2 +- app/build.py | 1 + 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 ' diff --git a/' b/' deleted file mode 100644 index a9e4de4..0000000 --- a/' +++ /dev/null @@ -1,28 +0,0 @@ -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 bea6578..eaefdd8 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -17,7 +17,7 @@ build.public_vault(PRIVATE_VAULT_DIR, PUBLIC_VAULT_DIR) # initialize the public 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 + return build.html_file("index.md", PUBLIC_VAULT_DIR) @app.route("/api/vault-update", methods=['POST', 'GET']) #webhook for vault updated def update_vault(): # TODO SECURE THIS WITH SECRETTTTT or auth header diff --git a/app/build.py b/app/build.py index 25810c3..30e3415 100644 --- a/app/build.py +++ b/app/build.py @@ -45,6 +45,7 @@ def obsidian_vault(dest = "/vault"): # makes sure there is a vault in dest return 1 def public_vault(privateVault = "/vault", dest = "/content"): # build the public vault in dest from an obsidian repo in src + #TODO delete old documents vault = Vault(privateVault) if not(vault): print("could not find vault")