From 322d9136b6137d403cdc95a460739a4153303a42 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Sun, 12 Apr 2026 08:00:58 +0200 Subject: [PATCH] PHP dynamique + cache JSON, nettoyage CSS/HTML, CI Forgejo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Renommage classes/IDs (BEM cohérent, anglais, noms sémantiques) - Correction HTML : h3→h2 FAQ, button>a→a[role=button] CTA mobile - Conversion index.html → index.php (FR/EN) avec cache JSON depuis API Kirby - Pages merci/thanks converties en PHP dynamique - Ajout includes/cache.php + includes/config.php (cache TTL 5min) - Ajout CI Forgejo (deploy FTP via lftp) Co-Authored-By: Claude Opus 4.6 --- .forgejo/workflows/deploy.yml | 32 + assets/css/components/_btn--don.scss | 4 +- assets/css/components/_form-newsletter.scss | 2 +- assets/css/components/_gauge.scss | 8 +- assets/css/components/_text.scss | 8 +- assets/css/partials/_site-footer.scss | 16 +- assets/css/style.css | 1312 +---------------- assets/css/template/store/_layout.scss | 2 +- .../css/template/store/_section--product.scss | 2 +- assets/css/template/store/_thanks.scss | 4 +- .../subscription-newsletter/_layout.scss | 6 +- assets/css/template/support/_layout.scss | 2 +- .../template/support/_section--comments.scss | 6 +- .../template/support/_section--donation.scss | 6 +- .../css/template/support/_section--video.scss | 12 +- assets/js/donation.js | 10 +- assets/js/donorbox-gauge.js | 2 +- assets/js/newsletter-brevo.js | 2 +- assets/js/onload.js | 4 +- en/index.html | 92 +- en/index.php | 270 ++++ includes/cache.php | 42 + includes/config.php | 6 + index.html | 128 +- index.php | 270 ++++ merci/index.html | 14 +- merci/index.php | 63 + thanks/index.html | 14 +- thanks/index.php | 63 + 29 files changed, 917 insertions(+), 1485 deletions(-) create mode 100644 .forgejo/workflows/deploy.yml create mode 100644 en/index.php create mode 100644 includes/cache.php create mode 100644 includes/config.php create mode 100644 index.php create mode 100644 merci/index.php create mode 100644 thanks/index.php diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml new file mode 100644 index 0000000..0972183 --- /dev/null +++ b/.forgejo/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy + +on: + push: + branches: + - main + +jobs: + deploy: + name: Deploy to Production + runs-on: docker + container: + image: forgejo-ci-php:latest + steps: + - name: Checkout code + run: | + git clone --depth 1 --branch main https://oauth2:${{ github.token }}@forge.studio-variable.com/${{ github.repository }}.git . + + - name: Deploy via FTP + env: + USERNAME: ${{ secrets.USERNAME }} + PASSWORD: ${{ secrets.PASSWORD }} + HOST: ${{ secrets.HOST }} + run: | + apt-get update -qq && apt-get install -y -qq lftp + cat > /tmp/lftp-script.txt < + + + + + + + + + + + + + + +
+
+
+

+ +
+
+
+

Regular supporters

+

0

+
+
+

Goal

+

500

+
+
+ +

+
+ +

+
+ +
+

+
+ +
+

+
+ +
+ + + + + +
    + +
  • + + + + + +

    +
  • + +
+ +
+ +
+

+ + +
+ + +
+ +
+
+ +
+
+ + +
+ + + + + +
+ +
+ + + + + +
+
+ +
+

+ +
+
+ +
+

+

+
+ +
+
+
+
+
+ + +
+ +
+ +
+ + + + diff --git a/includes/cache.php b/includes/cache.php new file mode 100644 index 0000000..9514a4f --- /dev/null +++ b/includes/cache.php @@ -0,0 +1,42 @@ + [ + 'timeout' => 5, + 'header' => "Referer: https://soutenir.index.ngo\r\n", + ], + ]); + + $response = @file_get_contents($url, false, $context); + + if ($response !== false) { + $data = json_decode($response, true); + if ($data && !isset($data['error'])) { + @file_put_contents($cacheFile, $response, LOCK_EX); + return $data; + } + } + + // Fallback: serve stale cache rather than nothing + if (file_exists($cacheFile)) { + return json_decode(file_get_contents($cacheFile), true) ?: []; + } + + return []; +} diff --git a/includes/config.php b/includes/config.php new file mode 100644 index 0000000..5f4447f --- /dev/null +++ b/includes/config.php @@ -0,0 +1,6 @@ +
-

+

Pour continuer à enquêter,
Index a besoin de vous

-
+
-
+

Soutiens réguliers

0

-
+

Objectif

500

-

+

Objectif 500 Soutiens
au 21 juin 2026

-

+

Index est une ONG d’investigation
à but non-lucratif.
Vos dons garantissent notre indépendance.

-

+

Pourquoi soutenir Index  ?
Écoutez les premier·es concerné·es

@@ -133,8 +133,8 @@ >
- -