Header menu via header.js

This commit is contained in:
karim hassan
2025-08-24 23:47:39 +00:00
parent f1103d67a0
commit eabd0aa50f
25 changed files with 869 additions and 185 deletions

29
apply_bubbles_patch.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="${1:-.}"
BASE="$ROOT/frontend/public"
[ -d "$BASE" ] || { echo "❌ Dossier $BASE introuvable"; exit 1; }
link_css='<link rel="stylesheet" href="/assets/patch-bubbles.css?v=2" />'
script_js='<script type="module" src="/assets/bubbles.js?v=2"></script>'
changed=0
# Boucle sur tous les .html (récursif via find, compatible macOS)
while IFS= read -r -d '' page; do
# Inject CSS avant </head>
if ! grep -q 'patch-bubbles.css' "$page"; then
sed -i '' -e "s#</head># ${link_css}\n</head>#g" "$page"
echo " CSS -> $page"
changed=$((changed+1))
fi
# Inject JS avant </body>
if ! grep -q 'bubbles.js' "$page"; then
sed -i '' -e "s#</body># ${script_js}\n</body>#g" "$page"
echo " JS -> $page"
changed=$((changed+1))
fi
done < <(find "$BASE" -type f -name "*.html" -print0)
echo "✅ Injection terminée (${changed} modifications)."