diff --git a/scripts/create-team-page.sh b/scripts/create-team-page.sh index d058850..15821bd 100755 --- a/scripts/create-team-page.sh +++ b/scripts/create-team-page.sh @@ -6,56 +6,31 @@ TECHRADAR_DIR=".techradar" TEAM_PAGE="$TECHRADAR_DIR/src/pages/team.tsx" NAV_FILE="$TECHRADAR_DIR/src/components/Navigation/Navigation.tsx" -# Créer la page team.tsx +# Créer la page team.tsx qui charge team.html via iframe (plus simple et fiable) if [ ! -f "$TEAM_PAGE" ]; then mkdir -p "$(dirname "$TEAM_PAGE")" cat > "$TEAM_PAGE" << 'EOF' import Head from "next/head"; -import { useEffect } from "react"; import { CustomPage } from "@/pages/_app"; const TeamPage: CustomPage = () => { - useEffect(() => { - // Charger le contenu de team.html dans cette page - const loadTeamPage = async () => { - try { - const response = await fetch('/team.html'); - if (response.ok) { - const html = await response.text(); - const parser = new DOMParser(); - const doc = parser.parseFromString(html, 'text/html'); - const content = doc.body.innerHTML; - const container = document.getElementById('team-container'); - if (container) { - container.innerHTML = content; - // Réexécuter les scripts - const scripts = container.querySelectorAll('script'); - scripts.forEach(oldScript => { - const newScript = document.createElement('script'); - Array.from(oldScript.attributes).forEach(attr => { - newScript.setAttribute(attr.name, attr.value); - }); - newScript.textContent = oldScript.textContent; - oldScript.parentNode?.replaceChild(newScript, oldScript); - }); - } - } - } catch (error) { - console.error('Erreur lors du chargement de team.html:', error); - } - }; - loadTeamPage(); - }, []); - return ( <>
Chargement de la page Équipe...
-