add org files, copy style

This commit is contained in:
Tykayn 2024-11-08 17:40:06 +01:00 committed by tykayn
parent 01e90048c1
commit 0b9f66167c
2947 changed files with 157595 additions and 22033 deletions

View file

@ -15,8 +15,10 @@ args = parser.parse_args()
# Génération du nom de fichier org avec la date et le slug
now = datetime.now()
date_string = now.strftime("%Y-%m-%d")
# date_string = now.strftime("%Y-%m-%d")
date_string = now.strftime("%Y%m%d%H%M%S")
date_string_full = now.strftime("%Y-%m-%d %H:%M:%S")
# date_string_full = now.strftime("%Y%m%d%H%M%S")
slug = args.title.lower().replace(" ", "-")
filename = f"sources/{args.blog_dir}/lang_{args.lang}/{date_string}-{slug}.org"
@ -30,10 +32,11 @@ def create_uuid_property():
with open(filename, "w") as f:
f.write(f"{create_uuid_property()}")
f.write(f"#+TITLE: {args.title}\n")
f.write(f"#+CREATED: {date_string_full}\n")
f.write(f"#+CREATED: <{date_string_full}>\n")
f.write(f"#+TAGS: \n")
f.write(f"#+SLUG: {slug}\n")
f.write(f"#+BLOG: {args.blog_dir}\n\n")
f.write(f"* {args.title}\n\n")
f.write(f"[{date_string}]\n\n")
# f.write(f"[{date_string}]\n\n")
print(f"Le fichier '{filename}' a été créé avec succès.")