mirror of
https://forge.chapril.org/tykayn/orgmode-to-gemini-blog
synced 2025-06-20 09:04:42 +02:00
add org files, copy style
This commit is contained in:
parent
01e90048c1
commit
0b9f66167c
2947 changed files with 157595 additions and 22033 deletions
|
@ -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.")
|
Loading…
Add table
Add a link
Reference in a new issue