mirror of
https://github.com/danielmiessler/fabric
synced 2024-11-08 07:11:06 +00:00
commit
52a39efa8d
@ -52,14 +52,11 @@ def main(tag, tags, silent, fabric):
|
||||
|
||||
# YAML frontmatter stubs for things like Obsidian
|
||||
# Prevent a NoneType ending up in the tags
|
||||
frontmatter_tags = ""
|
||||
if fabric:
|
||||
frontmatter_tags = os.getenv(FM_KEY) or ""
|
||||
|
||||
frontmatter_tags = os.getenv(FM_KEY) or "" if fabric else ""
|
||||
with open(target, "w") as fp:
|
||||
if frontmatter_tags or len(tags) != 0:
|
||||
fp.write("---\n")
|
||||
now = datetime.now().strftime(f"%Y-%m-%d %H:%M")
|
||||
now = datetime.now().strftime("%Y-%m-%d %H:%M")
|
||||
fp.write(f"generation_date: {now}\n")
|
||||
fp.write(f"tags: {frontmatter_tags} {tag} {' '.join(tags)}\n")
|
||||
fp.write("---\n")
|
||||
|
Loading…
Reference in New Issue
Block a user