templates up

This commit is contained in:
Tykayn 2025-03-27 13:37:26 +01:00 committed by tykayn
parent 76008e80bf
commit 7b12ef533b
10 changed files with 42 additions and 99 deletions

View file

@ -108,7 +108,7 @@ def generate_html_pages_for_all_tags(tag_to_files, html_output_folder):
# Charger le template Jinja2
env = Environment(loader=FileSystemLoader('.'))
template = env.get_template('templates/html/tag.html.jinja')
template = env.get_template('templates/html/tag.html.j2')
sorted_tags = sorted(tag_to_files.items())
for tag, files in tag_to_files.items():
@ -141,7 +141,7 @@ def generate_index_page(tag_to_files, html_output_folder):
# Charger le template Jinja2
env = Environment(loader=FileSystemLoader('.'))
template = env.get_template('templates/html/tag.html.jinja')
template = env.get_template('templates/html/tag.html.j2')
sorted_tags = sorted(tag_to_files.items())
tags_count = {tag: len(files) for tag, files in sorted_tags}

View file

@ -466,7 +466,7 @@ Dernière mise à jour: {dt.datetime.now().strftime('%Y-%m-%d, %H:%M:%S')}
# Générer la page d'index seulement si des articles ont été convertis
if pandoc_runs_counter > 0 or run_gemini or force_html_regen:
# Appel de la fonction pour générer la page d'index
generate_blog_index(destination_json + '/articles_info.json', 'templates/html/index.html.jinja', destination_html + 'index.html')
generate_blog_index(destination_json + '/articles_info.json', 'templates/html/index.html.j2', destination_html + 'index.html')
print(f"\033[94m index régénéré {destination_html}index.html \033[0m")
# else:
@ -547,7 +547,7 @@ def generate_article_pages(json_file, template_file, output_dir):
# if pandoc_runs_counter or run_gemini:
# 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)
generate_article_pages(destination_json + '/articles_info.json', 'templates/html/article.html.j2', destination_html)
# À la fin du script, calculer et afficher le temps d'exécution
execution_time = time.time() - start_time

View file

@ -1,40 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:image" content="{{template_content['OG_IMAGE']}}">
<meta property="og:locale" content="{{template_content['LOCALE']}}">
<meta property="og:description" content="{{template_content['BLOG_SUBTITLE']}}">
<meta property="og:url" content="{{template_content['NDD']}}">
<meta property="og:site_name" content="{{template_content['TITLE']}}">
<link rel="alternate" type="application/atom+xml" title="Cipher Bliss » Flux"
href="{{template_content['NDD']}}/feed/">
<link href="/style.css" rel="stylesheet">
<script src="main_script.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ article.title | safe }} -{{template_content['TITLE']}}</title>
<meta name="author" content="{{template_content['AUTHOR']}}">
<link rel="alternate" type="application/rss+xml" title="{{template_content['BLOG_TITLE']}} » Flux"
href="{{template_content['NDD']}}/feed/">
<meta property="og:title" content="{{template_content['PAGE_TITLE']}}">
<meta property="og:locale" content="{{template_content['LOCALE']}}">
<!-- Description de la page -->
<meta name="description" content="{{template_content['PAGE_TITLE']}}">
<meta name="reply-to" content="{{template_content['EMAIL']}}">
<link rel="icon" type="{{template_content['SITE_ICON_TYPE']}}" href="{{template_content['SITE_ICON']}}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/go.min.js"></script>
<script>hljs.highlightAll();</script>
</head>
{% include 'site_head.j2' %}
<body>
<div id="page" class="page_article page__{{template_content['PAGE_SLUG']}} ">
<header id=" masthead" class="site-header">
<div class="header-image" style="background-image: url('{{template_content["BANNIERE_ENTETE"]}}');

View file

@ -0,0 +1 @@
coucou masthead.j2

View file

@ -0,0 +1,34 @@
<!DOCTYPE html lang="{{template_content['LOCALE']}}">
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:image" content="{{template_content['OG_IMAGE']}}">
<meta property="og:locale" content="{{template_content['LOCALE']}}">
<meta property="og:description" content="{{template_content['BLOG_SUBTITLE']}}">
<meta property="og:url" content="{{template_content['NDD']}}">
<meta property="og:site_name" content="{{template_content['TITLE']}}">
<link rel="alternate" type="application/atom+xml" title="Cipher Bliss » Flux"
href="{{template_content['NDD']}}/feed/">
<link href="/style.css" rel="stylesheet">
<script src="main_script.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ article.title | safe }} -{{template_content['TITLE']}}</title>
<meta name="author" content="{{template_content['AUTHOR']}}">
<link rel="alternate" type="application/rss+xml" title="{{template_content['BLOG_TITLE']}} » Flux"
href="{{template_content['NDD']}}/feed/">
<meta property="og:title" content="{{template_content['PAGE_TITLE']}}">
<meta property="og:locale" content="{{template_content['LOCALE']}}">
<!-- Description de la page -->
<meta name="description" content="{{template_content['PAGE_TITLE']}}">
<meta name="reply-to" content="{{template_content['EMAIL']}}">
<link rel="icon" type="{{template_content['SITE_ICON_TYPE']}}" href="{{template_content['SITE_ICON']}}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/go.min.js"></script>
<script>hljs.highlightAll();</script>
</head>

View file

@ -1,20 +0,0 @@
<!-- site_head.html.jinja -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:image" content="{{ template_content['SITE_ICON'] }}">
<meta property="og:locale" content="{{ template_content['LOCALE'] }}">
<meta property="og:description" content="{{ template_content['BLOG_SUBTITLE'] }}">
<meta property="og:url" content="{{ template_content['NDD'] }}">
<meta property="og:site_name" content="{{ template_content['TITLE'] }}">
<link rel="alternate" type="application/atom+xml" title="{{ template_content['BLOG_TITLE'] }} » Flux" href="{{ template_content['NDD'] }}/feed/">
<link href="/style.css" rel="stylesheet">
<script src="main_script.js"></script>
<title>{{ template_content['TITLE'] }}</title>
<meta name="author" content="{{ template_content['AUTHOR'] }}">
<link rel="alternate" type="application/rss+xml" title="{{ template_content['BLOG_TITLE'] }} » Flux" href="{{ template_content['NDD'] }}/feed/">
<meta property="og:title" content="{{ template_content['PAGE_TITLE'] }}">
<meta name="description" content="{{ template_content['PAGE_TITLE'] }}">
<meta name="reply-to" content="{{ template_content['EMAIL'] }}">
<link rel="icon" type="{{ template_content['SITE_ICON_TYPE'] }}" href="{{ template_content['SITE_ICON'] }}">
</head>

View file

@ -1,47 +1,5 @@
/*style général scss*/
// Variables de couleurs
$color-text: #000;
$color-background: #fff;
$color-heading: #333;
$color-heading-h1: #221d30;
$color-link: rgb(0, 123, 255);
$color-footer-bg: #aaa;
$color-footer-text: #dedede;
$color-page-bg: #f4f4f4;
$color-border: #dedede;
$color-blockquote-border: grey;
$color-link-hover-bg: #303030;
// Variables de taille
$article-width: 75ch;
$container-max-width: 70ch;
$font-size-base: 1rem;
$font-size-body: 1.5rem;
$font-size-content: 1.2rem;
$font-size-h1: 2.5rem;
$font-size-h2: 2rem;
$font-size-h3: 1.5rem;
$line-height-base: 1.5em;
$line-height-heading: 1.3em;
// Variables d'espacement
$spacing-xs: 0.5rem;
$spacing-sm: 1rem;
$spacing-md: 1.5rem;
$spacing-lg: 2rem;
$spacing-xl: 5rem;
$padding-container: 5% 6%;
$border-radius-sm: 0.5rem;
$border-radius-md: 1rem;
// Variables de police
$font-family-base: Helvetica, "Ubuntu Sans", "Noto Sans", Calibri, Arial, sans-serif;
$font-family-heading: Helvetica, "Ubuntu Sans", "Noto Sans", Calibri, Arial, sans-serif;
// Variables de transition
$transition-hover: 0.25s all ease-in;
$transition-out: 0.25s box-shadow ease-out;
@use 'variables' as *;
* {
box-sizing: border-box;