mirror of
https://forge.chapril.org/tykayn/orgmode-to-gemini-blog
synced 2025-06-20 09:04:42 +02:00
ajout d'image og dans les articles si existant
This commit is contained in:
parent
ce6eb680b7
commit
e1f8bf93e0
3 changed files with 25 additions and 7 deletions
|
@ -11,11 +11,13 @@ parser = argparse.ArgumentParser(description="Générer un nouvel article en mod
|
|||
parser.add_argument("--title", nargs="?", help="Le titre de l'article.")
|
||||
parser.add_argument("--lang", nargs="?", default="fr", help="La langue de l'article (par défaut : fr pour Français ou en pour English).")
|
||||
parser.add_argument("--blog_dir", nargs="?", default=None, help="Le nom du dossier de blog (sous source/). Si non spécifié, une liste de dossiers disponibles sera proposée.")
|
||||
parser.add_argument("--year_prefix_in_slug", nargs="?", default=True, help="Ajouter l'année au début du slug.")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Définition du dossier de base pour les blogs
|
||||
base_blog_dir = "sources/"
|
||||
year_prefix_in_slug = args.year_prefix_in_slug
|
||||
|
||||
# Si aucun dossier de blog n'est spécifié, proposer une sélection
|
||||
if args.blog_dir is None:
|
||||
|
@ -67,6 +69,12 @@ if args.title:
|
|||
slug = args.title.lower().replace(" ", "-")
|
||||
slug = slug.replace("--", "-")
|
||||
slug = slug.replace("--", "-")
|
||||
|
||||
if year_prefix_in_slug:
|
||||
schema_slug = f"{now.year}/{slug}"
|
||||
else:
|
||||
schema_slug = slug
|
||||
|
||||
file_abs_path = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
if args.lang == 'fr' or args.lang == 'en':
|
||||
|
@ -91,13 +99,16 @@ with open(filename, "w") as f:
|
|||
|
||||
#+title: {args.title}
|
||||
#+post_ID:
|
||||
#+post_slug: organisation-de-taches-orgmode
|
||||
#+post_url: https://www.ciperbliss.com/{now.year}/{slug}
|
||||
#+post_slug: {slug}
|
||||
|
||||
|
||||
#+post_url: https://www.ciperbliss.com/{schema_slug}
|
||||
#+post_title: {args.title}
|
||||
#+post_tags:
|
||||
#+post_series:
|
||||
#+post_type: post
|
||||
#+post_status: publish
|
||||
#+post_picture:
|
||||
#+post_date_published: <{date_string_full}>
|
||||
#+post_date_modified: <{date_string_full}>
|
||||
#+post_index_page_roam_id: {uuid}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue