generate tags pages with jinja template

This commit is contained in:
Tykayn 2025-02-20 15:31:44 +01:00 committed by tykayn
parent 8e32423dce
commit 367c7754c6
8 changed files with 178 additions and 42 deletions

View file

@ -192,9 +192,13 @@ def add_tags_from_content(tags=None, file_content="", words_to_check=None):
# Parcourir chaque mot à vérifier
for word in words_to_check:
# Vérifier si le mot est présent dans le contenu du fichier
if word.lower() in file_content_lower:
# Ajouter le tag correspondant à l'ensemble de tags
tags.add(word)
# Chercher une correspondance sans mettre en lowercase si le tag est en majuscule, c'est sans doute un acronyme/sigle.
if word.isupper():
if word in file_content:
tags.add(word)
else:
if word.lower() in file_content_lower:
tags.add(word)
return tags