EXISTING_SLUGS = {f[:-3] for f in os.listdir(OUTPUT_DIR) if f.endswith(".md")}
# default to false, but read from --force flag if it's set
-FORCE_REBUILD = False
-
-if len(sys.argv) > 1 and sys.argv[1] == "--force":
- FORCE_REBUILD = sys.argv[2] == "true"
-
+FORCE_REBUILD = len(sys.argv) > 1 and sys.argv[1] == "--force":
def slugify(title):
return re.sub(r"[^\w-]", "", re.sub(r"\s+", "-", title.lower())).strip("-")
with open(output_path, "w", encoding="utf-8") as f:
f.write(frontmatter.dumps(post))
- print(f"Saved: {output_path}")
\ No newline at end of file
+ print(f"Saved: {output_path}")