Création d’un nouveau site

Créez un site web rapide et léger avec Hugo ! Découvrez comment installer Hugo, créer un site, installer un thème et rédiger des articles. Guide complet pour débuter avec ce générateur de sites statiques.

Par Jérémy Pastouret

9 août 2024

3 min

Partager cet article

Sur les réseaux sociaux

Ouvrez un terminal et lancez la commande suivante en remplaçant [nom_site] par un nom de projet. Hugo crée un dossier avec ce nom et y installe la structure par défaut.

hugo new site [nom_site]
Réponse de la console > Congratulations! Your new Hugo site was created in {path} > Just a few more steps... > 1. Change the current directory to /Users/jeremy• pastouret/Sites/ENI/enovateurs_ hugo.
2. Create or install a theme:
- Create a new theme with the command "hugo new theme ‹THEMENAME>"
- Install a theme from https:// themes.gohugo.io/
3. Edit hugo.toml, setting the "theme" property to the theme name.
4. Create new content with the command "hugo new content ‹SECTIONNAME>
5. Start the embedded web server with the command "hugo server --buildDrafts".

En quelques micro-secondes, la structure est prête - contrairement à WordPress ou NextJS, qui demandent à la fois davantage de temps et plus de fichiers.

Accédez au dossier créé :

cd [nom_site]