Installation

Comment ajouter le thème OSPO Hugo à votre site

Le thème OSPO Hugo peut être ajouté à un site Hugo existant de trois manières. L’approche par module Hugo est recommandée car elle verrouille la version du thème et permet sa mise à jour en une seule commande.

Prérequis

  • Hugo extended ≥ 0.134.0
  • Go (requis uniquement pour la méthode Module Hugo)

Méthode 1 — Module Hugo (recommandé)

  1. Vérifiez que Go est installé :
go version
  1. Initialisez votre site en tant que module Hugo (remplacez le chemin par le vôtre) :
hugo mod init github.com/<votre_utilisateur>/<votre-projet>
  1. Ajoutez l’import du thème dans votre hugo.yaml (ou hugo.toml) :
module:
  imports:
    - path: github.com/ospo-ch/ospo-hugo-theme
  1. Récupérez le module :
hugo mod get

Méthode 2 — Sous-module Git

Dans le répertoire de votre site Hugo :

git submodule add https://github.com/ospo-ch/ospo-hugo-theme.git themes/ospo

Puis définissez le thème dans votre configuration :

theme: ospo

Pour mettre à jour vers une version plus récente :

git submodule update --remote --merge

Méthode 3 — Clonage

git clone https://github.com/ospo-ch/ospo-hugo-theme themes/ospo

Définissez theme: ospo dans votre configuration. Pour mettre à jour, exécutez cd themes/ospo && git pull.