mirror of
https://forge.chapril.org/tykayn/orgmode-to-gemini-blog
synced 2025-06-20 09:04:42 +02:00
up converters
This commit is contained in:
parent
62e7522e95
commit
5d71ff6c5b
4 changed files with 79 additions and 51 deletions
6
utils.py
6
utils.py
|
@ -35,7 +35,7 @@ def trouver_nom_article(fichier_org, blog_name, format="html"):
|
|||
|
||||
nom_article = ''
|
||||
|
||||
mylog('trouver_nom_article format', format)
|
||||
# mylog('trouver_nom_article format', format)
|
||||
# Expressions régulières pour trouver les titres de niveau 1 et 2
|
||||
if format == 'html':
|
||||
titre_niveau_1 = r'<h1\s+(?:id|data-created)="[^"]*">(.*?)</h1>'
|
||||
|
@ -59,7 +59,7 @@ def trouver_nom_article(fichier_org, blog_name, format="html"):
|
|||
if titre_niveau_2_match:
|
||||
nom_article = titre_niveau_2_match.group(1)
|
||||
break
|
||||
mylog(f"Nom de l'article : {nom_article}")
|
||||
# mylog(f"Nom de l'article : {nom_article}")
|
||||
|
||||
return nom_article.replace(blog_name + '_', '').replace('_', ' ')
|
||||
|
||||
|
@ -83,7 +83,7 @@ def find_year_and_slug_on_filename(fichier):
|
|||
if "-" in date_str:
|
||||
slug = enlever_premier_tiret_ou_underscore(slug)
|
||||
|
||||
mylog(f" find_year_and_slug : chemin: {annee}/{slug}/")
|
||||
# mylog(f" find_year_and_slug : chemin: {annee}/{slug}/")
|
||||
return [date_str, annee, slug]
|
||||
return [date_str, annee, fichier.replace(' ', '-').replace('.org', '')]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue