Conversation
239bbd7 to
2055ceb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tâche : Gestion des images du site (Astro + pipeline sponsors)
Objectif
Mettre en place une gestion des images en deux volets :
Images éditoriales et UI
→ gérées par le système natif d’Astro (
astro:assets) avec optimisation automatique au build.Images de sponsors
→ gérées hors Astro via une étape de build supplémentaire en JavaScript, afin de supporter :
Le site est 100 % statique, avec une structure i18n (
/et/en).Périmètre
Inclus
Exclu
1. Gestion des images standard via Astro
1.1 Configuration Astro
Fichier :
astro.config.mjs1.2 Organisation des fichiers
src/ assets/ images/ hero-home.jpg hero-about.jpg components/ pages/Toutes les images devant être optimisées par Astro doivent se trouver dans
src/assets.1.3 Utilisation dans un composant Astro
Astro :
<picture>optimisé,1.4 Utilisation dans MDX
2. Gestion des images de sponsors (pipeline dédié)
2.1 Contrainte fonctionnelle
Les images de sponsors :
👉 Elles ne peuvent donc pas utiliser
astro:assets.2.2 Organisation des fichiers sponsors
Sortie attendue :
public/ sponsors/ acme.fr.avif acme.fr.webp acme.en.avif acme.en.webp globex.avif globex.webp2.3 Script d’optimisation sponsors
Fichier :
scripts/optimize-sponsors.mjs2.4 Intégration dans la chaîne de build
Fichier :
package.json{ "scripts": { "build:sponsors": "node scripts/optimize-sponsors.mjs", "build": "npm run build:sponsors && astro build" } }3. Utilisation des images sponsors côté Astro
Composant Astro