diff --git a/Dockerfile.business b/Dockerfile.business index 2ec76a5..a97cc28 100644 --- a/Dockerfile.business +++ b/Dockerfile.business @@ -94,7 +94,8 @@ RUN echo "📊 Comptage des fichiers .md dans .techradar/data/radar" && \ find .techradar/data/radar -name "*.md" | wc -l && \ find .techradar/data/radar -name "*.md" | head -10 -# Créer la page Next.js /team avec layout minimal (sans Navigation pour éviter duplication) +# Créer la page Next.js /team ET un fichier HTML statique /team/index.html +# La page Next.js pour le routing, le HTML statique pour garantir l'affichage RUN mkdir -p .techradar/src/pages && \ cat > .techradar/src/pages/team.tsx << 'EOF' import Head from "next/head"; @@ -102,63 +103,21 @@ import { useEffect } from "react"; const TeamPage = () => { useEffect(() => { - // Masquer le header/navigation existant pour éviter la duplication - const header = document.querySelector('header') || document.querySelector('nav') || document.querySelector('[class*="Navigation"]'); - const nav = document.querySelector('nav'); - - if (header) { - header.style.display = 'none'; + // Rediriger vers team.html directement pour éviter les problèmes de routing + if (typeof window !== 'undefined') { + window.location.href = '/team.html'; } - if (nav && nav !== header) { - nav.style.display = 'none'; - } - - // Masquer aussi les éléments avec className contenant Navigation - const navElements = document.querySelectorAll('[class*="Navigation"]'); - navElements.forEach(el => { - if (el !== header && el !== nav) { - (el as HTMLElement).style.display = 'none'; - } - }); - - // Nettoyer au démontage - return () => { - if (header) { - (header as HTMLElement).style.display = ''; - } - if (nav && nav !== header) { - (nav as HTMLElement).style.display = ''; - } - navElements.forEach(el => { - (el as HTMLElement).style.display = ''; - }); - }; }, []); return ( <> Équipe & Technologies - Laplank - + -
- + + +EOF +RUN echo "✅ Fichier /team/index.html créé (HTML statique)" # Script Python pour ajouter le lien Équipe dans Navigation.tsx (supprime TOUS les doublons) RUN cat > /tmp/add_team_link.py << 'PYEOF' @@ -258,8 +252,8 @@ try: while i < len(lines): line = lines[i] - # Détecter le début d'un lien Équipe (inclut /team et /team.html) - if ('href="/team"' in line or "href='/team'" in line or 'href="/team.html"' in line or "href='/team.html'" in line) and not skip_team_link: + # Détecter le début d'un lien Équipe (inclut /team, /team/, /team.html) + if ('href="/team' in line or "href='/team" in line) and not skip_team_link: skip_team_link = True team_links_removed += 1 # Ignorer cette ligne et les lignes suivantes jusqu'à @@ -305,10 +299,10 @@ try: with open(f, 'w', encoding='utf-8') as file: file.writelines(new_lines) - # Vérifier qu'il n'y a qu'un seul lien maintenant (inclut /team et /team.html) + # Vérifier qu'il n'y a qu'un seul lien maintenant (inclut /team, /team/, /team.html) with open(f, 'r', encoding='utf-8') as file: final_content = file.read() - final_count = len(re.findall(r'href=["\']/?team(\.html)?["\']', final_content)) + final_count = len(re.findall(r'href=["\']/?team(/|\.html)?["\']', final_content)) if final_count == 1: print("✅ Navigation.tsx modifié - 1 seul lien Équipe présent") @@ -346,8 +340,8 @@ fi # Exécuter le script Python if python3 /tmp/add_team_link.py; then - # Vérifier le résultat (inclut /team et /team.html) - team_count=$(grep -cE 'href="/team|href="/team\.html' "$NAV_FILE" 2>/dev/null || echo "0") + # Vérifier le résultat (inclut /team, /team/, /team.html) + team_count=$(grep -cE 'href="/team' "$NAV_FILE" 2>/dev/null || echo "0") echo "📊 Nombre d'occurrences trouvées: $team_count" if [ "$team_count" -eq "1" ]; then @@ -355,7 +349,7 @@ if python3 /tmp/add_team_link.py; then elif [ "$team_count" -gt "1" ]; then echo "⚠️ Plusieurs occurrences détectées ($team_count), relance du nettoyage..." python3 /tmp/add_team_link.py - final_count=$(grep -cE 'href="/team|href="/team\.html' "$NAV_FILE" 2>/dev/null || echo "0") + final_count=$(grep -cE 'href="/team' "$NAV_FILE" 2>/dev/null || echo "0") echo "✅ Après nettoyage: $final_count occurrence(s)" else echo "❌ Lien Équipe non trouvé après modification" @@ -459,7 +453,7 @@ RUN if [ -d "out" ]; then \ fi && \ echo "" && \ echo "📋 Vérification finale de Navigation.tsx après build:" && \ - grep -qE 'href="/team|href="/team\.html' src/components/Navigation/Navigation.tsx && echo "✅ Lien Équipe toujours présent dans Navigation.tsx après build" || echo "❌ Lien Équipe absent de Navigation.tsx après build" && \ + grep -qE 'href="/team' src/components/Navigation/Navigation.tsx && echo "✅ Lien Équipe toujours présent dans Navigation.tsx après build" || echo "❌ Lien Équipe absent de Navigation.tsx après build" && \ echo "" && \ echo "🔍 Vérification des doublons dans le HTML généré..." && \ if [ -f "out/index.html" ]; then \