public notes work now
This commit is contained in:
@@ -11,13 +11,15 @@ PRIVATE_VAULT_DIR = Path("/vault")
|
||||
PUBLIC_VAULT_DIR = "/content"
|
||||
|
||||
build.obsidian_vault(PRIVATE_VAULT_DIR) # initialize the private obsidian repo
|
||||
# build.public_vault(PUBLIC_VAULT_DIR) # initialize the public notes from the private 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/push") #webhook for vault updated
|
||||
def
|
||||
|
||||
@app.route ("/<filename>") # renders a filename if not otherwise specified
|
||||
def render_post(filename):
|
||||
|
||||
14
app/build.py
14
app/build.py
@@ -44,18 +44,18 @@ def obsidian_vault(dest = "/vault"): # makes sure there is a vault in dest
|
||||
print("cloned vault!")
|
||||
return 1
|
||||
|
||||
def public_notes(privateVault = "/vault"): # return a list of notes tagged with public from an obsidian directory in privateVault
|
||||
# build vault object from source
|
||||
def public_vault(privateVault = "/vault", dest = "/content"): # build the public vault in dest from an obsidian repo in src
|
||||
vault = Vault(privateVault)
|
||||
if not(vault):
|
||||
print("could not find vault")
|
||||
raise NameError("vaultNotFound")
|
||||
return []
|
||||
# return a list of notes
|
||||
return vault.get_notes_with_tag("public")
|
||||
return 0
|
||||
|
||||
print(f"valid vault{vault}")
|
||||
|
||||
publicNotes = vault.get_notes_with_tag("public")
|
||||
|
||||
def public_vault(privateVault = "/vault", dest = "/content"): # build the public vault in dest from an obsidian repo in src
|
||||
for note in public_notes(privateVault):
|
||||
print(f"publicNotes: {publicNotes}")
|
||||
for note in publicNotes:
|
||||
print(note.title)
|
||||
shutil.copy2(f"{note.path}", dest)
|
||||
|
||||
Reference in New Issue
Block a user