Files
TechradarDev/scripts/create-team-page.sh
syoul df4948c19a fix: amélioration script create-team-page avec iframe et awk
- Page Next.js utilise iframe pour charger team.html (plus simple)
- Utilisation d'awk pour modification Navigation.tsx (plus robuste)
- Meilleure gestion des erreurs
2025-12-06 22:15:05 +01:00

74 lines
2.0 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Script pour créer la page Next.js /team et modifier Navigation
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 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 { CustomPage } from "@/pages/_app";
const TeamPage: CustomPage = () => {
return (
<>
<Head>
<title>Équipe & Technologies - Laplank</title>
</Head>
<div style={{ width: '100%', height: '100vh', border: 'none', margin: 0, padding: 0 }}>
<iframe
src="/team.html"
style={{
width: '100%',
height: '100%',
border: 'none',
margin: 0,
padding: 0
}}
title="Équipe & Technologies"
/>
</div>
</>
);
};
export default TeamPage;
EOF
echo "✅ Page team.tsx créée (iframe)"
else
echo " Page team.tsx existe déjà"
fi
# Modifier Navigation.tsx pour ajouter le lien
if [ -f "$NAV_FILE" ]; then
if ! grep -q 'href="/team"' "$NAV_FILE"; then
# Ajouter le lien après Overview, avant le commentaire
# Utiliser une approche plus robuste avec awk ou perl
awk '
/href="\/overview"/ {
print
getline
print
print " <li className={styles.item}>"
print " <Link href=\"/team\">"
print " <span className={styles.label}>👥 Équipe</span>"
print " </Link>"
print " </li>"
next
}
{ print }
' "$NAV_FILE" > "$NAV_FILE.tmp" && mv "$NAV_FILE.tmp" "$NAV_FILE"
echo "✅ Lien Équipe ajouté au composant Navigation"
else
echo " Lien Équipe déjà présent dans Navigation"
fi
else
echo "⚠️ Navigation.tsx non trouvé: $NAV_FILE"
ls -la "$(dirname "$NAV_FILE")" || echo "Dossier non trouvé"
fi