mirror of
https://forge.chapril.org/tykayn/orgmode-to-gemini-blog
synced 2025-06-20 09:04:42 +02:00
change slug
This commit is contained in:
parent
a5ddf701e5
commit
895996cf6b
1959 changed files with 62900 additions and 64185 deletions
|
@ -66,14 +66,17 @@ def generer_index(dossier_source, fichier_index):
|
|||
article_name = trouver_nom_article(file_path_org, args.source, 'org')
|
||||
|
||||
basename_file = os.path.basename(file_path_org)
|
||||
article_relative_url = find_slug_in_file_basename(basename_file)
|
||||
date_str, annee, slug = find_year_and_slug(basename_file)
|
||||
|
||||
article_relative_url=f"/{annee}/{slug}/"
|
||||
if not article_name:
|
||||
article_name = article_relative_url.replace('-', ' ')
|
||||
article_name = basename_file.replace('-', ' ')
|
||||
|
||||
if global_config["slug_with_year"]:
|
||||
new_folder_path_this_article = os.path.join(dossier_parent, f"html-websites/{args.source}/{article_relative_url}/")
|
||||
|
||||
|
||||
print("article_relative_url",article_relative_url)
|
||||
# déplacer le fichier html dans le dossier slug,
|
||||
# et le renommer en index.html ensuite pour ne pas modifier l'index du blog
|
||||
contenu_index_html += f"<br/><a href={article_relative_url}>{article_name}</a>"
|
||||
|
@ -121,7 +124,7 @@ def generer_index(dossier_source, fichier_index):
|
|||
print(' ')
|
||||
with open(chemin_fichier_index_html, 'w', encoding='utf-8') as file:
|
||||
print('contenu_index_html', contenu_index_html)
|
||||
contenu_index_html = enrich_one_file(contenu_index_html)
|
||||
# contenu_index_html = enrich_one_file(contenu_index_html)
|
||||
file.write(contenu_index_html)
|
||||
print(f" ------------ build_indexes: Fichier d'index '{chemin_fichier_index_html}' généré avec succès.")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue