fix: amélioration détection liens /team/ et création HTML statique /team/index.html

- Détection améliorée pour inclure /team, /team/, /team.html
- Création d'un fichier HTML statique /team/index.html en plus de la page Next.js
- La page Next.js redirige maintenant vers /team.html directement
- Copie de /team/index.html dans out/ lors du build

Cela corrige :
- Les deux liens Équipe (détection de tous les formats)
- L'affichage du radar au lieu des visualisations (HTML statique garanti)
This commit is contained in:
syoul
2025-12-09 11:56:11 +01:00
parent cdbacdd434
commit 4f8d495579

View File

@@ -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 (
<>
<Head>
<title>Équipe & Technologies - Laplank</title>
<style>{`
body {
margin: 0;
padding: 0;
}
`}</style>
<meta httpEquiv="refresh" content="0;url=/team.html" />
</Head>
<div style={{ width: '100%', height: '100vh', border: 'none', margin: 0, padding: 0, position: 'fixed', top: 0, left: 0, zIndex: 1 }}>
<iframe
src="/team.html"
style={{
width: '100%',
height: '100%',
border: 'none',
margin: 0,
padding: 0,
display: 'block'
}}
title="Équipe & Technologies"
/>
<div style={{ padding: '20px', textAlign: 'center' }}>
<p>Redirection vers la page Équipe...</p>
<p><a href="/team.html">Cliquez ici si la redirection ne fonctionne pas</a></p>
</div>
</>
);
@@ -166,7 +125,42 @@ const TeamPage = () => {
export default TeamPage;
EOF
RUN echo "✅ Page team.tsx créée (masque le header pour éviter duplication)"
RUN echo "✅ Page team.tsx créée (redirige vers /team.html)"
# Créer aussi un fichier HTML statique /team/index.html pour garantir l'accès
RUN mkdir -p .techradar/public/team && \
cat > .techradar/public/team/index.html << 'EOF'
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Équipe & Technologies - Laplank</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
overflow: hidden;
}
iframe {
width: 100%;
height: 100%;
border: none;
display: block;
}
</style>
</head>
<body>
<iframe src="/team.html" title="Équipe & Technologies"></iframe>
</body>
</html>
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'à </li>
@@ -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 \