Site officiel de TheAfriForge https://theafriforge.org/fr/
  • HTML 97.9%
  • Dockerfile 1.7%
  • Shell 0.4%
Find a file
2026-05-20 14:20:02 +02:00
content feat: enhance SEO and add multilingual support with new meta tags and sitemap 2026-05-20 13:31:45 +02:00
i18n Refactor code structure for improved readability and maintainability 2026-05-20 14:20:02 +02:00
layouts Refactor code structure for improved readability and maintainability 2026-05-20 14:20:02 +02:00
scripts feat: add new project and single page layouts 2026-05-17 17:11:54 +02:00
static Refactor code structure for improved readability and maintainability 2026-05-20 14:20:02 +02:00
.dockerignore feat: add new project and single page layouts 2026-05-17 17:11:54 +02:00
.env.example feat: add new project and single page layouts 2026-05-17 17:11:54 +02:00
.gitignore feat: add new project and single page layouts 2026-05-17 17:11:54 +02:00
Dockerfile fix: update Dockerfile to use correct Hugo base image and adjust build process 2026-05-17 17:33:20 +02:00
hugo.toml Refactor code structure for improved readability and maintainability 2026-05-20 14:20:02 +02:00
README.md feat: add new project and single page layouts 2026-05-17 17:11:54 +02:00

TheAfriForge - Guide Local et Production

Ce projet est un site statique Hugo multilingue :

  • Francais par defaut sur /
  • Anglais sur /en/

1) Prerequis

Installe les outils suivants :

  • Hugo Extended (recommande: version recente)
  • Git

Verification rapide :

hugo version
git --version

2) Lancer le site en local

Depuis le dossier du projet :

cd /home/choudi/Bureau/Projets/Open-Ivoire/Clients/TheAfricaForge
hugo server --config ./hugo.toml -D

Ensuite ouvre :

Notes :

  • L'option -D permet d'afficher aussi les contenus draft.
  • Si tu ne veux pas les drafts, retire -D.

3) Erreur frequente: hugo server exit code 255

Si le serveur ne demarre pas et retourne 255, verifie :

  1. Un processus Hugo deja lance
pkill -f "hugo server" || true
  1. Presence du lock file dans le dossier projet
rm -f .hugo_build.lock
  1. Relance ensuite le serveur
hugo server --config ./hugo.toml -D

4) Build de production

Genere les fichiers statiques optimises dans public/ :

hugo --config ./hugo.toml --environment production --minify

Le dossier de sortie a deployer est :

  • public/

5) Tester la build de production en local

Option A (Python, simple) :

python3 -m http.server 8080 --directory public

Option B (Node) :

npx serve public

Puis ouvre :

6) Deploiement en production

Option 1 - VPS + Nginx (recommande pour controle complet)

  1. Build local :
hugo --config ./hugo.toml --environment production --minify
  1. Copier public/ vers le serveur :
rsync -avz --delete public/ user@ton-serveur:/var/www/theafriforge/
  1. Config Nginx minimale :
server {
    listen 80;
    server_name theafriforge.org www.theafriforge.org;

    root /var/www/theafriforge;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}
  1. Activer HTTPS via Certbot (recommande).

Option 2 - Netlify (ultra rapide)

Build command :

hugo --config ./hugo.toml --environment production --minify

Publish directory :

  • public

Important :

  • Selectionne Hugo Extended dans les settings de build si necessaire.

Option 3 - Cloudflare Pages

Build command :

hugo --config ./hugo.toml --environment production --minify

Build output directory :

  • public

Option 4 - Vercel (site statique)

Framework preset :

  • Hugo

Build command :

hugo --config ./hugo.toml --environment production --minify

Output directory :

  • public

7) Workflow recommande

  1. Developpement local avec hugo server
  2. Verification FR/EN sur / et /en/
  3. Build production avec minify
  4. Test rapide du dossier public/
  5. Deploiement sur hebergeur cible

8) Commandes utiles

Build standard :

hugo --config ./hugo.toml --minify

Nettoyage cache Hugo (si comportement etrange) :

rm -rf resources/_gen

Forcer un autre port local :

hugo server --config ./hugo.toml -D --port 1314