feat : versionnage semver, migrations contenu, bandeau mise à jour admin

- CHANGELOG.md : structure semver (1.0.0 / 1.1.0 / 1.2.0) remplace le journal non versionné
- public/version.txt : généré à chaque push depuis la première entrée CHANGELOG
- scripts/push.sh : extrait la version CHANGELOG avant git add
- src/UpdateChecker.php : compare version déployée vs version Gitea (raw file), cache 1 h
- templates/layout.php : bandeau alerte admin (nouvelle version / migrations en attente)
- templates/admin.php : dashboard moteur Folio (version déployée / disponible)
- scripts/migrate_content.php + migration_001 : ajout # titre dans les articles existants
- templates/maintenance.php : page HTTP 503 pendant une migration
- src/helpers.php : extractMarkdownTitle(), normalisation \r\n dans lineDiff()
- templates/wizard/step1.php : suppression champ titre, plan TOC dynamique
- public/assets/js/wizard.js : scope titleEl, scrollToCursor, buildToc, handlers externalisés

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-14 22:45:35 +02:00
parent c503f1dd66
commit 1dbe6d8dd3
13 changed files with 565 additions and 219 deletions
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Pousse le code Folio vers git.abonnel.fr/cedricAbonnel/folio
# Usage : ./scripts/push.sh "message de commit"
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$SCRIPT_DIR/.."
MSG="${1:-}"
if [[ -z "$MSG" ]]; then
echo "Usage: $0 \"message de commit\""
exit 1
fi
cd "$ROOT"
if [ ! -d .git ]; then
git init -b main
git remote add origin https://git.abonnel.fr/cedricAbonnel/folio.git
echo "→ Dépôt git initialisé"
fi
# Extraire la version depuis CHANGELOG.md (première entrée ## [X.Y.Z])
FOLIO_VERSION=$(grep -m1 '^\#\# \[[0-9]' CHANGELOG.md | sed 's/.*\[\([^]]*\)\].*/\1/')
if [[ -z "$FOLIO_VERSION" ]]; then
echo "✗ Impossible d'extraire la version depuis CHANGELOG.md"
exit 1
fi
echo "$FOLIO_VERSION" > public/version.txt
echo "→ Version : $FOLIO_VERSION"
git add -A
git diff --cached --quiet && echo "(rien à committer)" && exit 0
git commit -m "$MSG"
git push origin main
echo "✓ Poussé vers folio"