add org files, copy style

This commit is contained in:
Tykayn 2024-11-08 17:40:06 +01:00 committed by tykayn
parent 01e90048c1
commit 0b9f66167c
2947 changed files with 157595 additions and 22033 deletions

View file

@ -14,6 +14,7 @@ style_file = args.style
css_content = ""
with open(os.path.join(style_file), "r") as f:
css_content = f.read()
css_content = "<style type='text/css'>{css_content}</style>"
html_dir = args.html_dir
@ -26,7 +27,7 @@ for root, _, files in os.walk(html_dir):
html_content = f.read()
# Ajouter la déclaration de charset UTF-8, le doctype HTML et le titre du site Web
html_content = f"<!DOCTYPE html>\n<html lang=\"fr\">\n<head>\n<meta charset=\"UTF-8\">\n<title>{args.title}</title>\n<style type='text/css'>{css_content}</style></head>\n<body>\n<a href='/'>Retour à l'Accueil</a><hr/>{html_content}\n<footer><hr/><a href='/'>Retour à l'Accueil</a></footer></body>\n</html>"
html_content = f"<!DOCTYPE html>\n<html lang=\"fr\">\n<style type='text/css' src='/style.css'></style><head>\n<meta charset=\"UTF-8\">\n<title>{args.title}</title>\n{css_content}</head>\n<body>\n<a href='/'>Retour à l'Accueil</a><hr/>{html_content}\n<footer><hr/><a href='/'>Retour à l'Accueil</a></footer></body>\n</html>"
# Écrire le contenu modifié dans le fichier HTML
with open(os.path.join(root, file), "w") as f: