diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..48c4314
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,308 @@
+//! Build script — génère les pages HTML à partir du Markdown
+//!
+//! Exécuté à chaque `cargo build`. Garantit que :
+//! 1. changelog.html est généré depuis CHANGELOG.md
+//! 2. help.html est généré depuis ROADMAP.md
+//! 3. Le badge version dans index.html suit la version Cargo.toml
+
+use std::fs;
+use std::path::Path;
+
+fn main() {
+ let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
+ let version = env!("CARGO_PKG_VERSION");
+ let frontend_dir = manifest_dir.join("src/frontend");
+
+ // === changelog.html depuis CHANGELOG.md ===
+ let changelog_tmpl = frontend_dir.join("changelog.tmpl.html");
+ let changelog_md = manifest_dir.join("CHANGELOG.md");
+ let changelog_out = frontend_dir.join("changelog.html");
+
+ if changelog_tmpl.exists() && changelog_md.exists() {
+ let md = fs::read_to_string(&changelog_md).unwrap_or_default();
+ let html = simple_md_to_html(&md);
+ let tmpl = fs::read_to_string(&changelog_tmpl).unwrap_or_default();
+ let page = tmpl
+ .replace("{{VERSION}}", version)
+ .replace("{{CHANGELOG_CONTENT}}", &html);
+ fs::write(&changelog_out, &page).ok();
+ println!("cargo:rerun-if-changed=CHANGELOG.md");
+ println!("cargo:rerun-if-changed=src/frontend/changelog.tmpl.html");
+ }
+
+ // === help.html depuis ROADMAP.md ===
+ let help_tmpl = frontend_dir.join("help.tmpl.html");
+ let roadmap_md = manifest_dir.join("ROADMAP.md");
+ let help_out = frontend_dir.join("help.html");
+
+ if help_tmpl.exists() && roadmap_md.exists() {
+ let md = fs::read_to_string(&roadmap_md).unwrap_or_default();
+ let html = simple_md_to_html(&md);
+ let tmpl = fs::read_to_string(&help_tmpl).unwrap_or_default();
+ let page = tmpl
+ .replace("{{VERSION}}", version)
+ .replace("{{HELP_CONTENT}}", &html);
+ fs::write(&help_out, &page).ok();
+ println!("cargo:rerun-if-changed=ROADMAP.md");
+ println!("cargo:rerun-if-changed=src/frontend/help.tmpl.html");
+ }
+
+ // === Injection version dans index.html ===
+ let index_path = frontend_dir.join("index.html");
+ if index_path.exists() {
+ let mut content = fs::read_to_string(&index_path).unwrap_or_default();
+ // Remplacer tous les badges de version vX.Y.Z par la version courante
+ content = replace_all_versions(&content, version);
+ fs::write(&index_path, &content).ok();
+ println!("cargo:rerun-if-changed=src/frontend/index.html");
+ }
+
+ println!("cargo:info=✅ Pages HTML générées pour imagod-web v{version}");
+}
+
+/// Mini convertisseur Markdown → HTML (zéro dépendance)
+fn simple_md_to_html(md: &str) -> String {
+ let mut html = String::new();
+ let mut in_code_block = false;
+ let mut code_content = String::new();
+
+ for line in md.lines() {
+ if line.starts_with("```") {
+ if in_code_block {
+ html.push_str("
Badge version : Affichage v0.2.0 dans l'en-tête du dashboard
+
Pages statiques : changelog.html et help.html générées depuis le markdown, encastrées dans le binaire
+
Endpoint version : GET /api/version retourne la version, le build, l'OS et l'architecture
+
🐛 Corrections
+
Thumbnails 404 : Les miniatures échouaient car les balises <img> n'envoyaient pas le header X-API-Key. Correction : get_thumbnail() utilise toujours la clé serveur configurée, pas le header utilisateur
+
Clé API expirée : Mise à jour de la configuration avec la clé valide
+
🧪 Tests
+
Watcher Linux validé : Polling dossier fonctionnel, upload réussi vers Imago (image test ID=13), dédoublonnage confirmé
+
Phase 3 compilée : Code clipboard compilé et prêt, test Windows à venir
+
📚 Documentation
+
ROADMAP.md : Créé avec planification complète des phases 3 à 15
5. Corriger le backend Imago (thumbnails, upload, stockage)
-
❓ À propos d'imagod-web
-
-
Qu'est-ce que c'est ?
-
- imagod-web est une application de bureau (daemon + dashboard web)
- qui capture automatiquement vos screenshots et les envoie vers
- Imago,
- un backend intelligent de gestion d'images.
-
-
-
- 🎯 Objectif : ne plus jamais perdre un screenshot. Chaque capture
- est automatiquement analysée (OCR, vision IA, EXIF) et devient consultable
- via ce dashboard web.
-
-
-
Fonctionnalités
-
-
📸 Capture automatique — Windows : détection clipboard, Linux : surveillance de dossier
-
🧠 Analyse IA — description du contenu, tags automatiques, texte OCR
-
🔍 Recherche puissante — par nom, tags, description, texte extrait
-
🏷️ Tags personnalisés — ajoutez, modifiez, supprimez des tags