orgmode-to-gemini-blog/utils/maker.py

28 lines
751 B
Python
Raw Permalink Normal View History

2025-02-28 16:37:59 +01:00
# génère le contenu d'un nouvel article avec les propriétés spécifiées en config.
def make_article(config):
"""
Génère le contenu d'un nouvel article org-mode
"""
2025-02-28 18:43:17 +01:00
template = f""":PROPERTIES:
:ID: 2d3dea63-7567-4def-80d9-c9bd82d41eed
2025-02-28 16:37:59 +01:00
:END:
2025-02-28 18:43:17 +01:00
#+title: {config['title']}
#+post_ID:
#+post_slug: {config['slug']}
#+post_lang: {config['lang'] if 'lang' in config else 'fr'}
#+post_url: {config['NDD']}{config['schema_slug']}
#+post_title: {config['title']}
#+post_tags:
#+post_series:
#+post_type: post
#+post_status: publish
#+post_date_published: <{config['date_string_full']}>
#+post_date_modified: <{config['date_string_full']}>
#+post_index_page_roam_id: {config['uuid']}
* {config['title']}
2025-02-28 16:37:59 +01:00
"""
return template