From 3efa55919f7f17362e86b1c50910ee9347bc8d45 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 14 Nov 2024 17:46:35 +0100 Subject: [PATCH] make tags page linked to files --- gather_tags_in_json.py | 34 +- .../2021/20211211215731-krita/index.html | 332 ++++++++++++++++++ .../index.html | 332 ++++++++++++++++++ .../20241112000047-sketches_18/index.html | 332 ++++++++++++++++++ .../index.html | 332 ++++++++++++++++++ .../20241112000537-kinktober_2023/index.html | 332 ++++++++++++++++++ .../20241112000653-calin_yuri_ah/index.html | 332 ++++++++++++++++++ .../index.html | 332 ++++++++++++++++++ .../index.html | 332 ++++++++++++++++++ .../index.html | 332 ++++++++++++++++++ .../index.html | 332 ++++++++++++++++++ .../index.html | 332 ++++++++++++++++++ html-websites/tykayn_blog/a-propos.html | 332 ++++++++++++++++++ html-websites/tykayn_blog/accueil.html | 332 ++++++++++++++++++ html-websites/tykayn_blog/blogroll.html | 332 ++++++++++++++++++ html-websites/tykayn_blog/contact.html | 332 ++++++++++++++++++ html-websites/tykayn_blog/coucou.html | 332 ++++++++++++++++++ .../tykayn_blog/footer-articles.html | 332 ++++++++++++++++++ html-websites/tykayn_blog/index.html | 332 ++++++++++++++++++ html-websites/tykayn_blog/projets.html | 332 ++++++++++++++++++ html-websites/tykayn_blog/tag/.html | 17 - .../tykayn_blog/tag/ayominai hitomi.html | 17 - html-websites/tykayn_blog/tag/conseils.html | 17 - html-websites/tykayn_blog/tag/couleurs.html | 17 - html-websites/tykayn_blog/tag/illus.html | 17 - .../tykayn_blog/tag/illustration.html | 22 -- html-websites/tykayn_blog/tag/mono.html | 17 - html-websites/tykayn_blog/tag/nsfw.html | 21 -- html-websites/tykayn_blog/tags/.html | 122 +++++++ .../tykayn_blog/tags/ayominai hitomi.html | 122 +++++++ html-websites/tykayn_blog/tags/conseils.html | 122 +++++++ html-websites/tykayn_blog/tags/couleurs.html | 122 +++++++ html-websites/tykayn_blog/tags/illus.html | 122 +++++++ .../tykayn_blog/tags/illustration.html | 127 +++++++ html-websites/tykayn_blog/tags/index.html | 128 +++++++ html-websites/tykayn_blog/tags/mono.html | 122 +++++++ html-websites/tykayn_blog/tags/nsfw.html | 126 +++++++ 37 files changed, 7454 insertions(+), 146 deletions(-) delete mode 100644 html-websites/tykayn_blog/tag/.html delete mode 100644 html-websites/tykayn_blog/tag/ayominai hitomi.html delete mode 100644 html-websites/tykayn_blog/tag/conseils.html delete mode 100644 html-websites/tykayn_blog/tag/couleurs.html delete mode 100644 html-websites/tykayn_blog/tag/illus.html delete mode 100644 html-websites/tykayn_blog/tag/illustration.html delete mode 100644 html-websites/tykayn_blog/tag/mono.html delete mode 100644 html-websites/tykayn_blog/tag/nsfw.html create mode 100644 html-websites/tykayn_blog/tags/.html create mode 100644 html-websites/tykayn_blog/tags/ayominai hitomi.html create mode 100644 html-websites/tykayn_blog/tags/conseils.html create mode 100644 html-websites/tykayn_blog/tags/couleurs.html create mode 100644 html-websites/tykayn_blog/tags/illus.html create mode 100644 html-websites/tykayn_blog/tags/illustration.html create mode 100644 html-websites/tykayn_blog/tags/index.html create mode 100644 html-websites/tykayn_blog/tags/mono.html create mode 100644 html-websites/tykayn_blog/tags/nsfw.html diff --git a/gather_tags_in_json.py b/gather_tags_in_json.py index f2c610c9..8c020324 100644 --- a/gather_tags_in_json.py +++ b/gather_tags_in_json.py @@ -6,7 +6,7 @@ from collections import defaultdict blog_folder = 'tykayn_blog' directory = f'sources/{blog_folder}/lang_fr' # Remplacez par le chemin de votre dossier output_file = f'sources/{blog_folder}/converted/tags.json' # Fichier de sortie -html_output_folder = f'html-websites/{blog_folder}/tag' # Dossier de sortie pour les fichiers HTML +html_output_folder = f'html-websites/{blog_folder}/tags' # Dossier de sortie pour les fichiers HTML excluded_tags = {'PROPERTIES', 'CREATED', 'ID', 'END'} @@ -76,6 +76,7 @@ def generate_html_pages(tag_to_files, html_output_folder): html_content += """ +

Retour à l'index des tags

""" @@ -87,11 +88,42 @@ def generate_html_pages(tag_to_files, html_output_folder): print(f"Pages HTML générées dans {html_output_folder}") +def generate_index_page(tag_to_files, html_output_folder): + index_content = f""" + + + + + + Index des tags + + +

Index des tags

+ + + + """ + + index_file_path = os.path.join(html_output_folder, "index.html") + with open(index_file_path, 'w', encoding='utf-8') as index_file: + index_file.write(index_content) + + print(f"Page d'index générée dans {html_output_folder}") + + if __name__ == "__main__": org_files = find_org_files(directory) tag_to_files = group_files_by_tags(org_files, excluded_tags) save_to_json(tag_to_files, output_file) generate_html_pages(tag_to_files, html_output_folder) + generate_index_page(tag_to_files, html_output_folder) print(f"Tags et fichiers associés ont été enregistrés dans {output_file}") print(f"Pages HTML générées dans {html_output_folder}") \ No newline at end of file diff --git a/html-websites/tykayn_blog/2021/20211211215731-krita/index.html b/html-websites/tykayn_blog/2021/20211211215731-krita/index.html index ddd6e892..ceb2d574 100644 --- a/html-websites/tykayn_blog/2021/20211211215731-krita/index.html +++ b/html-websites/tykayn_blog/2021/20211211215731-krita/index.html @@ -81,6 +81,222 @@
+
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+ +
+ +

+ +

+
+
+ + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + + + + +

+ +

+ + +