Documenter les modes de build SSG/SSR et la configuration StoryBlok
This commit is contained in:
parent
058ebe09c2
commit
de8404873f
1 changed files with 51 additions and 13 deletions
64
README.md
64
README.md
|
|
@ -1,20 +1,58 @@
|
|||
<div align="center">
|
||||
<img width="1200" height="475" alt="GHBanner" src="https://github.com/user-attachments/assets/0aa67016-6eaf-458a-adb2-6e31a0763ed6" />
|
||||
</div>
|
||||
# Compagnie AspiRêves
|
||||
|
||||
# Run and deploy your AI Studio app
|
||||
Site web de la Compagnie AspiRêves, compagnie de spectacle vivant basée dans le Tarn.
|
||||
|
||||
This contains everything you need to run your app locally.
|
||||
Construit avec [Astro](https://astro.build/) et [StoryBlok](https://www.storyblok.com/) comme CMS headless.
|
||||
|
||||
View your app in AI Studio: https://ai.studio/apps/888a76b0-af1d-4274-9218-1817cdc461fb
|
||||
## Prérequis
|
||||
|
||||
## Run Locally
|
||||
- Node.js >= 20
|
||||
- Un fichier `.env` (voir `.env.example`)
|
||||
|
||||
**Prerequisites:** Node.js
|
||||
## Développement
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
1. Install dependencies:
|
||||
`npm install`
|
||||
2. Set the `GEMINI_API_KEY` in [.env.local](.env.local) to your Gemini API key
|
||||
3. Run the app:
|
||||
`npm run dev`
|
||||
Le serveur démarre sur `http://localhost:3030`.
|
||||
|
||||
## Builds
|
||||
|
||||
Le projet supporte deux modes de build via la variable `STORYBLOK_IS_PREVIEW` :
|
||||
|
||||
### Production (SSG)
|
||||
|
||||
Site statique, performant, sans serveur Node.js. Utilise le **Public Access Token** StoryBlok et ne récupère que le contenu **publié**.
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
Génère des fichiers HTML statiques dans `dist/`. Le rebuild doit être déclenché par un **webhook StoryBlok** (Settings > Webhooks) à chaque publication de contenu.
|
||||
|
||||
### Preview (SSR)
|
||||
|
||||
Serveur Node.js avec le **visual editor StoryBlok** (bridge + live preview). Utilise le **Preview Access Token** et récupère le contenu en **draft**.
|
||||
|
||||
```bash
|
||||
STORYBLOK_IS_PREVIEW=true npm run build
|
||||
HOST=0.0.0.0 node dist/server/entry.mjs
|
||||
```
|
||||
|
||||
Le serveur démarre sur le port `8080` par défaut (configurable via `PORT`).
|
||||
|
||||
### Variables d'environnement
|
||||
|
||||
| Variable | Production | Preview |
|
||||
|---|---|---|
|
||||
| `STORYBLOK_TOKEN` | Public Access Token | Preview Access Token |
|
||||
| `STORYBLOK_IS_PREVIEW` | *(non défini)* | `true` |
|
||||
| `CC_POST_BUILD_HOOK` | `npm run build` | `npm run build` |
|
||||
| `HOST` | - | `0.0.0.0` |
|
||||
|
||||
### Configuration StoryBlok
|
||||
|
||||
- **Settings > Visual Editor** : mettre l'URL de l'instance preview comme environnement par défaut
|
||||
- **Settings > Webhooks** : configurer un webhook vers l'instance production pour déclencher le rebuild à chaque publication
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue