mirror of
https://forge.chapril.org/tykayn/orgmode-to-gemini-blog
synced 2025-06-20 09:04:42 +02:00
generate tags pages with jinja template
This commit is contained in:
parent
8e32423dce
commit
367c7754c6
8 changed files with 178 additions and 42 deletions
|
@ -58,10 +58,15 @@ for file_name in os.listdir(directory):
|
|||
if isinstance(tags, set):
|
||||
tags = list(tags)
|
||||
boom = basename.split('__')
|
||||
# Convertir le contenu Org en HTML
|
||||
title = find_first_level1_title(content)
|
||||
|
||||
# Convertir le contenu Org en HTML
|
||||
html_content = pypandoc.convert_text(content, 'html', format='org')
|
||||
# Désactiver les warning d'identifiant dupliqué dans la conversion pandoc
|
||||
content_without_h1 = re.sub(r'^\*.*?$', '', content, count=1, flags=re.MULTILINE)
|
||||
|
||||
html_content = pypandoc.convert_text(content_without_h1, 'html', format='org')
|
||||
|
||||
# html_content = pypandoc.convert_text(content, 'html', format='org')
|
||||
|
||||
files_dict[f"{annee}/{slug}"] = {
|
||||
'path': file_path,
|
||||
|
@ -186,8 +191,6 @@ def generate_article_pages(json_file, template_file, output_dir):
|
|||
with open(output_file, 'w', encoding='utf-8') as f:
|
||||
f.write(output_html)
|
||||
|
||||
# print(f"Page générée pour l'article {article['title']} dans {output_file}")
|
||||
|
||||
# Appel de la fonction pour générer les pages des articles
|
||||
generate_article_pages(destination_json + '/articles_info.json', 'templates/html/article.html.jinja', destination_html)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue