website/README.md

137 lines
3.9 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
# TheAfriForge
**TheAfriForge** est un site statique multilingue (Français/Anglais) construit avec Hugo, dédié à la valorisation des initiatives africaines, à la transparence et à la collaboration.
## 🌍 Présentation
- **Site principal** : [theafriforge.org](https://theafriforge.org/)
- **Organisation** : TheAfriForge
- **Langues** : Français (par défaut), Anglais (`/en/`)
- **Code source** : [GitForge](https://gitforge.africa/TheAfriForge/website.git)
- **Contact** : [@theafriforge](https://twitter.com/theafriforge)
## 🚀 Prérequis
- [Hugo Extended](https://gohugo.io/getting-started/installing/) (version récente recommandée)
- Git
- (Optionnel) Python 3 ou Node.js pour tester la build
## 🔧 Installation & Lancement local
```bash
git clone https://gitforge.africa/TheAfriForge/website.git
cd website
hugo server --config ./hugo.toml -D
```
## ⚙️ Configuration de l'environnement
Avant de lancer le projet, copie le fichier `.env.example` en `.env` et adapte les variables à ton contexte :
```bash
cp .env.example .env
# puis édite .env selon tes besoins
```
Exemple de variables (remplace par tes propres valeurs) :
```env
# Endpoint du formulaire dadhésion
HUGO_MEMBERSHIP_FORM_ACTION=https://exemple-endpoint
# Formbricks SDK (recommandé)
HUGO_FORMBRICKS_API_HOST=https://exemple-formbricks
HUGO_FORMBRICKS_ENV_ID=xxxxxxx
HUGO_FORMBRICKS_EVENT=membership_form_submitted
HUGO_FORMBRICKS_SDK_URL=https://exemple-formbricks/js/formbricks.umd.cjs
# Redirection après succès (optionnel)
HUGO_MEMBERSHIP_FORM_SUCCESS_PATH=/chemin-de-redirection
```
## 🐳 Utilisation avec Docker
Pour lancer le site localement avec Docker :
```bash
docker build -t theafriforge .
docker run -p 1313:1313 theafriforge
```
Le site sera accessible sur [http://localhost:1313/](http://localhost:1313/).
Pour la production, adapte la commande de build selon tes besoins (voir le Dockerfile).
- Accès local : [http://localhost:1313/](http://localhost:1313/) (FR), [http://localhost:1313/en/](http://localhost:1313/en/) (EN)
- Loption `-D` affiche aussi les contenus en brouillon.
## 🏗️ Structure du projet
- `content/fr/` et `content/en/` : Contenus en français et anglais
- `layouts/` : Templates Hugo
- `static/` : Fichiers statiques (images, etc.)
- `public/` : Build de production générée
- `hugo.toml` : Configuration principale
## 🛠️ Commandes utiles
- Build de production :
```bash
hugo --config ./hugo.toml --environment production --minify
```
- Nettoyage du cache Hugo :
```bash
rm -rf resources/_gen
```
- Forcer un autre port local :
```bash
hugo server --config ./hugo.toml -D --port 1314
```
## 🐞 Dépannage
- Si `hugo server` retourne le code 255 :
- Arrêter les processus Hugo : `pkill -f "hugo server" || true`
- Supprimer `.hugo_build.lock` : `rm -f .hugo_build.lock`
- Relancer le serveur.
## 🚢 Déploiement
### Option 1 : VPS + Nginx
1. Générer la build :
```bash
hugo --config ./hugo.toml --environment production --minify
```
2. Copier le dossier `public/` sur le serveur :
```bash
rsync -avz --delete public/ user@serveur:/var/www/theafriforge/
```
3. Configurer Nginx (voir exemple ci-dessous) :
```nginx
server {
listen 80;
server_name theafriforge.org www.theafriforge.org;
root /var/www/theafriforge;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
```
4. Activer HTTPS (Certbot recommandé).
### Option 2 : Netlify / Cloudflare Pages / Vercel
- Build command : `hugo --config ./hugo.toml --environment production --minify`
- Output/Publish directory : `public`
- Sélectionner Hugo Extended si nécessaire.
## 📄 Licence
Ce projet est open source, voir le dépôt pour plus dinformations.
server_name theafriforge.org www.theafriforge.org;